How to rename a file using Mercurial Queues?

Mercurial Queues are fixes, and patches do not know anything about file renames. Is this the reason that Mercurial Queues do not support file renaming, or am I doing something to rename a file incorrectly? I worked on the patch queue, changing only one file named foo . Now I go back to patch 4 and rename the file via hg mv :

 hg qpop 4 # Unapply all patches until patch 4. hg mv foo bar # Rename file and led Mercuial know about it. hg qrefresh # Should apply changes to unapplied patch 4. hg qpush -a # Should apply all unapplied patches. 

I get the following error:

 unable to find 'foo' for patching 1 out of 1 hunks FAILED -- saving rejects to file foo.rej patch failed, unable to continue (try -v) patch failed, rejects left in working dir errors during apply, please fix and refresh 5.diff 

So how do I do to handle renaming files in Mercurial Queues? Mercurial fixes the renaming of files for any reason (as without this, it will lose the entire history of editing the file after renaming).

Update

Just noticed that hg histedit folding changesets and hg collapse also lose information about renaming files, the file is displayed as new rather than renamed, and I think this is for the same reason. It seems that Mercurial does not flush private sets of changes without losing this information?

Update 2

It was found that folding private sets of changes without losing renaming information is possible using hg rebase and its --collapse option, for example. hg rebase -s 5 -d 4 --collapse . The problem is that other commands must recreate the renaming of the information, it is empty, but with the hg rebase there is at least a way to achieve the desired result.

+4
source share
1 answer

Is this the reason that Mercurial Queues do not support file renaming,

no.

or am I renaming a file incorrectly?

no.

Yes, corrections in the chain will have problems if they were prepared for the foo file, but later there will be bar , but for various reasons: patches are independent and each and every patch does not know anything about changes in others - they work with context, not with the sequence of operations in separate patches. You did the renaming correctly, but this changeet cancels the subsequent changes prepared in the old content

0
source

All Articles