[Bug 4748] New: merging a renamed file from a branch into default branch without modification losts origin

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Jul 8 08:28:34 UTC 2015


http://bz.selenic.com/show_bug.cgi?id=4748

          Priority: normal
            Bug ID: 4748
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: merging a renamed file from a branch into default
                    branch without modification losts origin
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: jeremy.parente at oneaccess-net.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.4.2
         Component: Mercurial
           Product: Mercurial

Created attachment 1847
  --> http://bz.selenic.com/attachment.cgi?id=1847&action=edit
Test script

Hi,

when merging two heads (or a branch to another), if a file has been renamed
(with "hg mv") in a head but not modified in the other head, the "hg diff
--git" is unable to say that the file has been renamed, instead it tells that a
file has been removed and another added (test1).

But if you have done some modification to the file in the other head, the "hg
diff --git" properly says that the file has been renamed (test2) !

Test script is in attachment. Here is my result:


jparente at sky[~/tmp/test]> ./hg_merge_rename.sh 
Mercurial Distributed SCM (version 3.1.2)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2014 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
marked working directory as branch cheese
(branches are permanent and global, did you want a bookmark?)
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
(branch merge, don't forget to commit)
# test1 diff --git after merge:
diff --git a/eggs b/eggs
deleted file mode 100644
--- a/eggs
+++ /dev/null
@@ -1,1 +0,0 @@
-My eggs file
diff --git a/sausages b/sausages
new file mode 100644
--- /dev/null
+++ b/sausages
@@ -0,0 +1,1 @@
+My eggs file
Mercurial Distributed SCM (version 3.1.2)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2014 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
marked working directory as branch cheese
(branches are permanent and global, did you want a bookmark?)
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
merging eggs and sausages to sausages
0 files updated, 1 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
# test2 diff --git after merge:
diff --git a/eggs b/eggs
deleted file mode 100644
--- a/eggs
+++ /dev/null
@@ -1,1 +0,0 @@
-My eggs file is modified
diff --git a/eggs b/sausages
rename from eggs
rename to sausages

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list