--- a/mercurial/merge.py Wed Jan 27 16:16:38 2016 -0600
+++ b/mercurial/merge.py Fri Jan 29 14:19:29 2016 -0800
@@ -1464,6 +1464,34 @@
actionbyfile, diverge, renamedelete = calculateupdates(
repo, wc, p2, pas, branchmerge, force, mergeancestor,
followcopies, matcher=matcher)
+
+ # Prompt and create actions. Most of this is in the resolve phase
+ # already, but we can't handle .hgsubstate in filemerge or
+ # subrepo.submerge yet so we have to keep prompting for it.
+ if '.hgsubstate' in actionbyfile:
+ f = '.hgsubstate'
+ m, args, msg = actionbyfile[f]
+ if m == 'cd':
+ if repo.ui.promptchoice(
+ _("local changed %s which remote deleted\n"
+ "use (c)hanged version or (d)elete?"
+ "$$ &Changed $$ &Delete") % f, 0):
+ actionbyfile[f] = ('r', None, "prompt delete")
+ elif f in p1:
+ actionbyfile[f] = ('am', None, "prompt keep")
+ else:
+ actionbyfile[f] = ('a', None, "prompt keep")
+ elif m == 'dc':
+ f1, f2, fa, move, anc = args
+ flags = p2[f2].flags()
+ if repo.ui.promptchoice(
+ _("remote changed %s which local deleted\n"
+ "use (c)hanged version or leave (d)eleted?"
+ "$$ &Changed $$ &Deleted") % f, 0) == 0:
+ actionbyfile[f] = ('g', (flags, False), "prompt recreating")
+ else:
+ del actionbyfile[f]
+
# Convert to dictionary-of-lists format
actions = dict((m, []) for m in 'a am f g cd dc r dm dg m e k'.split())
for f, (m, args, msg) in actionbyfile.iteritems():
@@ -1479,33 +1507,6 @@
else:
_checkcollision(repo, wc.manifest(), actions)
- # Prompt and create actions. Most of this is in the resolve phase
- # already, but we can't handle .hgsubstate in filemerge or
- # subrepo.submerge yet so we have to keep prompting for it.
- for f, args, msg in sorted(actions['cd']):
- if f != '.hgsubstate':
- continue
- if repo.ui.promptchoice(
- _("local changed %s which remote deleted\n"
- "use (c)hanged version or (d)elete?"
- "$$ &Changed $$ &Delete") % f, 0):
- actions['r'].append((f, None, "prompt delete"))
- elif f in p1:
- actions['am'].append((f, None, "prompt keep"))
- else:
- actions['a'].append((f, None, "prompt keep"))
-
- for f, args, msg in sorted(actions['dc']):
- if f != '.hgsubstate':
- continue
- f1, f2, fa, move, anc = args
- flags = p2[f2].flags()
- if repo.ui.promptchoice(
- _("remote changed %s which local deleted\n"
- "use (c)hanged version or leave (d)eleted?"
- "$$ &Changed $$ &Deleted") % f, 0) == 0:
- actions['g'].append((f, (flags, False), "prompt recreating"))
-
# divergent renames
for f, fl in sorted(diverge.iteritems()):
repo.ui.warn(_("note: possible conflict - %s was renamed "