Patchwork [stable] merge: fix UnboundLocalError (issue3791)

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 30, 2013, 4:14 p.m.
Message ID <33d0b2fc707d7c8bfea7.1359562482@mk-desktop>
Download mbox | patch
Permalink /patch/763/
State Superseded
Commit 26627c30735a610f59979a36885b327b25d8dbff
Headers show

Comments

Mads Kiilerich - Jan. 30, 2013, 4:14 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1359562447 -3600
# Branch stable
# Node ID 33d0b2fc707d7c8bfea7f620ba2d495555f0ff77
# Parent  68eecbaf1bd32a616748331cc9f22d55b1316ce3
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.
Augie Fackler - Jan. 30, 2013, 4:16 p.m.
On Wed, Jan 30, 2013 at 11:14 AM, Mads Kiilerich <mads@kiilerich.com> wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1359562447 -3600
> # Branch stable
> # Node ID 33d0b2fc707d7c8bfea7f620ba2d495555f0ff77
> # Parent  68eecbaf1bd32a616748331cc9f22d55b1316ce3
> 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.


LGTM, fire ze missiles.
Mads Kiilerich - Jan. 30, 2013, 6:58 p.m.
On 01/30/2013 06:20 PM, Kevin Bullock wrote:
> On Jan 30, 2013, at 10:14 AM, Mads Kiilerich wrote:
>
>> # HG changeset patch
>> # User Mads Kiilerich <madski@unity3d.com>
>> # Date 1359562447 -3600
>> # Branch stable
>> # Node ID 33d0b2fc707d7c8bfea7f620ba2d495555f0ff77
>> # Parent  68eecbaf1bd32a616748331cc9f22d55b1316ce3
>> 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.
> Yep, looks sane.

So 384df4db6520 was insane?

Crewed ;-)

/Mads
Pierre-Yves David - Jan. 31, 2013, 10:41 a.m.
On Wed, Jan 30, 2013 at 07:58:37PM +0100, Mads Kiilerich wrote:
> On 01/30/2013 06:20 PM, Kevin Bullock wrote:
> >On Jan 30, 2013, at 10:14 AM, Mads Kiilerich wrote:
> >
> >># HG changeset patch
> >># User Mads Kiilerich <madski@unity3d.com>
> >># Date 1359562447 -3600
> >># Branch stable
> >># Node ID 33d0b2fc707d7c8bfea7f620ba2d495555f0ff77
> >># Parent  68eecbaf1bd32a616748331cc9f22d55b1316ce3
> >>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.
> >Yep, looks sane.
> 
> So 384df4db6520 was insane?

Yeah! it was a totally mads changeset.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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
diff --git a/tests/test-merge-types.t b/tests/test-merge-types.t
--- a/tests/test-merge-types.t
+++ b/tests/test-merge-types.t
@@ -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: