# HG changeset patch # User Augie Fackler # Date 2017-03-21 22:36:14 # Node ID f97e90fa5ad7a8a9d3f2253be6aaed91166a3607 # Parent 66c3ae6d886cae0e3a3cff6a0058e2d2a866fd9d # Parent 2915cc1d3429f9b11c9cf48d45990f982fff8e7a merge with stable diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -195,7 +195,9 @@ def submerge(repo, wctx, mctx, actx, ove 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 @@ def submerge(repo, wctx, mctx, actx, ove 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 @@ def submerge(repo, wctx, mctx, actx, ove 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 @@ def submerge(repo, wctx, mctx, actx, ove 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' diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t --- a/tests/test-subrepo.t +++ b/tests/test-subrepo.t @@ -349,7 +349,7 @@ 11: remove subrepo t 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 @@ local removed, remote changed, keep remo $ hg merge --config ui.interactive=true 6 < 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 @@ local changed, remote removed, keep chan $ 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 @@ local changed, remote removed, keep remo $ hg merge --config ui.interactive=true 11 < 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)