Patchwork [06,of,24] merge: process files in sorted order

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 16, 2012, 10:34 p.m.
Message ID <e35343a104ac1c3e2062.1355697241@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/130/
State Superseded
Commit 26627c30735a610f59979a36885b327b25d8dbff
Headers show

Comments

Mads Kiilerich - Dec. 16, 2012, 10:34 p.m.
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1355687456 -3600
# Node ID e35343a104ac1c3e20629f90a6c59e09d4337093
# Parent  cba5d81f70e88ebd6647ce7d67467da6c3cd31b1
merge: process files in sorted order
Bryan O'Sullivan - Dec. 17, 2012, 8:57 p.m.
On Sun, Dec 16, 2012 at 2:34 PM, Mads Kiilerich <mads at kiilerich.com> wrote:

> merge: process files in sorted order
>

I like this, but maybe sorted(m1.iteritems()) instead of sorted(m1.items())?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121217/38630ca8/attachment.html>

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -242,7 +242,7 @@ 
                 break
 
     # Compare manifests
-    for f, n in m1.iteritems():
+    for f, n in sorted(m1.items()):
         if partial and not partial(f):
             continue
         if f in m2:
@@ -281,7 +281,7 @@ 
             else:
                 act("other deleted", "r", f)
 
-    for f, n in m2.iteritems():
+    for f, n in sorted(m2.items()):
         if partial and not partial(f):
             continue
         if f in m1 or f in copied: # files already visited
diff --git a/tests/test-copy-move-merge.t b/tests/test-copy-move-merge.t
--- a/tests/test-copy-move-merge.t
+++ b/tests/test-copy-move-merge.t
@@ -31,8 +31,8 @@ 
   resolving manifests
    overwrite: False, partial: False
    ancestor: b8bf91eeebbc, local: add3f11052fa+, remote: 17c05bb7fcb6
+   a: remote moved to b -> m
    a: remote moved to c -> m
-   a: remote moved to b -> m
   preserving a for resolve of b
   preserving a for resolve of c
   removing a
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -158,8 +158,8 @@ 
   resolving manifests
    overwrite: False, partial: False
    ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
+   d: remote is newer -> g
    e: versions differ -> m
-   d: remote is newer -> g
   preserving e for resolve of e
   updating: d 1/2 files (50.00%)
   getting d
diff --git a/tests/test-rename-dir-merge.t b/tests/test-rename-dir-merge.t
--- a/tests/test-rename-dir-merge.t
+++ b/tests/test-rename-dir-merge.t
@@ -39,9 +39,9 @@ 
   resolving manifests
    overwrite: False, partial: False
    ancestor: f9b20c0d4c51, local: ce36d17b18fb+, remote: 397f8b00a740
+   a/a: other deleted -> r
+   a/b: other deleted -> r
    a/c: remote renamed directory to b/c -> d
-   a/b: other deleted -> r
-   a/a: other deleted -> r
    b/a: remote created -> g
    b/b: remote created -> g
   updating: a/a 1/5 files (20.00%)
diff --git a/tests/test-update-reverse.t b/tests/test-update-reverse.t
--- a/tests/test-update-reverse.t
+++ b/tests/test-update-reverse.t
@@ -68,8 +68,8 @@ 
   resolving manifests
    overwrite: True, partial: False
    ancestor: 91ebc10ed028+, local: 91ebc10ed028+, remote: 71a760306caf
+   side1: other deleted -> r
    side2: other deleted -> r
-   side1: other deleted -> r
    main: remote created -> g
   updating: side1 1/3 files (33.33%)
   removing side1