comparison tests/test-histedit-edit.t @ 24920:b5eb01500696 stable

histedit: fix --edit-plan --edit-plan was completely broken from the command line because it used an old api that was not updated (it would crash with a stack trace). Let's update it and add tests to catch this.
author Durham Goode <durham@fb.com>
date Wed, 22 Apr 2015 15:53:03 -0700
parents 7b59f16174c5
children 5bc506ee87d2
comparison
equal deleted inserted replaced
24906:a4ee6f774f14 24920:b5eb01500696
68 > EOF 68 > EOF
69 0 files updated, 0 files merged, 3 files removed, 0 files unresolved 69 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
70 Make changes as needed, you may commit or record as needed now. 70 Make changes as needed, you may commit or record as needed now.
71 When you are finished, run hg histedit --continue to resume. 71 When you are finished, run hg histedit --continue to resume.
72 72
73 edit the plan 73 edit the plan via the editor
74 $ cat >> ../editplan.sh <<EOF
75 > cat > \$1 <<EOF2
76 > drop e860deea161a e
77 > drop 652413bf663e f
78 > drop 3c6a8ed2ebe8 g
79 > EOF2
80 > EOF
81 $ chmod a+x ../editplan.sh
82 $ HGEDITOR=../editplan.sh hg histedit --edit-plan
83 $ cat .hg/histedit-state
84 v1
85 055a42cdd88768532f9cf79daa407fc8d138de9b
86 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799
87 False
88 3
89 drop
90 e860deea161a2f77de56603b340ebbb4536308ae
91 drop
92 652413bf663ef2a641cab26574e46d5f5a64a55a
93 drop
94 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799
95 0
96 strip-backup/177f92b77385-0ebe6a8f-histedit.hg
97
98 edit the plan via --commands
74 $ hg histedit --edit-plan --commands - 2>&1 << EOF 99 $ hg histedit --edit-plan --commands - 2>&1 << EOF
75 > edit e860deea161a e 100 > edit e860deea161a e
76 > pick 652413bf663e f 101 > pick 652413bf663e f
77 > drop 3c6a8ed2ebe8 g 102 > drop 3c6a8ed2ebe8 g
78 > EOF 103 > EOF
104 $ cat .hg/histedit-state
105 v1
106 055a42cdd88768532f9cf79daa407fc8d138de9b
107 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799
108 False
109 3
110 edit
111 e860deea161a2f77de56603b340ebbb4536308ae
112 pick
113 652413bf663ef2a641cab26574e46d5f5a64a55a
114 drop
115 3c6a8ed2ebe862cc949d2caa30775dd6f16fb799
116 0
117 strip-backup/177f92b77385-0ebe6a8f-histedit.hg
79 118
80 Go at a random point and try to continue 119 Go at a random point and try to continue
81 120
82 $ hg id -n 121 $ hg id -n
83 3+ 122 3+