##// END OF EJS Templates
histedit: generalize makedesc...
Mateusz Kwapich -
r24141:671da7d3 default
parent child Browse files
Show More
@@ -805,17 +805,18 b' def between(repo, old, new, keep):'
805 raise util.Abort(_('cannot edit immutable changeset: %s') % root)
805 raise util.Abort(_('cannot edit immutable changeset: %s') % root)
806 return [c.node() for c in ctxs]
806 return [c.node() for c in ctxs]
807
807
808 def makedesc(c):
808 def makedesc(repo, action, rev):
809 """build a initial action line for a ctx `c`
809 """build a initial action line for a ctx
810
810
811 line are in the form:
811 line are in the form:
812
812
813 pick <hash> <rev> <summary>
813 <action> <hash> <rev> <summary>
814 """
814 """
815 ctx = repo[rev]
815 summary = ''
816 summary = ''
816 if c.description():
817 if ctx.description():
817 summary = c.description().splitlines()[0]
818 summary = ctx.description().splitlines()[0]
818 line = 'pick %s %d %s' % (c, c.rev(), summary)
819 line = '%s %s %d %s' % (action, ctx, ctx.rev(), summary)
819 # trim to 80 columns so it's not stupidly wide in my editor
820 # trim to 80 columns so it's not stupidly wide in my editor
820 return util.ellipsis(line, 80)
821 return util.ellipsis(line, 80)
821
822
@@ -824,7 +825,7 b' def ruleeditor(repo, ui, rules, editcomm'
824
825
825 rules are in the format [ [act, ctx], ...] like in state.rules
826 rules are in the format [ [act, ctx], ...] like in state.rules
826 """
827 """
827 rules = '\n'.join([makedesc(repo[rev]) for [act, rev] in rules])
828 rules = '\n'.join([makedesc(repo, act, rev) for [act, rev] in rules])
828 rules += '\n\n'
829 rules += '\n\n'
829 rules += editcomment
830 rules += editcomment
830 rules = ui.edit(rules, ui.username())
831 rules = ui.edit(rules, ui.username())
General Comments 0
You need to be logged in to leave comments. Login now