Show More
@@ -642,16 +642,9 b' def _histedit(ui, repo, state, *freeargs' | |||
|
642 | 642 | |
|
643 | 643 | ctxs = [repo[r] for r in revs] |
|
644 | 644 | if not rules: |
|
645 |
rules = ' |
|
|
646 | rules += '\n\n' | |
|
647 | rules += editcomment % (node.short(root), node.short(topmost)) | |
|
648 | rules = ui.edit(rules, ui.username()) | |
|
649 | # Save edit rules in .hg/histedit-last-edit.txt in case | |
|
650 | # the user needs to ask for help after something | |
|
651 | # surprising happens. | |
|
652 | f = open(repo.join('histedit-last-edit.txt'), 'w') | |
|
653 | f.write(rules) | |
|
654 | f.close() | |
|
645 | rules = ruleeditor(repo, ui, [['pick', c] for c in ctxs], | |
|
646 | editcomment=editcomment % (node.short(root), | |
|
647 | node.short(topmost))) | |
|
655 | 648 | else: |
|
656 | 649 | if rules == '-': |
|
657 | 650 | f = sys.stdin |
@@ -826,6 +819,25 b' def makedesc(c):' | |||
|
826 | 819 | # trim to 80 columns so it's not stupidly wide in my editor |
|
827 | 820 | return util.ellipsis(line, 80) |
|
828 | 821 | |
|
822 | def ruleeditor(repo, ui, rules, editcomment=""): | |
|
823 | """open an editor to edit rules | |
|
824 | ||
|
825 | rules are in the format [ [act, ctx], ...] like in state.rules | |
|
826 | """ | |
|
827 | rules = '\n'.join([makedesc(repo[rev]) for [act, rev] in rules]) | |
|
828 | rules += '\n\n' | |
|
829 | rules += editcomment | |
|
830 | rules = ui.edit(rules, ui.username()) | |
|
831 | ||
|
832 | # Save edit rules in .hg/histedit-last-edit.txt in case | |
|
833 | # the user needs to ask for help after something | |
|
834 | # surprising happens. | |
|
835 | f = open(repo.join('histedit-last-edit.txt'), 'w') | |
|
836 | f.write(rules) | |
|
837 | f.close() | |
|
838 | ||
|
839 | return rules | |
|
840 | ||
|
829 | 841 | def verifyrules(rules, repo, ctxs): |
|
830 | 842 | """Verify that there exists exactly one edit rule per given changeset. |
|
831 | 843 |
General Comments 0
You need to be logged in to leave comments.
Login now