##// END OF EJS Templates
histedit: store full node hash in rules...
Mateusz Kwapich -
r24002:96d13069 default
parent child Browse files
Show More
@@ -349,7 +349,7 b' def pick(ui, state, ha, opts):'
349 349 repo, ctx = state.repo, state.parentctx
350 350 oldctx = repo[ha]
351 351 if oldctx.parents()[0] == ctx:
352 ui.debug('node %s unchanged\n' % ha)
352 ui.debug('node %s unchanged\n' % ha[:12])
353 353 return oldctx, []
354 354 hg.update(repo, ctx.node())
355 355 stats = applychanges(ui, repo, oldctx, opts)
@@ -361,7 +361,7 b' def pick(ui, state, ha, opts):'
361 361 n = commit(text=oldctx.description(), user=oldctx.user(),
362 362 date=oldctx.date(), extra=oldctx.extra())
363 363 if n is None:
364 ui.warn(_('%s: empty changeset\n') % node.hex(ha))
364 ui.warn(_('%s: empty changeset\n') % ha[:12])
365 365 return ctx, []
366 366 new = repo[n]
367 367 return new, [(oldctx.node(), (n,))]
@@ -389,10 +389,10 b' def fold(ui, state, ha, opts):'
389 389 if stats and stats[3] > 0:
390 390 raise error.InterventionRequired(
391 391 _('Fix up the change and run hg histedit --continue'))
392 n = repo.commit(text='fold-temp-revision %s' % ha, user=oldctx.user(),
392 n = repo.commit(text='fold-temp-revision %s' % ha[:12], user=oldctx.user(),
393 393 date=oldctx.date(), extra=oldctx.extra())
394 394 if n is None:
395 ui.warn(_('%s: empty changeset') % node.hex(ha))
395 ui.warn(_('%s: empty changeset') % ha[:12])
396 396 return ctx, []
397 397 return finishfold(ui, repo, ctx, oldctx, n, opts, [])
398 398
@@ -666,7 +666,7 b' def _histedit(ui, repo, state, *freeargs'
666 666 while state.rules:
667 667 state.write()
668 668 action, ha = state.rules.pop(0)
669 ui.debug('histedit: processing %s %s\n' % (action, ha))
669 ui.debug('histedit: processing %s %s\n' % (action, ha[:12]))
670 670 actfunc = actiontable[action]
671 671 state.parentctx, replacement_ = actfunc(ui, state, ha, opts)
672 672 state.replacements.extend(replacement_)
@@ -736,7 +736,7 b' def bootstrapcontinue(ui, state, opts):'
736 736 if s.modified or s.added or s.removed or s.deleted:
737 737 # prepare the message for the commit to comes
738 738 if action in ('f', 'fold', 'r', 'roll'):
739 message = 'fold-temp-revision %s' % currentnode
739 message = 'fold-temp-revision %s' % currentnode[:12]
740 740 else:
741 741 message = ctx.description()
742 742 editopt = action in ('e', 'edit', 'm', 'mess')
@@ -822,7 +822,7 b' def verifyrules(rules, repo, ctxs):'
822 822 or a rule on a changeset outside of the user-given range.
823 823 """
824 824 parsed = []
825 expected = set(str(c) for c in ctxs)
825 expected = set(c.hex() for c in ctxs)
826 826 seen = set()
827 827 for r in rules:
828 828 if ' ' not in r:
@@ -830,22 +830,24 b' def verifyrules(rules, repo, ctxs):'
830 830 action, rest = r.split(' ', 1)
831 831 ha = rest.strip().split(' ', 1)[0]
832 832 try:
833 ha = str(repo[ha]) # ensure its a short hash
833 ha = repo[ha].hex()
834 834 except error.RepoError:
835 raise util.Abort(_('unknown changeset %s listed') % ha)
835 raise util.Abort(_('unknown changeset %s listed') % ha[:12])
836 836 if ha not in expected:
837 837 raise util.Abort(
838 838 _('may not use changesets other than the ones listed'))
839 839 if ha in seen:
840 raise util.Abort(_('duplicated command for changeset %s') % ha)
840 raise util.Abort(_('duplicated command for changeset %s') %
841 ha[:12])
841 842 seen.add(ha)
842 843 if action not in actiontable:
843 844 raise util.Abort(_('unknown action "%s"') % action)
844 845 parsed.append([action, ha])
845 846 missing = sorted(expected - seen) # sort to stabilize output
846 847 if missing:
847 raise util.Abort(_('missing rules for changeset %s') % missing[0],
848 hint=_('do you want to use the drop action?'))
848 raise util.Abort(_('missing rules for changeset %s') %
849 missing[0][:12],
850 hint=_('do you want to use the drop action?'))
849 851 return parsed
850 852
851 853 def processreplacement(state):
@@ -96,7 +96,6 b' log after edit'
96 96 Check histedit_source
97 97
98 98 $ hg log --debug --rev f518305ce889
99 invalid branchheads cache (visible): tip differs
100 99 changeset: 4:f518305ce889c07cb5bd05522176d75590ef3324
101 100 tag: tip
102 101 phase: draft
General Comments 0
You need to be logged in to leave comments. Login now