changeset 31557:f97e90fa5ad7

merge with stable
author Augie Fackler <augie@google.com>
date Tue, 21 Mar 2017 18:36:14 -0400
parents 66c3ae6d886c (current diff) 2915cc1d3429 (diff)
children d0b9e9803caf
files mercurial/subrepo.py
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/subrepo.py	Tue Mar 21 06:50:28 2017 -0700
+++ b/mercurial/subrepo.py	Tue Mar 21 18:36:14 2017 -0400
@@ -195,7 +195,9 @@
             r = "%s:%s:%s" % r
         repo.ui.debug("  subrepo %s: %s %s\n" % (s, msg, r))
 
+    promptssrc = filemerge.partextras(labels)
     for s, l in sorted(s1.iteritems()):
+        prompts = None
         a = sa.get(s, nullstate)
         ld = l # local state with possible dirty flag for compares
         if wctx.sub(s).dirty():
@@ -203,9 +205,9 @@
         if wctx == actx: # overwrite
             a = ld
 
+        prompts = promptssrc.copy()
+        prompts['s'] = s
         if s in s2:
-            prompts = filemerge.partextras(labels)
-            prompts['s'] = s
             r = s2[s]
             if ld == r or r == a: # no change or local is newer
                 sm[s] = l
@@ -268,6 +270,7 @@
                 wctx.sub(s).remove()
 
     for s, r in sorted(s2.items()):
+        prompts = None
         if s in s1:
             continue
         elif s not in sa:
@@ -275,6 +278,8 @@
             mctx.sub(s).get(r)
             sm[s] = r
         elif r != sa[s]:
+            prompts = promptssrc.copy()
+            prompts['s'] = s
             if repo.ui.promptchoice(
                 _(' remote%(o)s changed subrepository %(s)s'
                   ' which local%(l)s removed\n'
--- a/tests/test-subrepo.t	Tue Mar 21 06:50:28 2017 -0700
+++ b/tests/test-subrepo.t	Tue Mar 21 18:36:14 2017 -0400
@@ -349,7 +349,7 @@
 local removed, remote changed, keep changed
 
   $ hg merge 6
-   remote [merge rev] changed subrepository s which local [working copy] removed
+   remote [merge rev] changed subrepository t which local [working copy] removed
   use (c)hanged version or (d)elete? c
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -380,7 +380,7 @@
   $ hg merge --config ui.interactive=true 6 <<EOF
   > d
   > EOF
-   remote [merge rev] changed subrepository s which local [working copy] removed
+   remote [merge rev] changed subrepository t which local [working copy] removed
   use (c)hanged version or (d)elete? d
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -404,7 +404,7 @@
   $ hg co -C 6
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 11
-   local [working copy] changed subrepository s which remote [merge rev] removed
+   local [working copy] changed subrepository t which remote [merge rev] removed
   use (c)hanged version or (d)elete? c
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -436,7 +436,7 @@
   $ hg merge --config ui.interactive=true 11 <<EOF
   > d
   > EOF
-   local [working copy] changed subrepository s which remote [merge rev] removed
+   local [working copy] changed subrepository t which remote [merge rev] removed
   use (c)hanged version or (d)elete? d
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)