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