I have a Mercurial repository with four branches in it. One is the "common" branch, the other three are "specific" branches which consist of some cosmetic changes applied to the common branch. One of those cosmetic changes consisted of renaming some files.
So the common branch has "file.txt", and the first specific branch has "file-01.txt" which is the same file, used for the same purpose but has a different name and slightly different contents. It was renamed to file-01.txt on the specific branch, and "hg log -f file-01.txt" correctly shows the history going back to before the rename.
When I make a change to file.txt on the common branch, I need to be able to merge that change into file-01.txt on the specific branch. But Mercurial doesn't understand that the files are the same. It tells me:
remote changed file.txt which local deleted
use (c)hanged version or leave (d)eleted?
If I pick "c" then I get a new file.txt containing exactly what's in the common branch's version. If I pick "d" then the change isn't merged at all.
What can I do to get this right?
EDIT: I can make it work correctly in a fresh test repository, but not my actual repo. Here's what I get (note that rev 118 is on the specific branch, just before the original rename, so I'm going through the rename process again to illustrate):
C:\...> hg update -C 118
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
C:\...> hg merge default
merging file.txt
merging anotherfile.txt
0 files updated, 2 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
So it works without the rename. But if I rename, it fails:
C:\...> hg update -C 118
2 files updated, 0 files merged, 0 files removed, 0 files resolved
C:\...> hg rename file.txt file-01.txt
C:\...> hg commit -m "renamed"created new head
C:\...> hg merge default
remote changed file.txt which local deleted
use (c)hanged version or leave (d)eleted?
EDIT 2: Here's what I get at that last step from hg merge --debug default
:
searching for copies back to rev 115
unmatched files in local:
file-01.txt
all copies found (* = to merge, ! = divergent):
file-01.txt -> file.txtchecking for directory renames
resolving manifests
overwrite None partial False
ancestor 9d979018c2df local f842fdbc252b+ remote 05fc75e480da
anotherfile.txt: versions differ -> m
remote changed file.txt which local deleted
use (c)hanged version or leave (d)eleted?