Patchwork [4,of,5] merge: display modify/delete conflict prompts in sorted order

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 1, 2014, 6:14 a.m.
Message ID <a1994ec16b4b3e618645.1417414499@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6926/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Dec. 1, 2014, 6:14 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1417026327 28800
#      Wed Nov 26 10:25:27 2014 -0800
# Node ID a1994ec16b4b3e618645c04110d962515422e213
# Parent  cc7e94d51670496aa6150f282149f28dae754fa6
merge: display modify/delete conflict prompts in sorted order

The order is determined by manifest.diff(), which currently is not
sorted. There are currently no tests for this, but we will soon add
some that would be flaky without this patch.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -598,7 +598,7 @@ 
         repo.ui.note(_('end of auction\n\n'))
 
     # Prompt and create actions. TODO: Move this towards resolve phase.
-    for f, args, msg in actions['cd']:
+    for f, args, msg in sorted(actions['cd']):
         if repo.ui.promptchoice(
             _("local changed %s which remote deleted\n"
               "use (c)hanged version or (d)elete?"
@@ -608,7 +608,7 @@ 
             actions['a'].append((f, None, "prompt keep"))
     del actions['cd'][:]
 
-    for f, args, msg in actions['dc']:
+    for f, args, msg in sorted(actions['dc']):
         flags, = args
         if repo.ui.promptchoice(
             _("remote changed %s which local deleted\n"