--- a/hgext3rd/evolve/__init__.py Thu Dec 28 04:09:02 2017 +0530
+++ b/hgext3rd/evolve/__init__.py Sat Dec 09 08:19:07 2017 +0530
@@ -324,6 +324,7 @@
utility,
)
+TROUBLES = compat.TROUBLES
__version__ = metadata.__version__
testedwith = metadata.testedwith
minimumhgversion = metadata.minimumhgversion
@@ -1370,15 +1371,19 @@
fm.data(node=ctx.hex(), rev=ctx.rev(), desc=desc, phase=ctx.phasestr())
for unpar in unpars if showunstable else []:
- fm.plain(' orphan: %s (orphan parent)\n' % unpar[:hashlen])
+ fm.plain(' %s: %s (%s parent)\n' % (TROUBLES['ORPHAN'],
+ unpar[:hashlen],
+ TROUBLES['ORPHAN']))
for obspar in obspars if showunstable else []:
- fm.plain(' unstable: %s (obsolete parent)\n' % obspar[:hashlen])
+ fm.plain(' %s: %s (obsolete parent)\n' % (TROUBLES['ORPHAN'],
+ obspar[:hashlen]))
for imprec in imprecs if showbumped else []:
- fm.plain(' bumped: %s (immutable precursor)\n' % imprec[:hashlen])
+ fm.plain(' %s: %s (immutable precursor)\n' %
+ (TROUBLES['PHASEDIVERGENT'], imprec[:hashlen]))
if dsets and showdivergent:
for dset in dsets:
- fm.plain(' divergent: ')
+ fm.plain(' %s: ' % TROUBLES['CONTENTDIVERGENT'])
first = True
for n in dset['divergentnodes']:
t = "%s (%s)" if first else " %s (%s)"
@@ -1392,19 +1397,21 @@
_formatctx(fm, ctx)
troubles = []
for unpar in unpars:
- troubles.append({'troubletype': 'unstable', 'sourcenode': unpar,
- 'sourcetype': 'unstableparent'})
+ troubles.append({'troubletype': TROUBLES['ORPHAN'],
+ 'sourcenode': unpar, 'sourcetype': 'orphanparent'})
for obspar in obspars:
- troubles.append({'troubletype': 'unstable', 'sourcenode': obspar,
+ troubles.append({'troubletype': TROUBLES['ORPHAN'],
+ 'sourcenode': obspar,
'sourcetype': 'obsoleteparent'})
for imprec in imprecs:
- troubles.append({'troubletype': 'bumped', 'sourcenode': imprec,
+ troubles.append({'troubletype': TROUBLES['PHASEDIVERGENT'],
+ 'sourcenode': imprec,
'sourcetype': 'immutableprecursor'})
for dset in dsets:
divnodes = [{'node': node.hex(n),
'phase': repo[n].phasestr(),
} for n in dset['divergentnodes']]
- troubles.append({'troubletype': 'divergent',
+ troubles.append({'troubletype': TROUBLES['CONTENTDIVERGENT'],
'commonprecursor': node.hex(dset['commonprecursor']),
'divergentnodes': divnodes})
fm.data(troubles=troubles)
@@ -1795,7 +1802,8 @@
repo.ui.write(todo)
repo.ui.write(('hg update %s;\n' % prec))
repo.ui.write(('hg revert --all --rev %s;\n' % bumped))
- repo.ui.write(('hg commit --msg "bumped update to %s"'))
+ repo.ui.write(('hg commit --msg "%s update to %s"\n' %
+ (TROUBLES['PHASEDIVERGENT'], bumped)))
return 0
if progresscb:
progresscb()
@@ -1877,7 +1885,7 @@
base, others = divergentdata(divergent)
if len(others) > 1:
othersstr = "[%s]" % (','.join([str(i) for i in others]))
- msg = _("skipping %d:divergent with a changeset that got split"
+ msg = _("skipping %d:%s with a changeset that got split"
" into multiple ones:\n"
"|[%s]\n"
"| This is not handled by automatic evolution yet\n"
@@ -1887,13 +1895,13 @@
"| - hg prune\n"
"| \n"
"| You should contact your local evolution Guru for help.\n"
- ) % (divergent, othersstr)
+ ) % (divergent, TROUBLES['CONTENTDIVERGENT'], othersstr)
ui.write_err(msg)
return 2
other = others[0]
if len(other.parents()) > 1:
- msg = _("skipping %s: divergent changeset can't be "
- "a merge (yet)\n") % divergent
+ msg = _("skipping %s: %s changeset can't be "
+ "a merge (yet)\n") % (divergent, TROUBLES['CONTENTDIVERGENT'])
ui.write_err(msg)
hint = _("You have to fallback to solving this by hand...\n"
"| This probably means redoing the merge and using \n"
@@ -1938,7 +1946,7 @@
if divergent not in repo[None].parents():
repo.ui.status(_('updating to "local" conflict\n'))
hg.update(repo, divergent.rev())
- repo.ui.note(_('merging divergent changeset\n'))
+ repo.ui.note(_('merging %s changeset\n') % TROUBLES['CONTENTDIVERGENT'])
if progresscb:
progresscb()
stats = merge.update(repo,