merge: fix UnboundLocalError (issue3791) stable
authorMads Kiilerich <madski@unity3d.com>
Wed, 30 Jan 2013 19:29:36 +0100
branchstable
changeset 18505 9de9727cea53
parent 18504 d1d5fdcc2d46
child 18506 ef60083b5536
merge: fix UnboundLocalError (issue3791) A wrong variable name was introduced in 384df4db6520 for a case without test coverage. The variable name is fixed and a test case is introduced.
mercurial/merge.py
tests/test-merge-types.t
--- a/mercurial/merge.py	Mon Jan 28 19:05:35 2013 +0900
+++ b/mercurial/merge.py	Wed Jan 30 19:29:36 2013 +0100
@@ -251,7 +251,7 @@
             elif nol and n2 == a: # remote only changed 'x'
                 act("update permissions", "e", f, fl2)
             elif nol and n == a: # local only changed 'x'
-                act("remote is newer", "g", f, fl)
+                act("remote is newer", "g", f, fl1)
             else: # both changed something
                 act("versions differ", "m", f, f, f, False)
         elif f in copied: # files we'll deal with on m2 side
--- a/tests/test-merge-types.t	Mon Jan 28 19:05:35 2013 +0900
+++ b/tests/test-merge-types.t	Wed Jan 30 19:29:36 2013 +0100
@@ -197,6 +197,26 @@
   f is a plain file with content:
   f
 
+Test removed 'x' flag merged with content change - both ways
+
+  $ hg up -Cqr0
+  $ echo change > f
+  $ hg ci -qm3
+  $ hg merge -r1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ tellmeabout f
+  f is a plain file with content:
+  change
+
+  $ hg up -qCr1
+  $ hg merge -r3
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ tellmeabout f
+  f is a plain file with content:
+  change
+
   $ cd ..
 
 Test merge with no common ancestor: