Commits

Augie Fackler committed 80ee1ad

initial histedit: log commands from the user inside .hg

This will let users communicate more clearly what they did
histedit-wise when things go wrong.

Comments (0)

Files changed (3)

                                for c in ctxs])
             rules += editcomment % (node.hex(parent)[:12], node.hex(tip)[:12], )
             rules = ui.edit(rules, ui.username())
+            # Save edit rules in .hg/histedit-last-edit.txt in case
+            # the user needs to ask for help after something
+            # surprising happens.
+            f = open(repo.join('histedit-last-edit.txt'), 'w')
+            f.write(rules)
+            f.close()
         else:
             f = open(rules)
             rules = f.read()

tests/test-histedit-commute

 echo % edit the history
 HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
 
+echo % rules should end up in .hg/histedit-last-edit.txt:
+cat .hg/histedit-last-edit.txt
+echo '**** end of rules file ****'
+
 echo % log after edit
 hg log --graph
 

tests/test-histedit-commute.out

 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% rules should end up in .hg/histedit-last-edit.txt:
+pick 177f92b77385 c
+pick e860deea161a e
+pick 652413bf663e f
+pick 055a42cdd887 d
+**** end of rules file ****
 % log after edit
 @  changeset:   5:853c68da763f
 |  tag:         tip