Show More
@@ -1,359 +1,359 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > graphlog= |
|
6 | 6 | > histedit= |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | $ EDITED=`pwd`/editedhistory |
|
10 | 10 | $ cat > $EDITED <<EOF |
|
11 | 11 | > pick 177f92b77385 c |
|
12 | 12 | > pick e860deea161a e |
|
13 | 13 | > pick 652413bf663e f |
|
14 | 14 | > pick 055a42cdd887 d |
|
15 | 15 | > EOF |
|
16 | 16 | $ initrepo () |
|
17 | 17 | > { |
|
18 | 18 | > hg init r |
|
19 | 19 | > cd r |
|
20 | 20 | > for x in a b c d e f ; do |
|
21 | 21 | > echo $x > $x |
|
22 | 22 | > hg add $x |
|
23 | 23 | > hg ci -m $x |
|
24 | 24 | > done |
|
25 | 25 | > } |
|
26 | 26 | |
|
27 | 27 | $ initrepo |
|
28 | 28 | |
|
29 | 29 | log before edit |
|
30 | 30 | $ hg log --graph |
|
31 | 31 | @ changeset: 5:652413bf663e |
|
32 | 32 | | tag: tip |
|
33 | 33 | | user: test |
|
34 | 34 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
35 | 35 | | summary: f |
|
36 | 36 | | |
|
37 | 37 | o changeset: 4:e860deea161a |
|
38 | 38 | | user: test |
|
39 | 39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | | summary: e |
|
41 | 41 | | |
|
42 | 42 | o changeset: 3:055a42cdd887 |
|
43 | 43 | | user: test |
|
44 | 44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | | summary: d |
|
46 | 46 | | |
|
47 | 47 | o changeset: 2:177f92b77385 |
|
48 | 48 | | user: test |
|
49 | 49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | 50 | | summary: c |
|
51 | 51 | | |
|
52 | 52 | o changeset: 1:d2ae7f538514 |
|
53 | 53 | | user: test |
|
54 | 54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | 55 | | summary: b |
|
56 | 56 | | |
|
57 | 57 | o changeset: 0:cb9a9f314b8b |
|
58 | 58 | user: test |
|
59 | 59 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 60 | summary: a |
|
61 | 61 | |
|
62 | 62 | |
|
63 | 63 | show the edit commands offered |
|
64 | 64 | $ HGEDITOR=cat hg histedit 177f92b77385 |
|
65 | 65 | pick 177f92b77385 2 c |
|
66 | 66 | pick 055a42cdd887 3 d |
|
67 | 67 | pick e860deea161a 4 e |
|
68 | 68 | pick 652413bf663e 5 f |
|
69 | 69 | |
|
70 | 70 | # Edit history between 177f92b77385 and 652413bf663e |
|
71 | 71 | # |
|
72 | 72 | # Commands: |
|
73 | 73 | # p, pick = use commit |
|
74 | 74 | # e, edit = use commit, but stop for amending |
|
75 | 75 | # f, fold = use commit, but fold into previous commit (combines N and N-1) |
|
76 | 76 | # d, drop = remove commit from history |
|
77 | 77 | # m, mess = edit message without changing commit content |
|
78 | 78 | # |
|
79 | 79 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
80 | 80 | |
|
81 | 81 | edit the history |
|
82 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
82 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
83 | 83 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
84 | 84 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
85 | 85 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
86 | 86 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
87 | 87 | |
|
88 | 88 | rules should end up in .hg/histedit-last-edit.txt: |
|
89 | 89 | $ cat .hg/histedit-last-edit.txt |
|
90 | 90 | pick 177f92b77385 c |
|
91 | 91 | pick e860deea161a e |
|
92 | 92 | pick 652413bf663e f |
|
93 | 93 | pick 055a42cdd887 d |
|
94 | 94 | |
|
95 | 95 | log after edit |
|
96 | 96 | $ hg log --graph |
|
97 | 97 | @ changeset: 5:853c68da763f |
|
98 | 98 | | tag: tip |
|
99 | 99 | | user: test |
|
100 | 100 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
101 | 101 | | summary: d |
|
102 | 102 | | |
|
103 | 103 | o changeset: 4:26f6a030ae82 |
|
104 | 104 | | user: test |
|
105 | 105 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
106 | 106 | | summary: f |
|
107 | 107 | | |
|
108 | 108 | o changeset: 3:b069cc29fb22 |
|
109 | 109 | | user: test |
|
110 | 110 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
111 | 111 | | summary: e |
|
112 | 112 | | |
|
113 | 113 | o changeset: 2:177f92b77385 |
|
114 | 114 | | user: test |
|
115 | 115 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
116 | 116 | | summary: c |
|
117 | 117 | | |
|
118 | 118 | o changeset: 1:d2ae7f538514 |
|
119 | 119 | | user: test |
|
120 | 120 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
121 | 121 | | summary: b |
|
122 | 122 | | |
|
123 | 123 | o changeset: 0:cb9a9f314b8b |
|
124 | 124 | user: test |
|
125 | 125 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
126 | 126 | summary: a |
|
127 | 127 | |
|
128 | 128 | |
|
129 | 129 | put things back |
|
130 | 130 | |
|
131 | 131 | $ cat > $EDITED <<EOF |
|
132 | 132 | > pick 177f92b77385 c |
|
133 | 133 | > pick 853c68da763f d |
|
134 | 134 | > pick b069cc29fb22 e |
|
135 | 135 | > pick 26f6a030ae82 f |
|
136 | 136 | > EOF |
|
137 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
137 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
138 | 138 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
139 | 139 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
140 | 140 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
142 | 142 | |
|
143 | 143 | $ hg log --graph |
|
144 | 144 | @ changeset: 5:652413bf663e |
|
145 | 145 | | tag: tip |
|
146 | 146 | | user: test |
|
147 | 147 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
148 | 148 | | summary: f |
|
149 | 149 | | |
|
150 | 150 | o changeset: 4:e860deea161a |
|
151 | 151 | | user: test |
|
152 | 152 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
153 | 153 | | summary: e |
|
154 | 154 | | |
|
155 | 155 | o changeset: 3:055a42cdd887 |
|
156 | 156 | | user: test |
|
157 | 157 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
158 | 158 | | summary: d |
|
159 | 159 | | |
|
160 | 160 | o changeset: 2:177f92b77385 |
|
161 | 161 | | user: test |
|
162 | 162 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
163 | 163 | | summary: c |
|
164 | 164 | | |
|
165 | 165 | o changeset: 1:d2ae7f538514 |
|
166 | 166 | | user: test |
|
167 | 167 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
168 | 168 | | summary: b |
|
169 | 169 | | |
|
170 | 170 | o changeset: 0:cb9a9f314b8b |
|
171 | 171 | user: test |
|
172 | 172 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
173 | 173 | summary: a |
|
174 | 174 | |
|
175 | 175 | |
|
176 | 176 | slightly different this time |
|
177 | 177 | |
|
178 | 178 | $ cat > $EDITED <<EOF |
|
179 | 179 | > pick 055a42cdd887 d |
|
180 | 180 | > pick 652413bf663e f |
|
181 | 181 | > pick e860deea161a e |
|
182 | 182 | > pick 177f92b77385 c |
|
183 | 183 | > EOF |
|
184 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
184 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
185 | 185 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
186 | 186 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
187 | 187 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
188 | 188 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
189 | 189 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
190 | 190 | $ hg log --graph |
|
191 | 191 | @ changeset: 5:99a62755c625 |
|
192 | 192 | | tag: tip |
|
193 | 193 | | user: test |
|
194 | 194 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
195 | 195 | | summary: c |
|
196 | 196 | | |
|
197 | 197 | o changeset: 4:7c6fdd608667 |
|
198 | 198 | | user: test |
|
199 | 199 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
200 | 200 | | summary: e |
|
201 | 201 | | |
|
202 | 202 | o changeset: 3:c4f52e213402 |
|
203 | 203 | | user: test |
|
204 | 204 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
205 | 205 | | summary: f |
|
206 | 206 | | |
|
207 | 207 | o changeset: 2:bfe4a5a76b37 |
|
208 | 208 | | user: test |
|
209 | 209 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
210 | 210 | | summary: d |
|
211 | 211 | | |
|
212 | 212 | o changeset: 1:d2ae7f538514 |
|
213 | 213 | | user: test |
|
214 | 214 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
215 | 215 | | summary: b |
|
216 | 216 | | |
|
217 | 217 | o changeset: 0:cb9a9f314b8b |
|
218 | 218 | user: test |
|
219 | 219 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
220 | 220 | summary: a |
|
221 | 221 | |
|
222 | 222 | |
|
223 | 223 | keep prevents stripping dead revs |
|
224 | 224 | $ cat > $EDITED <<EOF |
|
225 | 225 | > pick bfe4a5a76b37 d |
|
226 | 226 | > pick c4f52e213402 f |
|
227 | 227 | > pick 99a62755c625 c |
|
228 | 228 | > pick 7c6fdd608667 e |
|
229 | 229 | > EOF |
|
230 | $ HGEDITOR="cat $EDITED > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle | |
|
230 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit bfe4a5a76b37 --keep 2>&1 | fixbundle | |
|
231 | 231 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
232 | 232 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
233 | 233 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
234 | 234 | $ hg log --graph |
|
235 | 235 | > cat > $EDITED <<EOF |
|
236 | 236 | > pick 7c6fdd608667 e |
|
237 | 237 | > pick 99a62755c625 c |
|
238 | 238 | > EOF |
|
239 | 239 | @ changeset: 7:99e266581538 |
|
240 | 240 | | tag: tip |
|
241 | 241 | | user: test |
|
242 | 242 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
243 | 243 | | summary: e |
|
244 | 244 | | |
|
245 | 245 | o changeset: 6:5ad36efb0653 |
|
246 | 246 | | parent: 3:c4f52e213402 |
|
247 | 247 | | user: test |
|
248 | 248 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
249 | 249 | | summary: c |
|
250 | 250 | | |
|
251 | 251 | | o changeset: 5:99a62755c625 |
|
252 | 252 | | | user: test |
|
253 | 253 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
254 | 254 | | | summary: c |
|
255 | 255 | | | |
|
256 | 256 | | o changeset: 4:7c6fdd608667 |
|
257 | 257 | |/ user: test |
|
258 | 258 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
259 | 259 | | summary: e |
|
260 | 260 | | |
|
261 | 261 | o changeset: 3:c4f52e213402 |
|
262 | 262 | | user: test |
|
263 | 263 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
264 | 264 | | summary: f |
|
265 | 265 | | |
|
266 | 266 | o changeset: 2:bfe4a5a76b37 |
|
267 | 267 | | user: test |
|
268 | 268 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
269 | 269 | | summary: d |
|
270 | 270 | | |
|
271 | 271 | o changeset: 1:d2ae7f538514 |
|
272 | 272 | | user: test |
|
273 | 273 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
274 | 274 | | summary: b |
|
275 | 275 | | |
|
276 | 276 | o changeset: 0:cb9a9f314b8b |
|
277 | 277 | user: test |
|
278 | 278 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
279 | 279 | summary: a |
|
280 | 280 | |
|
281 | 281 | |
|
282 | 282 | try with --rev |
|
283 | 283 | $ hg histedit --commands "$EDITED" --rev -2 2>&1 | fixbundle |
|
284 | 284 | abort: may not use changesets other than the ones listed |
|
285 | 285 | $ hg log --graph |
|
286 | 286 | @ changeset: 7:99e266581538 |
|
287 | 287 | | tag: tip |
|
288 | 288 | | user: test |
|
289 | 289 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
290 | 290 | | summary: e |
|
291 | 291 | | |
|
292 | 292 | o changeset: 6:5ad36efb0653 |
|
293 | 293 | | parent: 3:c4f52e213402 |
|
294 | 294 | | user: test |
|
295 | 295 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
296 | 296 | | summary: c |
|
297 | 297 | | |
|
298 | 298 | | o changeset: 5:99a62755c625 |
|
299 | 299 | | | user: test |
|
300 | 300 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
301 | 301 | | | summary: c |
|
302 | 302 | | | |
|
303 | 303 | | o changeset: 4:7c6fdd608667 |
|
304 | 304 | |/ user: test |
|
305 | 305 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
306 | 306 | | summary: e |
|
307 | 307 | | |
|
308 | 308 | o changeset: 3:c4f52e213402 |
|
309 | 309 | | user: test |
|
310 | 310 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
311 | 311 | | summary: f |
|
312 | 312 | | |
|
313 | 313 | o changeset: 2:bfe4a5a76b37 |
|
314 | 314 | | user: test |
|
315 | 315 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
316 | 316 | | summary: d |
|
317 | 317 | | |
|
318 | 318 | o changeset: 1:d2ae7f538514 |
|
319 | 319 | | user: test |
|
320 | 320 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
321 | 321 | | summary: b |
|
322 | 322 | | |
|
323 | 323 | o changeset: 0:cb9a9f314b8b |
|
324 | 324 | user: test |
|
325 | 325 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
326 | 326 | summary: a |
|
327 | 327 | |
|
328 | 328 | |
|
329 | 329 | should also work if a commit message is missing |
|
330 | 330 | $ BUNDLE="$TESTDIR/missing-comment.hg" |
|
331 | 331 | $ hg init missing |
|
332 | 332 | $ cd missing |
|
333 | 333 | $ hg unbundle $BUNDLE |
|
334 | 334 | adding changesets |
|
335 | 335 | adding manifests |
|
336 | 336 | adding file changes |
|
337 | 337 | added 3 changesets with 3 changes to 1 files |
|
338 | 338 | (run 'hg update' to get a working copy) |
|
339 | 339 | $ hg co tip |
|
340 | 340 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
341 | 341 | $ hg log --graph |
|
342 | 342 | @ changeset: 2:bd22688093b3 |
|
343 | 343 | | tag: tip |
|
344 | 344 | | user: Robert Altman <robert.altman@telventDTN.com> |
|
345 | 345 | | date: Mon Nov 28 16:40:04 2011 +0000 |
|
346 | 346 | | summary: Update file. |
|
347 | 347 | | |
|
348 | 348 | o changeset: 1:3b3e956f9171 |
|
349 | 349 | | user: Robert Altman <robert.altman@telventDTN.com> |
|
350 | 350 | | date: Mon Nov 28 16:37:57 2011 +0000 |
|
351 | 351 | | |
|
352 | 352 | o changeset: 0:141947992243 |
|
353 | 353 | user: Robert Altman <robert.altman@telventDTN.com> |
|
354 | 354 | date: Mon Nov 28 16:35:28 2011 +0000 |
|
355 | 355 | summary: Checked in text file |
|
356 | 356 | |
|
357 | 357 | $ hg histedit 0 |
|
358 | 358 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
359 | 359 | $ cd .. |
@@ -1,107 +1,107 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > graphlog= |
|
6 | 6 | > histedit= |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | $ EDITED=`pwd`/editedhistory |
|
10 | 10 | $ cat > $EDITED <<EOF |
|
11 | 11 | > drop 177f92b77385 c |
|
12 | 12 | > pick e860deea161a e |
|
13 | 13 | > pick 652413bf663e f |
|
14 | 14 | > pick 055a42cdd887 d |
|
15 | 15 | > EOF |
|
16 | 16 | $ initrepo () |
|
17 | 17 | > { |
|
18 | 18 | > hg init r |
|
19 | 19 | > cd r |
|
20 | 20 | > for x in a b c d e f ; do |
|
21 | 21 | > echo $x > $x |
|
22 | 22 | > hg add $x |
|
23 | 23 | > hg ci -m $x |
|
24 | 24 | > done |
|
25 | 25 | > } |
|
26 | 26 | |
|
27 | 27 | $ initrepo |
|
28 | 28 | |
|
29 | 29 | log before edit |
|
30 | 30 | $ hg log --graph |
|
31 | 31 | @ changeset: 5:652413bf663e |
|
32 | 32 | | tag: tip |
|
33 | 33 | | user: test |
|
34 | 34 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
35 | 35 | | summary: f |
|
36 | 36 | | |
|
37 | 37 | o changeset: 4:e860deea161a |
|
38 | 38 | | user: test |
|
39 | 39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | | summary: e |
|
41 | 41 | | |
|
42 | 42 | o changeset: 3:055a42cdd887 |
|
43 | 43 | | user: test |
|
44 | 44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | | summary: d |
|
46 | 46 | | |
|
47 | 47 | o changeset: 2:177f92b77385 |
|
48 | 48 | | user: test |
|
49 | 49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | 50 | | summary: c |
|
51 | 51 | | |
|
52 | 52 | o changeset: 1:d2ae7f538514 |
|
53 | 53 | | user: test |
|
54 | 54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | 55 | | summary: b |
|
56 | 56 | | |
|
57 | 57 | o changeset: 0:cb9a9f314b8b |
|
58 | 58 | user: test |
|
59 | 59 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 60 | summary: a |
|
61 | 61 | |
|
62 | 62 | |
|
63 | 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 | 65 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
66 | 66 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 67 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 68 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
69 | 69 | |
|
70 | 70 | log after edit |
|
71 | 71 | $ hg log --graph |
|
72 | 72 | @ changeset: 4:708943196e52 |
|
73 | 73 | | tag: tip |
|
74 | 74 | | user: test |
|
75 | 75 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
76 | 76 | | summary: d |
|
77 | 77 | | |
|
78 | 78 | o changeset: 3:75cbdffecadb |
|
79 | 79 | | user: test |
|
80 | 80 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
81 | 81 | | summary: f |
|
82 | 82 | | |
|
83 | 83 | o changeset: 2:493dc0964412 |
|
84 | 84 | | user: test |
|
85 | 85 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
86 | 86 | | summary: e |
|
87 | 87 | | |
|
88 | 88 | o changeset: 1:d2ae7f538514 |
|
89 | 89 | | user: test |
|
90 | 90 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
91 | 91 | | summary: b |
|
92 | 92 | | |
|
93 | 93 | o changeset: 0:cb9a9f314b8b |
|
94 | 94 | user: test |
|
95 | 95 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
96 | 96 | summary: a |
|
97 | 97 | |
|
98 | 98 | |
|
99 | 99 | manifest after edit |
|
100 | 100 | $ hg manifest |
|
101 | 101 | a |
|
102 | 102 | b |
|
103 | 103 | d |
|
104 | 104 | e |
|
105 | 105 | f |
|
106 | 106 | |
|
107 | 107 | $ cd .. |
@@ -1,180 +1,178 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > graphlog= |
|
6 | 6 | > histedit= |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | $ EDITED=`pwd`/editedhistory |
|
10 | 10 | $ cat > $EDITED <<EOF |
|
11 | 11 | > pick 177f92b77385 c |
|
12 | 12 | > pick 055a42cdd887 d |
|
13 | 13 | > edit e860deea161a e |
|
14 | 14 | > pick 652413bf663e f |
|
15 | 15 | > EOF |
|
16 | 16 | $ initrepo () |
|
17 | 17 | > { |
|
18 | 18 | > hg init r |
|
19 | 19 | > cd r |
|
20 | 20 | > for x in a b c d e f ; do |
|
21 | 21 | > echo $x > $x |
|
22 | 22 | > hg add $x |
|
23 | 23 | > hg ci -m $x |
|
24 | 24 | > done |
|
25 | 25 | > } |
|
26 | 26 | |
|
27 | 27 | $ initrepo |
|
28 | 28 | |
|
29 | 29 | log before edit |
|
30 | 30 | $ hg log --graph |
|
31 | 31 | @ changeset: 5:652413bf663e |
|
32 | 32 | | tag: tip |
|
33 | 33 | | user: test |
|
34 | 34 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
35 | 35 | | summary: f |
|
36 | 36 | | |
|
37 | 37 | o changeset: 4:e860deea161a |
|
38 | 38 | | user: test |
|
39 | 39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | | summary: e |
|
41 | 41 | | |
|
42 | 42 | o changeset: 3:055a42cdd887 |
|
43 | 43 | | user: test |
|
44 | 44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | | summary: d |
|
46 | 46 | | |
|
47 | 47 | o changeset: 2:177f92b77385 |
|
48 | 48 | | user: test |
|
49 | 49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | 50 | | summary: c |
|
51 | 51 | | |
|
52 | 52 | o changeset: 1:d2ae7f538514 |
|
53 | 53 | | user: test |
|
54 | 54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | 55 | | summary: b |
|
56 | 56 | | |
|
57 | 57 | o changeset: 0:cb9a9f314b8b |
|
58 | 58 | user: test |
|
59 | 59 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 60 | summary: a |
|
61 | 61 | |
|
62 | 62 | |
|
63 | 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 | 65 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
66 | 66 | abort: Make changes as needed, you may commit or record as needed now. |
|
67 | 67 | When you are finished, run hg histedit --continue to resume. |
|
68 | 68 | |
|
69 | 69 | commit, then edit the revision |
|
70 | 70 | $ hg ci -m 'wat' |
|
71 | 71 | created new head |
|
72 | 72 | $ echo a > e |
|
73 | 73 | $ HGEDITOR='echo "foobaz" > ' hg histedit --continue 2>&1 | fixbundle |
|
74 | 74 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
75 | 75 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
76 | 76 | |
|
77 | 77 | $ hg log --graph |
|
78 | 78 | @ changeset: 6:bf757c081cd0 |
|
79 | 79 | | tag: tip |
|
80 | 80 | | user: test |
|
81 | 81 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
82 | 82 | | summary: f |
|
83 | 83 | | |
|
84 | 84 | o changeset: 5:d6b15fed32d4 |
|
85 | 85 | | user: test |
|
86 | 86 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
87 | 87 | | summary: foobaz |
|
88 | 88 | | |
|
89 | 89 | o changeset: 4:1a60820cd1f6 |
|
90 | 90 | | user: test |
|
91 | 91 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
92 | 92 | | summary: wat |
|
93 | 93 | | |
|
94 | 94 | o changeset: 3:055a42cdd887 |
|
95 | 95 | | user: test |
|
96 | 96 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
97 | 97 | | summary: d |
|
98 | 98 | | |
|
99 | 99 | o changeset: 2:177f92b77385 |
|
100 | 100 | | user: test |
|
101 | 101 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
102 | 102 | | summary: c |
|
103 | 103 | | |
|
104 | 104 | o changeset: 1:d2ae7f538514 |
|
105 | 105 | | user: test |
|
106 | 106 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
107 | 107 | | summary: b |
|
108 | 108 | | |
|
109 | 109 | o changeset: 0:cb9a9f314b8b |
|
110 | 110 | user: test |
|
111 | 111 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
112 | 112 | summary: a |
|
113 | 113 | |
|
114 | 114 | |
|
115 | 115 | $ hg cat e |
|
116 | 116 | a |
|
117 | 117 | |
|
118 | 118 | $ cat > $EDITED <<EOF |
|
119 | 119 | > edit bf757c081cd0 f |
|
120 | 120 | > EOF |
|
121 | $ HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle | |
|
121 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle | |
|
122 | 122 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
123 | 123 | abort: Make changes as needed, you may commit or record as needed now. |
|
124 | 124 | When you are finished, run hg histedit --continue to resume. |
|
125 | 125 | $ hg status |
|
126 | 126 | A f |
|
127 | 127 | $ HGEDITOR='true' hg histedit --continue |
|
128 | 128 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
129 | 129 | $ hg status |
|
130 | 130 | |
|
131 | 131 | log after edit |
|
132 | 132 | $ hg log --limit 1 |
|
133 | 133 | changeset: 6:bf757c081cd0 |
|
134 | 134 | tag: tip |
|
135 | 135 | user: test |
|
136 | 136 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
137 | 137 | summary: f |
|
138 | 138 | |
|
139 | 139 | |
|
140 | 140 | say we'll change the message, but don't. |
|
141 | 141 | $ cat > ../edit.sh <<EOF |
|
142 | > #!/bin/sh | |
|
143 | > cat \$1 | sed s/pick/mess/ > tmp | |
|
144 | > mv tmp \$1 | |
|
142 | > cat "\$1" | sed s/pick/mess/ > tmp | |
|
143 | > mv tmp "\$1" | |
|
145 | 144 | > EOF |
|
146 | $ chmod +x ../edit.sh | |
|
147 | $ HGEDITOR="../edit.sh" hg histedit tip 2>&1 | fixbundle | |
|
145 | $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle | |
|
148 | 146 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
149 | 147 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
150 | 148 | $ hg status |
|
151 | 149 | $ hg log --limit 1 |
|
152 | 150 | changeset: 6:bf757c081cd0 |
|
153 | 151 | tag: tip |
|
154 | 152 | user: test |
|
155 | 153 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
156 | 154 | summary: f |
|
157 | 155 | |
|
158 | 156 | |
|
159 | 157 | modify the message |
|
160 | 158 | $ cat > $EDITED <<EOF |
|
161 | 159 | > mess bf757c081cd0 f |
|
162 | 160 | > EOF |
|
163 | $ HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle | |
|
161 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle | |
|
164 | 162 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
165 | 163 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
166 | 164 | $ hg status |
|
167 | 165 | $ hg log --limit 1 |
|
168 | 166 | changeset: 6:0b16746f8e89 |
|
169 | 167 | tag: tip |
|
170 | 168 | user: test |
|
171 | 169 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
172 | 170 | summary: mess bf757c081cd0 f |
|
173 | 171 | |
|
174 | 172 | |
|
175 | 173 | rollback should not work after a histedit |
|
176 | 174 | $ hg rollback |
|
177 | 175 | no rollback information available |
|
178 | 176 | [1] |
|
179 | 177 | |
|
180 | 178 | $ cd .. |
@@ -1,146 +1,146 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > graphlog= |
|
6 | 6 | > histedit= |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | $ EDITED=`pwd`/editedhistory |
|
10 | 10 | $ cat > $EDITED <<EOF |
|
11 | 11 | > pick 177f92b77385 c |
|
12 | 12 | > pick 055a42cdd887 d |
|
13 | 13 | > fold bfa474341cc9 does not commute with e |
|
14 | 14 | > pick e860deea161a e |
|
15 | 15 | > pick 652413bf663e f |
|
16 | 16 | > EOF |
|
17 | 17 | $ initrepo () |
|
18 | 18 | > { |
|
19 | 19 | > hg init $1 |
|
20 | 20 | > cd $1 |
|
21 | 21 | > for x in a b c d e f ; do |
|
22 | 22 | > echo $x > $x |
|
23 | 23 | > hg add $x |
|
24 | 24 | > hg ci -m $x |
|
25 | 25 | > done |
|
26 | 26 | > echo a >> e |
|
27 | 27 | > hg ci -m 'does not commute with e' |
|
28 | 28 | > cd .. |
|
29 | 29 | > } |
|
30 | 30 | |
|
31 | 31 | $ initrepo r |
|
32 | 32 | $ cd r |
|
33 | 33 | |
|
34 | 34 | log before edit |
|
35 | 35 | $ hg log --graph |
|
36 | 36 | @ changeset: 6:bfa474341cc9 |
|
37 | 37 | | tag: tip |
|
38 | 38 | | user: test |
|
39 | 39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | | summary: does not commute with e |
|
41 | 41 | | |
|
42 | 42 | o changeset: 5:652413bf663e |
|
43 | 43 | | user: test |
|
44 | 44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | | summary: f |
|
46 | 46 | | |
|
47 | 47 | o changeset: 4:e860deea161a |
|
48 | 48 | | user: test |
|
49 | 49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | 50 | | summary: e |
|
51 | 51 | | |
|
52 | 52 | o changeset: 3:055a42cdd887 |
|
53 | 53 | | user: test |
|
54 | 54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | 55 | | summary: d |
|
56 | 56 | | |
|
57 | 57 | o changeset: 2:177f92b77385 |
|
58 | 58 | | user: test |
|
59 | 59 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 60 | | summary: c |
|
61 | 61 | | |
|
62 | 62 | o changeset: 1:d2ae7f538514 |
|
63 | 63 | | user: test |
|
64 | 64 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
65 | 65 | | summary: b |
|
66 | 66 | | |
|
67 | 67 | o changeset: 0:cb9a9f314b8b |
|
68 | 68 | user: test |
|
69 | 69 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
70 | 70 | summary: a |
|
71 | 71 | |
|
72 | 72 | |
|
73 | 73 | edit the history |
|
74 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
74 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
75 | 75 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
76 | 76 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
77 | 77 | abort: Fix up the change and run hg histedit --continue |
|
78 | 78 | |
|
79 | 79 | fix up |
|
80 | 80 | $ echo a > e |
|
81 | 81 | $ hg add e |
|
82 | 82 | $ cat > cat.py <<EOF |
|
83 | 83 | > import sys |
|
84 | 84 | > print open(sys.argv[1]).read() |
|
85 | 85 | |
|
86 | 86 | |
|
87 | 87 | > EOF |
|
88 | 88 | $ HGEDITOR="python cat.py" hg histedit --continue 2>&1 | fixbundle | grep -v '2 files removed' |
|
89 | 89 | d |
|
90 | 90 | *** |
|
91 | 91 | does not commute with e |
|
92 | 92 | |
|
93 | 93 | |
|
94 | 94 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
95 | 95 | file e already exists |
|
96 | 96 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
97 | 97 | abort: Fix up the change and run hg histedit --continue |
|
98 | 98 | |
|
99 | 99 | just continue this time |
|
100 | 100 | $ hg histedit --continue 2>&1 | fixbundle |
|
101 | 101 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 | 102 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
103 | 103 | |
|
104 | 104 | log after edit |
|
105 | 105 | $ hg log --graph |
|
106 | 106 | @ changeset: 4:f768fd60ca34 |
|
107 | 107 | | tag: tip |
|
108 | 108 | | user: test |
|
109 | 109 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
110 | 110 | | summary: f |
|
111 | 111 | | |
|
112 | 112 | o changeset: 3:671efe372e33 |
|
113 | 113 | | user: test |
|
114 | 114 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
115 | 115 | | summary: d |
|
116 | 116 | | |
|
117 | 117 | o changeset: 2:177f92b77385 |
|
118 | 118 | | user: test |
|
119 | 119 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
120 | 120 | | summary: c |
|
121 | 121 | | |
|
122 | 122 | o changeset: 1:d2ae7f538514 |
|
123 | 123 | | user: test |
|
124 | 124 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
125 | 125 | | summary: b |
|
126 | 126 | | |
|
127 | 127 | o changeset: 0:cb9a9f314b8b |
|
128 | 128 | user: test |
|
129 | 129 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
130 | 130 | summary: a |
|
131 | 131 | |
|
132 | 132 | |
|
133 | 133 | contents of e |
|
134 | 134 | $ hg cat e |
|
135 | 135 | a |
|
136 | 136 | |
|
137 | 137 | manifest |
|
138 | 138 | $ hg manifest |
|
139 | 139 | a |
|
140 | 140 | b |
|
141 | 141 | c |
|
142 | 142 | d |
|
143 | 143 | e |
|
144 | 144 | f |
|
145 | 145 | |
|
146 | 146 | $ cd .. |
@@ -1,110 +1,110 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > graphlog= |
|
6 | 6 | > histedit= |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | $ EDITED=`pwd`/editedhistory |
|
10 | 10 | $ cat > $EDITED <<EOF |
|
11 | 11 | > pick e860deea161a e |
|
12 | 12 | > pick 652413bf663e f |
|
13 | 13 | > fold 177f92b77385 c |
|
14 | 14 | > pick 055a42cdd887 d |
|
15 | 15 | > EOF |
|
16 | 16 | $ initrepo () |
|
17 | 17 | > { |
|
18 | 18 | > hg init r |
|
19 | 19 | > cd r |
|
20 | 20 | > for x in a b c d e f ; do |
|
21 | 21 | > echo $x > $x |
|
22 | 22 | > hg add $x |
|
23 | 23 | > hg ci -m $x |
|
24 | 24 | > done |
|
25 | 25 | > } |
|
26 | 26 | |
|
27 | 27 | $ initrepo |
|
28 | 28 | |
|
29 | 29 | log before edit |
|
30 | 30 | $ hg log --graph |
|
31 | 31 | @ changeset: 5:652413bf663e |
|
32 | 32 | | tag: tip |
|
33 | 33 | | user: test |
|
34 | 34 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
35 | 35 | | summary: f |
|
36 | 36 | | |
|
37 | 37 | o changeset: 4:e860deea161a |
|
38 | 38 | | user: test |
|
39 | 39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | | summary: e |
|
41 | 41 | | |
|
42 | 42 | o changeset: 3:055a42cdd887 |
|
43 | 43 | | user: test |
|
44 | 44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | | summary: d |
|
46 | 46 | | |
|
47 | 47 | o changeset: 2:177f92b77385 |
|
48 | 48 | | user: test |
|
49 | 49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | 50 | | summary: c |
|
51 | 51 | | |
|
52 | 52 | o changeset: 1:d2ae7f538514 |
|
53 | 53 | | user: test |
|
54 | 54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | 55 | | summary: b |
|
56 | 56 | | |
|
57 | 57 | o changeset: 0:cb9a9f314b8b |
|
58 | 58 | user: test |
|
59 | 59 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 60 | summary: a |
|
61 | 61 | |
|
62 | 62 | |
|
63 | 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 | 65 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
66 | 66 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
67 | 67 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 68 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
69 | 69 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
70 | 70 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
71 | 71 | |
|
72 | 72 | log after edit |
|
73 | 73 | $ hg log --graph |
|
74 | 74 | @ changeset: 4:82b0c1ff1777 |
|
75 | 75 | | tag: tip |
|
76 | 76 | | user: test |
|
77 | 77 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
78 | 78 | | summary: d |
|
79 | 79 | | |
|
80 | 80 | o changeset: 3:150aafb44a91 |
|
81 | 81 | | user: test |
|
82 | 82 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
83 | 83 | | summary: pick e860deea161a e |
|
84 | 84 | | |
|
85 | 85 | o changeset: 2:493dc0964412 |
|
86 | 86 | | user: test |
|
87 | 87 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
88 | 88 | | summary: e |
|
89 | 89 | | |
|
90 | 90 | o changeset: 1:d2ae7f538514 |
|
91 | 91 | | user: test |
|
92 | 92 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
93 | 93 | | summary: b |
|
94 | 94 | | |
|
95 | 95 | o changeset: 0:cb9a9f314b8b |
|
96 | 96 | user: test |
|
97 | 97 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
98 | 98 | summary: a |
|
99 | 99 | |
|
100 | 100 | |
|
101 | 101 | post-fold manifest |
|
102 | 102 | $ hg manifest |
|
103 | 103 | a |
|
104 | 104 | b |
|
105 | 105 | c |
|
106 | 106 | d |
|
107 | 107 | e |
|
108 | 108 | f |
|
109 | 109 | |
|
110 | 110 | $ cd .. |
@@ -1,189 +1,187 b'' | |||
|
1 | 1 | test for old histedit issue #6: |
|
2 | 2 | editing a changeset without any actual change would corrupt the repository |
|
3 | 3 | |
|
4 | 4 | $ . "$TESTDIR/histedit-helpers.sh" |
|
5 | 5 | |
|
6 | 6 | $ cat >> $HGRCPATH <<EOF |
|
7 | 7 | > [extensions] |
|
8 | 8 | > graphlog= |
|
9 | 9 | > histedit= |
|
10 | 10 | > EOF |
|
11 | 11 | |
|
12 | 12 | $ initrepo () |
|
13 | 13 | > { |
|
14 | 14 | > dir="$1" |
|
15 | 15 | > comment="$2" |
|
16 | 16 | > if [ -n "${comment}" ]; then |
|
17 | 17 | > echo % ${comment} |
|
18 | 18 | > echo % ${comment} | sed 's:.:-:g' |
|
19 | 19 | > fi |
|
20 | 20 | > hg init ${dir} |
|
21 | 21 | > cd ${dir} |
|
22 | 22 | > for x in a b c d e f ; do |
|
23 | 23 | > echo $x > $x |
|
24 | 24 | > hg add $x |
|
25 | 25 | > hg ci -m $x |
|
26 | 26 | > done |
|
27 | 27 | > cd .. |
|
28 | 28 | > } |
|
29 | 29 | |
|
30 | 30 | $ geneditor () |
|
31 | 31 | > { |
|
32 | 32 | > # generate an editor script for selecting changesets to be edited |
|
33 | 33 | > choice=$1 # changesets that should be edited (using sed line ranges) |
|
34 | 34 | > cat <<EOF | sed 's:^....::' |
|
35 | > #!/bin/sh | |
|
36 | 35 | > # editing the rules, replacing 'pick' with 'edit' for the chosen lines |
|
37 |
> sed '${choice}s:^pick:edit:' \$ |
|
|
38 |
> mv \${1} |
|
|
36 | > sed '${choice}s:^pick:edit:' "\$1" > "\${1}.tmp" | |
|
37 | > mv "\${1}.tmp" "\$1" | |
|
39 | 38 |
|
|
40 |
> sed '/^#/d;/^$/d;s:^:| :' |
|
|
39 | > sed '/^#/d;/^$/d;s:^:| :' "\$1" >&2 | |
|
41 | 40 | > EOF |
|
42 | 41 | > } |
|
43 | 42 | |
|
44 | 43 | $ startediting () |
|
45 | 44 | > { |
|
46 | 45 | > # begin an editing session |
|
47 | 46 | > choice="$1" # changesets that should be edited |
|
48 | 47 | > number="$2" # number of changesets considered (from tip) |
|
49 | 48 | > comment="$3" |
|
50 | 49 | > geneditor "${choice}" > edit.sh |
|
51 | > chmod +x edit.sh | |
|
52 | 50 | > echo % start editing the history ${comment} |
|
53 | > HGEDITOR=./edit.sh hg histedit -- -${number} 2>&1 | fixbundle | |
|
51 | > HGEDITOR="sh ./edit.sh" hg histedit -- -${number} 2>&1 | fixbundle | |
|
54 | 52 | > } |
|
55 | 53 | |
|
56 | 54 | $ continueediting () |
|
57 | 55 | > { |
|
58 | 56 | > # continue an edit already in progress |
|
59 | 57 | > editor="$1" # message editor when finalizing editing |
|
60 | 58 | > comment="$2" |
|
61 | 59 | > echo % finalize changeset editing ${comment} |
|
62 | 60 | > HGEDITOR=${editor} hg histedit --continue 2>&1 | fixbundle |
|
63 | 61 | > } |
|
64 | 62 | |
|
65 | 63 | $ graphlog () |
|
66 | 64 | > { |
|
67 | 65 | > comment="${1:-log}" |
|
68 | 66 | > echo % "${comment}" |
|
69 | 67 | > hg glog --template '{rev} {node} \"{desc|firstline}\"\n' |
|
70 | 68 | > } |
|
71 | 69 | |
|
72 | 70 | |
|
73 | 71 | $ initrepo r1 "test editing with no change" |
|
74 | 72 | % test editing with no change |
|
75 | 73 | ----------------------------- |
|
76 | 74 | $ cd r1 |
|
77 | 75 | $ graphlog "log before editing" |
|
78 | 76 | % log before editing |
|
79 | 77 | @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" |
|
80 | 78 | | |
|
81 | 79 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" |
|
82 | 80 | | |
|
83 | 81 | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" |
|
84 | 82 | | |
|
85 | 83 | o 2 177f92b773850b59254aa5e923436f921b55483b "c" |
|
86 | 84 | | |
|
87 | 85 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" |
|
88 | 86 | | |
|
89 | 87 | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" |
|
90 | 88 | |
|
91 | 89 | $ startediting 2 3 "(not changing anything)" # edit the 2nd of 3 changesets |
|
92 | 90 | % start editing the history (not changing anything) |
|
93 | 91 | | pick 055a42cdd887 3 d |
|
94 | 92 | | edit e860deea161a 4 e |
|
95 | 93 | | pick 652413bf663e 5 f |
|
96 | 94 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
97 | 95 | abort: Make changes as needed, you may commit or record as needed now. |
|
98 | 96 | When you are finished, run hg histedit --continue to resume. |
|
99 | 97 | $ continueediting true "(leaving commit message unaltered)" |
|
100 | 98 | % finalize changeset editing (leaving commit message unaltered) |
|
101 | 99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
102 | 100 | |
|
103 | 101 | check state of working copy |
|
104 | 102 | $ hg id |
|
105 | 103 | 652413bf663e tip |
|
106 | 104 | |
|
107 | 105 | $ graphlog "log after history editing" |
|
108 | 106 | % log after history editing |
|
109 | 107 | @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" |
|
110 | 108 | | |
|
111 | 109 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" |
|
112 | 110 | | |
|
113 | 111 | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" |
|
114 | 112 | | |
|
115 | 113 | o 2 177f92b773850b59254aa5e923436f921b55483b "c" |
|
116 | 114 | | |
|
117 | 115 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" |
|
118 | 116 | | |
|
119 | 117 | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" |
|
120 | 118 | |
|
121 | 119 | |
|
122 | 120 | $ cd .. |
|
123 | 121 | |
|
124 | 122 | $ initrepo r2 "test editing with no change, then abort" |
|
125 | 123 | % test editing with no change, then abort |
|
126 | 124 | ----------------------------------------- |
|
127 | 125 | $ cd r2 |
|
128 | 126 | $ graphlog "log before editing" |
|
129 | 127 | % log before editing |
|
130 | 128 | @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" |
|
131 | 129 | | |
|
132 | 130 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" |
|
133 | 131 | | |
|
134 | 132 | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" |
|
135 | 133 | | |
|
136 | 134 | o 2 177f92b773850b59254aa5e923436f921b55483b "c" |
|
137 | 135 | | |
|
138 | 136 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" |
|
139 | 137 | | |
|
140 | 138 | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" |
|
141 | 139 | |
|
142 | 140 | $ startediting 1,2 3 "(not changing anything)" # edit the 1st two of 3 changesets |
|
143 | 141 | % start editing the history (not changing anything) |
|
144 | 142 | | edit 055a42cdd887 3 d |
|
145 | 143 | | edit e860deea161a 4 e |
|
146 | 144 | | pick 652413bf663e 5 f |
|
147 | 145 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
148 | 146 | abort: Make changes as needed, you may commit or record as needed now. |
|
149 | 147 | When you are finished, run hg histedit --continue to resume. |
|
150 | 148 | $ continueediting true "(leaving commit message unaltered)" |
|
151 | 149 | % finalize changeset editing (leaving commit message unaltered) |
|
152 | 150 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
153 | 151 | abort: Make changes as needed, you may commit or record as needed now. |
|
154 | 152 | When you are finished, run hg histedit --continue to resume. |
|
155 | 153 | $ graphlog "log after first edit" |
|
156 | 154 | % log after first edit |
|
157 | 155 | o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" |
|
158 | 156 | | |
|
159 | 157 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" |
|
160 | 158 | | |
|
161 | 159 | @ 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" |
|
162 | 160 | | |
|
163 | 161 | o 2 177f92b773850b59254aa5e923436f921b55483b "c" |
|
164 | 162 | | |
|
165 | 163 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" |
|
166 | 164 | | |
|
167 | 165 | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" |
|
168 | 166 | |
|
169 | 167 | |
|
170 | 168 | abort editing session |
|
171 | 169 | $ hg histedit --abort 2>&1 | fixbundle |
|
172 | 170 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
173 | 171 | |
|
174 | 172 | $ graphlog "log after abort" |
|
175 | 173 | % log after abort |
|
176 | 174 | @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" |
|
177 | 175 | | |
|
178 | 176 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" |
|
179 | 177 | | |
|
180 | 178 | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" |
|
181 | 179 | | |
|
182 | 180 | o 2 177f92b773850b59254aa5e923436f921b55483b "c" |
|
183 | 181 | | |
|
184 | 182 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" |
|
185 | 183 | | |
|
186 | 184 | o 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b "a" |
|
187 | 185 | |
|
188 | 186 | |
|
189 | 187 | $ cd .. |
@@ -1,131 +1,131 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > graphlog= |
|
6 | 6 | > histedit= |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | $ EDITED=`pwd`/editedhistory |
|
10 | 10 | $ cat > $EDITED <<EOF |
|
11 | 11 | > pick 177f92b77385 c |
|
12 | 12 | > pick 055a42cdd887 d |
|
13 | 13 | > pick bfa474341cc9 does not commute with e |
|
14 | 14 | > pick e860deea161a e |
|
15 | 15 | > pick 652413bf663e f |
|
16 | 16 | > EOF |
|
17 | 17 | $ initrepo () |
|
18 | 18 | > { |
|
19 | 19 | > hg init r |
|
20 | 20 | > cd r |
|
21 | 21 | > for x in a b c d e f ; do |
|
22 | 22 | > echo $x > $x |
|
23 | 23 | > hg add $x |
|
24 | 24 | > hg ci -m $x |
|
25 | 25 | > done |
|
26 | 26 | > echo a >> e |
|
27 | 27 | > hg ci -m 'does not commute with e' |
|
28 | 28 | > cd .. |
|
29 | 29 | > } |
|
30 | 30 | |
|
31 | 31 | $ initrepo |
|
32 | 32 | $ cd r |
|
33 | 33 | |
|
34 | 34 | log before edit |
|
35 | 35 | $ hg log --graph |
|
36 | 36 | @ changeset: 6:bfa474341cc9 |
|
37 | 37 | | tag: tip |
|
38 | 38 | | user: test |
|
39 | 39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | | summary: does not commute with e |
|
41 | 41 | | |
|
42 | 42 | o changeset: 5:652413bf663e |
|
43 | 43 | | user: test |
|
44 | 44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | | summary: f |
|
46 | 46 | | |
|
47 | 47 | o changeset: 4:e860deea161a |
|
48 | 48 | | user: test |
|
49 | 49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | 50 | | summary: e |
|
51 | 51 | | |
|
52 | 52 | o changeset: 3:055a42cdd887 |
|
53 | 53 | | user: test |
|
54 | 54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | 55 | | summary: d |
|
56 | 56 | | |
|
57 | 57 | o changeset: 2:177f92b77385 |
|
58 | 58 | | user: test |
|
59 | 59 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 60 | | summary: c |
|
61 | 61 | | |
|
62 | 62 | o changeset: 1:d2ae7f538514 |
|
63 | 63 | | user: test |
|
64 | 64 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
65 | 65 | | summary: b |
|
66 | 66 | | |
|
67 | 67 | o changeset: 0:cb9a9f314b8b |
|
68 | 68 | user: test |
|
69 | 69 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
70 | 70 | summary: a |
|
71 | 71 | |
|
72 | 72 | |
|
73 | 73 | edit the history |
|
74 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
74 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
75 | 75 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
76 | 76 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
77 | 77 | abort: Fix up the change and run hg histedit --continue |
|
78 | 78 | |
|
79 | 79 | fix up (pre abort) |
|
80 | 80 | $ echo a > e |
|
81 | 81 | $ hg add e |
|
82 | 82 | $ hg histedit --continue 2>&1 | fixbundle |
|
83 | 83 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
84 | 84 | file e already exists |
|
85 | 85 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
86 | 86 | abort: Fix up the change and run hg histedit --continue |
|
87 | 87 | |
|
88 | 88 | abort the edit |
|
89 | 89 | $ hg histedit --abort 2>&1 | fixbundle |
|
90 | 90 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 91 | |
|
92 | 92 | log after abort |
|
93 | 93 | $ hg log --graph |
|
94 | 94 | @ changeset: 6:bfa474341cc9 |
|
95 | 95 | | tag: tip |
|
96 | 96 | | user: test |
|
97 | 97 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
98 | 98 | | summary: does not commute with e |
|
99 | 99 | | |
|
100 | 100 | o changeset: 5:652413bf663e |
|
101 | 101 | | user: test |
|
102 | 102 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
103 | 103 | | summary: f |
|
104 | 104 | | |
|
105 | 105 | o changeset: 4:e860deea161a |
|
106 | 106 | | user: test |
|
107 | 107 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
108 | 108 | | summary: e |
|
109 | 109 | | |
|
110 | 110 | o changeset: 3:055a42cdd887 |
|
111 | 111 | | user: test |
|
112 | 112 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
113 | 113 | | summary: d |
|
114 | 114 | | |
|
115 | 115 | o changeset: 2:177f92b77385 |
|
116 | 116 | | user: test |
|
117 | 117 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
118 | 118 | | summary: c |
|
119 | 119 | | |
|
120 | 120 | o changeset: 1:d2ae7f538514 |
|
121 | 121 | | user: test |
|
122 | 122 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
123 | 123 | | summary: b |
|
124 | 124 | | |
|
125 | 125 | o changeset: 0:cb9a9f314b8b |
|
126 | 126 | user: test |
|
127 | 127 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
128 | 128 | summary: a |
|
129 | 129 | |
|
130 | 130 | |
|
131 | 131 | $ cd .. |
@@ -1,244 +1,244 b'' | |||
|
1 | 1 | $ . "$TESTDIR/histedit-helpers.sh" |
|
2 | 2 | |
|
3 | 3 | $ cat >> $HGRCPATH <<EOF |
|
4 | 4 | > [extensions] |
|
5 | 5 | > graphlog= |
|
6 | 6 | > histedit= |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | $ EDITED=`pwd`/editedhistory |
|
10 | 10 | $ cat > $EDITED <<EOF |
|
11 | 11 | > pick 177f92b77385 c |
|
12 | 12 | > pick 055a42cdd887 d |
|
13 | 13 | > pick bfa474341cc9 does not commute with e |
|
14 | 14 | > pick e860deea161a e |
|
15 | 15 | > pick 652413bf663e f |
|
16 | 16 | > EOF |
|
17 | 17 | $ initrepo () |
|
18 | 18 | > { |
|
19 | 19 | > hg init $1 |
|
20 | 20 | > cd $1 |
|
21 | 21 | > for x in a b c d e f ; do |
|
22 | 22 | > echo $x > $x |
|
23 | 23 | > hg add $x |
|
24 | 24 | > hg ci -m $x |
|
25 | 25 | > done |
|
26 | 26 | > echo a >> e |
|
27 | 27 | > hg ci -m 'does not commute with e' |
|
28 | 28 | > cd .. |
|
29 | 29 | > } |
|
30 | 30 | |
|
31 | 31 | $ initrepo r1 |
|
32 | 32 | $ cd r1 |
|
33 | 33 | |
|
34 | 34 | log before edit |
|
35 | 35 | $ hg log --graph |
|
36 | 36 | @ changeset: 6:bfa474341cc9 |
|
37 | 37 | | tag: tip |
|
38 | 38 | | user: test |
|
39 | 39 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
40 | 40 | | summary: does not commute with e |
|
41 | 41 | | |
|
42 | 42 | o changeset: 5:652413bf663e |
|
43 | 43 | | user: test |
|
44 | 44 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
45 | 45 | | summary: f |
|
46 | 46 | | |
|
47 | 47 | o changeset: 4:e860deea161a |
|
48 | 48 | | user: test |
|
49 | 49 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
50 | 50 | | summary: e |
|
51 | 51 | | |
|
52 | 52 | o changeset: 3:055a42cdd887 |
|
53 | 53 | | user: test |
|
54 | 54 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
55 | 55 | | summary: d |
|
56 | 56 | | |
|
57 | 57 | o changeset: 2:177f92b77385 |
|
58 | 58 | | user: test |
|
59 | 59 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
60 | 60 | | summary: c |
|
61 | 61 | | |
|
62 | 62 | o changeset: 1:d2ae7f538514 |
|
63 | 63 | | user: test |
|
64 | 64 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
65 | 65 | | summary: b |
|
66 | 66 | | |
|
67 | 67 | o changeset: 0:cb9a9f314b8b |
|
68 | 68 | user: test |
|
69 | 69 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
70 | 70 | summary: a |
|
71 | 71 | |
|
72 | 72 | |
|
73 | 73 | edit the history |
|
74 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
74 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
75 | 75 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
76 | 76 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
77 | 77 | abort: Fix up the change and run hg histedit --continue |
|
78 | 78 | |
|
79 | 79 | abort the edit |
|
80 | 80 | $ hg histedit --abort 2>&1 | fixbundle |
|
81 | 81 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
82 | 82 | |
|
83 | 83 | |
|
84 | 84 | second edit set |
|
85 | 85 | |
|
86 | 86 | $ hg log --graph |
|
87 | 87 | @ changeset: 6:bfa474341cc9 |
|
88 | 88 | | tag: tip |
|
89 | 89 | | user: test |
|
90 | 90 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
91 | 91 | | summary: does not commute with e |
|
92 | 92 | | |
|
93 | 93 | o changeset: 5:652413bf663e |
|
94 | 94 | | user: test |
|
95 | 95 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
96 | 96 | | summary: f |
|
97 | 97 | | |
|
98 | 98 | o changeset: 4:e860deea161a |
|
99 | 99 | | user: test |
|
100 | 100 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
101 | 101 | | summary: e |
|
102 | 102 | | |
|
103 | 103 | o changeset: 3:055a42cdd887 |
|
104 | 104 | | user: test |
|
105 | 105 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
106 | 106 | | summary: d |
|
107 | 107 | | |
|
108 | 108 | o changeset: 2:177f92b77385 |
|
109 | 109 | | user: test |
|
110 | 110 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
111 | 111 | | summary: c |
|
112 | 112 | | |
|
113 | 113 | o changeset: 1:d2ae7f538514 |
|
114 | 114 | | user: test |
|
115 | 115 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
116 | 116 | | summary: b |
|
117 | 117 | | |
|
118 | 118 | o changeset: 0:cb9a9f314b8b |
|
119 | 119 | user: test |
|
120 | 120 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
121 | 121 | summary: a |
|
122 | 122 | |
|
123 | 123 | |
|
124 | 124 | edit the history |
|
125 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
125 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
126 | 126 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
127 | 127 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
128 | 128 | abort: Fix up the change and run hg histedit --continue |
|
129 | 129 | |
|
130 | 130 | fix up |
|
131 | 131 | $ echo a > e |
|
132 | 132 | $ hg add e |
|
133 | 133 | $ hg histedit --continue 2>&1 | fixbundle |
|
134 | 134 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
135 | 135 | file e already exists |
|
136 | 136 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
137 | 137 | abort: Fix up the change and run hg histedit --continue |
|
138 | 138 | |
|
139 | 139 | just continue this time |
|
140 | 140 | $ hg histedit --continue 2>&1 | fixbundle |
|
141 | 141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
142 | 142 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
143 | 143 | |
|
144 | 144 | log after edit |
|
145 | 145 | $ hg log --graph |
|
146 | 146 | @ changeset: 5:9ab84894b459 |
|
147 | 147 | | tag: tip |
|
148 | 148 | | user: test |
|
149 | 149 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
150 | 150 | | summary: f |
|
151 | 151 | | |
|
152 | 152 | o changeset: 4:1fff3ae8199d |
|
153 | 153 | | user: test |
|
154 | 154 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
155 | 155 | | summary: does not commute with e |
|
156 | 156 | | |
|
157 | 157 | o changeset: 3:055a42cdd887 |
|
158 | 158 | | user: test |
|
159 | 159 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
160 | 160 | | summary: d |
|
161 | 161 | | |
|
162 | 162 | o changeset: 2:177f92b77385 |
|
163 | 163 | | user: test |
|
164 | 164 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
165 | 165 | | summary: c |
|
166 | 166 | | |
|
167 | 167 | o changeset: 1:d2ae7f538514 |
|
168 | 168 | | user: test |
|
169 | 169 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
170 | 170 | | summary: b |
|
171 | 171 | | |
|
172 | 172 | o changeset: 0:cb9a9f314b8b |
|
173 | 173 | user: test |
|
174 | 174 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
175 | 175 | summary: a |
|
176 | 176 | |
|
177 | 177 | |
|
178 | 178 | start over |
|
179 | 179 | |
|
180 | 180 | $ cd .. |
|
181 | 181 | |
|
182 | 182 | $ initrepo r2 |
|
183 | 183 | $ cd r2 |
|
184 | 184 | $ cat > $EDITED <<EOF |
|
185 | 185 | > pick 177f92b77385 c |
|
186 | 186 | > pick 055a42cdd887 d |
|
187 | 187 | > mess bfa474341cc9 does not commute with e |
|
188 | 188 | > pick e860deea161a e |
|
189 | 189 | > pick 652413bf663e f |
|
190 | 190 | > EOF |
|
191 | 191 | |
|
192 | 192 | edit the history, this time with a fold action |
|
193 | $ HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
193 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle | |
|
194 | 194 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
195 | 195 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
196 | 196 | abort: Fix up the change and run hg histedit --continue |
|
197 | 197 | |
|
198 | 198 | $ echo a > e |
|
199 | 199 | $ hg add e |
|
200 | $ HGEDITOR="cat $EDITED > " hg histedit --continue 2>&1 | fixbundle | |
|
200 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit --continue 2>&1 | fixbundle | |
|
201 | 201 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
202 | 202 | file e already exists |
|
203 | 203 | 1 out of 1 hunks FAILED -- saving rejects to file e.rej |
|
204 | 204 | abort: Fix up the change and run hg histedit --continue |
|
205 | 205 | second edit also fails, but just continue |
|
206 | 206 | $ hg histedit --continue 2>&1 | fixbundle |
|
207 | 207 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
208 | 208 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
209 | 209 | |
|
210 | 210 | post message fix |
|
211 | 211 | $ hg log --graph |
|
212 | 212 | @ changeset: 5:6459970fb49b |
|
213 | 213 | | tag: tip |
|
214 | 214 | | user: test |
|
215 | 215 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
216 | 216 | | summary: f |
|
217 | 217 | | |
|
218 | 218 | o changeset: 4:556f27c874b0 |
|
219 | 219 | | user: test |
|
220 | 220 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
221 | 221 | | summary: pick 177f92b77385 c |
|
222 | 222 | | |
|
223 | 223 | o changeset: 3:055a42cdd887 |
|
224 | 224 | | user: test |
|
225 | 225 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
226 | 226 | | summary: d |
|
227 | 227 | | |
|
228 | 228 | o changeset: 2:177f92b77385 |
|
229 | 229 | | user: test |
|
230 | 230 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
231 | 231 | | summary: c |
|
232 | 232 | | |
|
233 | 233 | o changeset: 1:d2ae7f538514 |
|
234 | 234 | | user: test |
|
235 | 235 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
236 | 236 | | summary: b |
|
237 | 237 | | |
|
238 | 238 | o changeset: 0:cb9a9f314b8b |
|
239 | 239 | user: test |
|
240 | 240 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
241 | 241 | summary: a |
|
242 | 242 | |
|
243 | 243 | |
|
244 | 244 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now