Show More
@@ -1,224 +1,224 b'' | |||||
1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
1 | $ . "$TESTDIR/histedit-helpers.sh" | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > graphlog= |
|
5 | > graphlog= | |
6 | > histedit= |
|
6 | > histedit= | |
7 | > EOF |
|
7 | > EOF | |
8 |
|
8 | |||
9 | $ EDITED="$TESTTMP/editedhistory" |
|
9 | $ EDITED="$TESTTMP/editedhistory" | |
10 | $ cat > $EDITED <<EOF |
|
10 | $ cat > $EDITED <<EOF | |
11 | > pick 177f92b77385 c |
|
11 | > pick 177f92b77385 c | |
12 | > pick 055a42cdd887 d |
|
12 | > pick 055a42cdd887 d | |
13 | > edit e860deea161a e |
|
13 | > edit e860deea161a e | |
14 | > pick 652413bf663e f |
|
14 | > pick 652413bf663e f | |
15 | > EOF |
|
15 | > EOF | |
16 | $ initrepo () |
|
16 | $ initrepo () | |
17 | > { |
|
17 | > { | |
18 | > hg init r |
|
18 | > hg init r | |
19 | > cd r |
|
19 | > cd r | |
20 | > for x in a b c d e f ; do |
|
20 | > for x in a b c d e f ; do | |
21 | > echo $x > $x |
|
21 | > echo $x > $x | |
22 | > hg add $x |
|
22 | > hg add $x | |
23 | > hg ci -m $x |
|
23 | > hg ci -m $x | |
24 | > done |
|
24 | > done | |
25 | > } |
|
25 | > } | |
26 |
|
26 | |||
27 | $ initrepo |
|
27 | $ initrepo | |
28 |
|
28 | |||
29 | log before edit |
|
29 | log before edit | |
30 | $ hg log --graph |
|
30 | $ hg log --graph | |
31 | @ changeset: 5:652413bf663e |
|
31 | @ changeset: 5:652413bf663e | |
32 | | tag: tip |
|
32 | | tag: tip | |
33 | | user: test |
|
33 | | user: test | |
34 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
34 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
35 | | summary: f |
|
35 | | summary: f | |
36 | | |
|
36 | | | |
37 | o changeset: 4:e860deea161a |
|
37 | o changeset: 4:e860deea161a | |
38 | | user: test |
|
38 | | user: test | |
39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
39 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
40 | | summary: e |
|
40 | | summary: e | |
41 | | |
|
41 | | | |
42 | o changeset: 3:055a42cdd887 |
|
42 | o changeset: 3:055a42cdd887 | |
43 | | user: test |
|
43 | | user: test | |
44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
44 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
45 | | summary: d |
|
45 | | summary: d | |
46 | | |
|
46 | | | |
47 | o changeset: 2:177f92b77385 |
|
47 | o changeset: 2:177f92b77385 | |
48 | | user: test |
|
48 | | user: test | |
49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
49 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
50 | | summary: c |
|
50 | | summary: c | |
51 | | |
|
51 | | | |
52 | o changeset: 1:d2ae7f538514 |
|
52 | o changeset: 1:d2ae7f538514 | |
53 | | user: test |
|
53 | | user: test | |
54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
54 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
55 | | summary: b |
|
55 | | summary: b | |
56 | | |
|
56 | | | |
57 | o changeset: 0:cb9a9f314b8b |
|
57 | o changeset: 0:cb9a9f314b8b | |
58 | user: test |
|
58 | user: test | |
59 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
59 | date: Thu Jan 01 00:00:00 1970 +0000 | |
60 | summary: a |
|
60 | summary: a | |
61 |
|
61 | |||
62 |
|
62 | |||
63 | edit the history |
|
63 | edit the history | |
64 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle |
|
64 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
65 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
65 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
66 | Make changes as needed, you may commit or record as needed now. |
|
66 | Make changes as needed, you may commit or record as needed now. | |
67 | When you are finished, run hg histedit --continue to resume. |
|
67 | When you are finished, run hg histedit --continue to resume. | |
68 |
|
68 | |||
69 | Go at a random point and try to continue |
|
69 | Go at a random point and try to continue | |
70 |
|
70 | |||
71 | $ hg id -n |
|
71 | $ hg id -n | |
72 | 3+ |
|
72 | 3+ | |
73 | $ hg up 0 |
|
73 | $ hg up 0 | |
74 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
74 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
75 | $ HGEDITOR='echo foobaz > ' hg histedit --continue |
|
75 | $ HGEDITOR='echo foobaz > ' hg histedit --continue | |
76 | abort: 055a42cdd887 is not an ancestor of working directory |
|
76 | abort: 055a42cdd887 is not an ancestor of working directory | |
77 | (update to 055a42cdd887 or descendant and run "hg histedit --continue" again) |
|
77 | (update to 055a42cdd887 or descendant and run "hg histedit --continue" again) | |
78 | [255] |
|
78 | [255] | |
79 | $ hg up 3 |
|
79 | $ hg up 3 | |
80 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
80 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
81 |
|
81 | |||
82 | commit, then edit the revision |
|
82 | commit, then edit the revision | |
83 | $ hg ci -m 'wat' |
|
83 | $ hg ci -m 'wat' | |
84 | created new head |
|
84 | created new head | |
85 | $ echo a > e |
|
85 | $ echo a > e | |
86 | $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle |
|
86 | $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle | |
87 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
88 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
88 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
89 |
|
89 | |||
90 | $ hg log --graph |
|
90 | $ hg log --graph | |
91 | @ changeset: 6:b5f70786f9b0 |
|
91 | @ changeset: 6:b5f70786f9b0 | |
92 | | tag: tip |
|
92 | | tag: tip | |
93 | | user: test |
|
93 | | user: test | |
94 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
94 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
95 | | summary: f |
|
95 | | summary: f | |
96 | | |
|
96 | | | |
97 | o changeset: 5:a5e1ba2f7afb |
|
97 | o changeset: 5:a5e1ba2f7afb | |
98 | | user: test |
|
98 | | user: test | |
99 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
99 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
100 | | summary: foobaz |
|
100 | | summary: foobaz | |
101 | | |
|
101 | | | |
102 | o changeset: 4:1a60820cd1f6 |
|
102 | o changeset: 4:1a60820cd1f6 | |
103 | | user: test |
|
103 | | user: test | |
104 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
104 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
105 | | summary: wat |
|
105 | | summary: wat | |
106 | | |
|
106 | | | |
107 | o changeset: 3:055a42cdd887 |
|
107 | o changeset: 3:055a42cdd887 | |
108 | | user: test |
|
108 | | user: test | |
109 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
109 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
110 | | summary: d |
|
110 | | summary: d | |
111 | | |
|
111 | | | |
112 | o changeset: 2:177f92b77385 |
|
112 | o changeset: 2:177f92b77385 | |
113 | | user: test |
|
113 | | user: test | |
114 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
114 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
115 | | summary: c |
|
115 | | summary: c | |
116 | | |
|
116 | | | |
117 | o changeset: 1:d2ae7f538514 |
|
117 | o changeset: 1:d2ae7f538514 | |
118 | | user: test |
|
118 | | user: test | |
119 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
119 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
120 | | summary: b |
|
120 | | summary: b | |
121 | | |
|
121 | | | |
122 | o changeset: 0:cb9a9f314b8b |
|
122 | o changeset: 0:cb9a9f314b8b | |
123 | user: test |
|
123 | user: test | |
124 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
124 | date: Thu Jan 01 00:00:00 1970 +0000 | |
125 | summary: a |
|
125 | summary: a | |
126 |
|
126 | |||
127 |
|
127 | |||
128 | $ hg cat e |
|
128 | $ hg cat e | |
129 | a |
|
129 | a | |
130 |
|
130 | |||
131 | check histedit_source |
|
131 | check histedit_source | |
132 |
|
132 | |||
133 | $ hg log --debug --rev 5 |
|
133 | $ hg log --debug --rev 5 | |
134 | changeset: 5:a5e1ba2f7afb899ef1581cea528fd885d2fca70d |
|
134 | changeset: 5:a5e1ba2f7afb899ef1581cea528fd885d2fca70d | |
135 | phase: draft |
|
135 | phase: draft | |
136 | parent: 4:1a60820cd1f6004a362aa622ebc47d59bc48eb34 |
|
136 | parent: 4:1a60820cd1f6004a362aa622ebc47d59bc48eb34 | |
137 | parent: -1:0000000000000000000000000000000000000000 |
|
137 | parent: -1:0000000000000000000000000000000000000000 | |
138 | manifest: 5:5ad3be8791f39117565557781f5464363b918a45 |
|
138 | manifest: 5:5ad3be8791f39117565557781f5464363b918a45 | |
139 | user: test |
|
139 | user: test | |
140 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
140 | date: Thu Jan 01 00:00:00 1970 +0000 | |
141 | files: e |
|
141 | files: e | |
142 | extra: branch=default |
|
142 | extra: branch=default | |
143 | extra: histedit_source=e860deea161a2f77de56603b340ebbb4536308ae |
|
143 | extra: histedit_source=e860deea161a2f77de56603b340ebbb4536308ae | |
144 | description: |
|
144 | description: | |
145 | foobaz |
|
145 | foobaz | |
146 |
|
146 | |||
147 |
|
147 | |||
148 |
|
148 | |||
149 | $ cat > $EDITED <<EOF |
|
149 | $ cat > $EDITED <<EOF | |
150 | > edit b5f70786f9b0 f |
|
150 | > edit b5f70786f9b0 f | |
151 | > EOF |
|
151 | > EOF | |
152 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle |
|
152 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle | |
153 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
153 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
154 | Make changes as needed, you may commit or record as needed now. |
|
154 | Make changes as needed, you may commit or record as needed now. | |
155 | When you are finished, run hg histedit --continue to resume. |
|
155 | When you are finished, run hg histedit --continue to resume. | |
156 | $ hg status |
|
156 | $ hg status | |
157 | A f |
|
157 | A f | |
158 | $ HGEDITOR='true' hg histedit --continue |
|
158 | $ HGEDITOR='true' hg histedit --continue | |
159 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
159 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
160 | saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-backup.hg (glob) |
|
160 | saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-backup.hg (glob) | |
161 |
|
161 | |||
162 | $ hg status |
|
162 | $ hg status | |
163 |
|
163 | |||
164 | log after edit |
|
164 | log after edit | |
165 | $ hg log --limit 1 |
|
165 | $ hg log --limit 1 | |
166 | changeset: 6:a107ee126658 |
|
166 | changeset: 6:a107ee126658 | |
167 | tag: tip |
|
167 | tag: tip | |
168 | user: test |
|
168 | user: test | |
169 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
169 | date: Thu Jan 01 00:00:00 1970 +0000 | |
170 | summary: f |
|
170 | summary: f | |
171 |
|
171 | |||
172 |
|
172 | |||
173 | say we'll change the message, but don't. |
|
173 | say we'll change the message, but don't. | |
174 | $ cat > ../edit.sh <<EOF |
|
174 | $ cat > ../edit.sh <<EOF | |
175 | > cat "\$1" | sed s/pick/mess/ > tmp |
|
175 | > cat "\$1" | sed s/pick/mess/ > tmp | |
176 | > mv tmp "\$1" |
|
176 | > mv tmp "\$1" | |
177 | > EOF |
|
177 | > EOF | |
178 | $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle |
|
178 | $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle | |
179 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
179 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
180 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
180 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
181 | $ hg status |
|
181 | $ hg status | |
182 | $ hg log --limit 1 |
|
182 | $ hg log --limit 1 | |
183 | changeset: 6:1fd3b2fe7754 |
|
183 | changeset: 6:1fd3b2fe7754 | |
184 | tag: tip |
|
184 | tag: tip | |
185 | user: test |
|
185 | user: test | |
186 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
186 | date: Thu Jan 01 00:00:00 1970 +0000 | |
187 | summary: f |
|
187 | summary: f | |
188 |
|
188 | |||
189 |
|
189 | |||
190 | modify the message |
|
190 | modify the message | |
191 | $ cat > $EDITED <<EOF |
|
191 | $ cat > $EDITED <<EOF | |
192 | > mess 1fd3b2fe7754 f |
|
192 | > mess 1fd3b2fe7754 f | |
193 | > EOF |
|
193 | > EOF | |
194 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle |
|
194 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle | |
195 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
195 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
196 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
196 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
197 | $ hg status |
|
197 | $ hg status | |
198 | $ hg log --limit 1 |
|
198 | $ hg log --limit 1 | |
199 | changeset: 6:5585e802ef99 |
|
199 | changeset: 6:5585e802ef99 | |
200 | tag: tip |
|
200 | tag: tip | |
201 | user: test |
|
201 | user: test | |
202 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
202 | date: Thu Jan 01 00:00:00 1970 +0000 | |
203 | summary: mess 1fd3b2fe7754 f |
|
203 | summary: mess 1fd3b2fe7754 f | |
204 |
|
204 | |||
205 |
|
205 | |||
206 | rollback should not work after a histedit |
|
206 | rollback should not work after a histedit | |
207 | $ hg rollback |
|
207 | $ hg rollback | |
208 | no rollback information available |
|
208 | no rollback information available | |
209 | [1] |
|
209 | [1] | |
210 |
|
210 | |||
211 | $ cd .. |
|
211 | $ cd .. | |
212 | $ hg clone -qr0 r r0 |
|
212 | $ hg clone -qr0 r r0 | |
213 | $ cd r0 |
|
213 | $ cd r0 | |
214 | $ echo edit cb9a9f314b8b a > $EDITED |
|
214 | $ echo edit cb9a9f314b8b a > $EDITED | |
215 | $ hg phase -fdr0 |
|
215 | $ hg phase -fdr0 | |
216 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 0 2>&1 |
|
216 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 0 2>&1 | |
217 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
217 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
218 | adding a |
|
218 | adding a | |
219 |
|
|
219 | Make changes as needed, you may commit or record as needed now. | |
220 | When you are finished, run hg histedit --continue to resume. |
|
220 | When you are finished, run hg histedit --continue to resume. | |
221 |
[ |
|
221 | [1] | |
222 | $ HGEDITOR=true hg histedit --continue |
|
222 | $ HGEDITOR=true hg histedit --continue | |
223 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
223 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
224 | saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-backup.hg (glob) |
|
224 | saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-backup.hg (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now