Show More
@@ -181,12 +181,15 b' def commitfuncfor(repo, src):' | |||
|
181 | 181 | |
|
182 | 182 | This function ensure we apply the same treatement to all changesets. |
|
183 | 183 | |
|
184 | No such treatment is done yet. | |
|
184 | - Add a 'histedit_source' entry in extra. | |
|
185 | 185 | |
|
186 | 186 | Note that fold have its own separated logic because its handling is a bit |
|
187 | 187 | different and not easily factored out of the fold method. |
|
188 | 188 | """ |
|
189 | 189 | def commitfunc(**kwargs): |
|
190 | extra = kwargs.get('extra', {}).copy() | |
|
191 | extra['histedit_source'] = src.hex() | |
|
192 | kwargs['extra'] = extra | |
|
190 | 193 | return repo.commit(**kwargs) |
|
191 | 194 | return commitfunc |
|
192 | 195 | |
@@ -270,7 +273,7 b' def collapse(repo, first, last, commitop' | |||
|
270 | 273 | message = first.description() |
|
271 | 274 | user = commitopts.get('user') |
|
272 | 275 | date = commitopts.get('date') |
|
273 |
extra = |
|
|
276 | extra = commitopts.get('extra') | |
|
274 | 277 | |
|
275 | 278 | parents = (first.p1().node(), first.p2().node()) |
|
276 | 279 | new = context.memctx(repo, |
@@ -348,6 +351,12 b' def finishfold(ui, repo, ctx, oldctx, ne' | |||
|
348 | 351 | commitopts['message'] = newmessage |
|
349 | 352 | # date |
|
350 | 353 | commitopts['date'] = max(ctx.date(), oldctx.date()) |
|
354 | extra = ctx.extra().copy() | |
|
355 | # histedit_source | |
|
356 | # note: ctx is likely a temporary commit but that the best we can do here | |
|
357 | # This is sufficient to solve issue3681 anyway | |
|
358 | extra['histedit_source'] = '%s,%s' % (ctx.hex(), oldctx.hex()) | |
|
359 | commitopts['extra'] = extra | |
|
351 | 360 | n = collapse(repo, ctx, repo[newnode], commitopts) |
|
352 | 361 | if n is None: |
|
353 | 362 | return ctx, [] |
@@ -84,30 +84,30 b'' | |||
|
84 | 84 | > pick 652413bf663e 5 f |
|
85 | 85 | > EOF |
|
86 | 86 | $ hg histedit 1 --commands commands.txt --verbose | grep histedit |
|
87 |
histedit: moving bookmarks also-two from 177f92b77385 to |
|
|
88 |
histedit: moving bookmarks five from 652413bf663e to |
|
|
89 |
histedit: moving bookmarks four from e860deea161a to |
|
|
90 |
histedit: moving bookmarks three from 055a42cdd887 to |
|
|
91 |
histedit: moving bookmarks two from 177f92b77385 to |
|
|
87 | histedit: moving bookmarks also-two from 177f92b77385 to b346ab9a313d | |
|
88 | histedit: moving bookmarks five from 652413bf663e to cacdfd884a93 | |
|
89 | histedit: moving bookmarks four from e860deea161a to 59d9f330561f | |
|
90 | histedit: moving bookmarks three from 055a42cdd887 to 59d9f330561f | |
|
91 | histedit: moving bookmarks two from 177f92b77385 to b346ab9a313d | |
|
92 | 92 | histedit: moving bookmarks will-move-backwards from d2ae7f538514 to cb9a9f314b8b |
|
93 | 93 | saved backup bundle to $TESTTMP/r/.hg/strip-backup/d2ae7f538514-backup.hg (glob) |
|
94 |
saved backup bundle to $TESTTMP/r/.hg/strip-backup/ |
|
|
94 | saved backup bundle to $TESTTMP/r/.hg/strip-backup/96e494a2d553-backup.hg (glob) | |
|
95 | 95 | $ hg log --graph |
|
96 |
@ changeset: 3: |
|
|
96 | @ changeset: 3:cacdfd884a93 | |
|
97 | 97 | | bookmark: five |
|
98 | 98 | | tag: tip |
|
99 | 99 | | user: test |
|
100 | 100 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
101 | 101 | | summary: f |
|
102 | 102 | | |
|
103 |
o changeset: 2: |
|
|
103 | o changeset: 2:59d9f330561f | |
|
104 | 104 | | bookmark: four |
|
105 | 105 | | bookmark: three |
|
106 | 106 | | user: test |
|
107 | 107 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
108 | 108 | | summary: d |
|
109 | 109 | | |
|
110 |
o changeset: 1: |
|
|
110 | o changeset: 1:b346ab9a313d | |
|
111 | 111 | | bookmark: also-two |
|
112 | 112 | | bookmark: two |
|
113 | 113 | | user: test |
@@ -121,11 +121,11 b'' | |||
|
121 | 121 | summary: a |
|
122 | 122 | |
|
123 | 123 | $ HGEDITOR=cat hg histedit 1 |
|
124 | pick d36c0562f908 1 c | |
|
125 | pick ae467701c500 2 d | |
|
126 |
pick |
|
|
124 | pick b346ab9a313d 1 c | |
|
125 | pick 59d9f330561f 2 d | |
|
126 | pick cacdfd884a93 3 f | |
|
127 | 127 | |
|
128 |
# Edit history between |
|
|
128 | # Edit history between b346ab9a313d and cacdfd884a93 | |
|
129 | 129 | # |
|
130 | 130 | # Commands: |
|
131 | 131 | # p, pick = use commit |
@@ -136,21 +136,21 b'' | |||
|
136 | 136 | # |
|
137 | 137 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
138 | 138 | $ cat > commands.txt << EOF |
|
139 | > pick d36c0562f908 1 c | |
|
140 |
> pick |
|
|
141 |
> pick |
|
|
139 | > pick b346ab9a313d 1 c | |
|
140 | > pick cacdfd884a93 3 f | |
|
141 | > pick 59d9f330561f 2 d | |
|
142 | 142 | > EOF |
|
143 | 143 | $ hg histedit 1 --commands commands.txt --verbose | grep histedit |
|
144 |
histedit: moving bookmarks five from |
|
|
145 |
histedit: moving bookmarks four from |
|
|
146 |
histedit: moving bookmarks three from |
|
|
147 |
saved backup bundle to $TESTTMP/r/.hg/strip-backup/ |
|
|
144 | histedit: moving bookmarks five from cacdfd884a93 to c04e50810e4b | |
|
145 | histedit: moving bookmarks four from 59d9f330561f to c04e50810e4b | |
|
146 | histedit: moving bookmarks three from 59d9f330561f to c04e50810e4b | |
|
147 | saved backup bundle to $TESTTMP/r/.hg/strip-backup/59d9f330561f-backup.hg (glob) | |
|
148 | 148 | |
|
149 | 149 | We expect 'five' to stay at tip, since the tipmost bookmark is most |
|
150 | 150 | likely the useful signal. |
|
151 | 151 | |
|
152 | 152 | $ hg log --graph |
|
153 |
@ changeset: 3:1 |
|
|
153 | @ changeset: 3:c04e50810e4b | |
|
154 | 154 | | bookmark: five |
|
155 | 155 | | bookmark: four |
|
156 | 156 | | bookmark: three |
@@ -159,12 +159,12 b' likely the useful signal.' | |||
|
159 | 159 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
160 | 160 | | summary: d |
|
161 | 161 | | |
|
162 |
o changeset: 2: |
|
|
162 | o changeset: 2:c13eb81022ca | |
|
163 | 163 | | user: test |
|
164 | 164 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
165 | 165 | | summary: f |
|
166 | 166 | | |
|
167 |
o changeset: 1: |
|
|
167 | o changeset: 1:b346ab9a313d | |
|
168 | 168 | | bookmark: also-two |
|
169 | 169 | | bookmark: two |
|
170 | 170 | | user: test |
@@ -94,18 +94,18 b' rules should end up in .hg/histedit-last' | |||
|
94 | 94 | |
|
95 | 95 | log after edit |
|
96 | 96 | $ hg log --graph |
|
97 |
@ changeset: 5: |
|
|
97 | @ changeset: 5:07114f51870f | |
|
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 |
o changeset: 4: |
|
|
103 | o changeset: 4:8ade9693061e | |
|
104 | 104 | | user: test |
|
105 | 105 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
106 | 106 | | summary: f |
|
107 | 107 | | |
|
108 |
o changeset: 3: |
|
|
108 | o changeset: 3:d8249471110a | |
|
109 | 109 | | user: test |
|
110 | 110 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
111 | 111 | | summary: e |
@@ -130,9 +130,9 b' put things back' | |||
|
130 | 130 | |
|
131 | 131 | $ cat > $EDITED <<EOF |
|
132 | 132 | > pick 177f92b77385 c |
|
133 |
> pick |
|
|
134 | > pick b069cc29fb22 e | |
|
135 |
> pick |
|
|
133 | > pick 07114f51870f d | |
|
134 | > pick d8249471110a e | |
|
135 | > pick 8ade9693061e f | |
|
136 | 136 | > EOF |
|
137 | 137 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle |
|
138 | 138 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
@@ -141,18 +141,18 b' put things back' | |||
|
141 | 141 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
142 | 142 | |
|
143 | 143 | $ hg log --graph |
|
144 |
@ changeset: 5: |
|
|
144 | @ changeset: 5:7eca9b5b1148 | |
|
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 |
o changeset: 4: |
|
|
150 | o changeset: 4:915da888f2de | |
|
151 | 151 | | user: test |
|
152 | 152 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
153 | 153 | | summary: e |
|
154 | 154 | | |
|
155 |
o changeset: 3: |
|
|
155 | o changeset: 3:10517e47bbbb | |
|
156 | 156 | | user: test |
|
157 | 157 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
158 | 158 | | summary: d |
@@ -176,9 +176,9 b' put things back' | |||
|
176 | 176 | slightly different this time |
|
177 | 177 | |
|
178 | 178 | $ cat > $EDITED <<EOF |
|
179 |
> pick |
|
|
180 | > pick 652413bf663e f | |
|
181 |
> pick |
|
|
179 | > pick 10517e47bbbb d | |
|
180 | > pick 7eca9b5b1148 f | |
|
181 | > pick 915da888f2de e | |
|
182 | 182 | > pick 177f92b77385 c |
|
183 | 183 | > EOF |
|
184 | 184 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 177f92b77385 2>&1 | fixbundle |
@@ -188,23 +188,23 b' slightly different this time' | |||
|
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 |
@ changeset: 5: |
|
|
191 | @ changeset: 5:38b92f448761 | |
|
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 |
o changeset: 4: |
|
|
197 | o changeset: 4:de71b079d9ce | |
|
198 | 198 | | user: test |
|
199 | 199 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
200 | 200 | | summary: e |
|
201 | 201 | | |
|
202 |
o changeset: 3: |
|
|
202 | o changeset: 3:be9ae3a309c6 | |
|
203 | 203 | | user: test |
|
204 | 204 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
205 | 205 | | summary: f |
|
206 | 206 | | |
|
207 |
o changeset: 2: |
|
|
207 | o changeset: 2:799205341b6b | |
|
208 | 208 | | user: test |
|
209 | 209 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
210 | 210 | | summary: d |
@@ -222,48 +222,48 b' slightly different this time' | |||
|
222 | 222 | |
|
223 | 223 | keep prevents stripping dead revs |
|
224 | 224 | $ cat > $EDITED <<EOF |
|
225 |
> pick |
|
|
226 | > pick c4f52e213402 f | |
|
227 | > pick 99a62755c625 c | |
|
228 | > pick 7c6fdd608667 e | |
|
225 | > pick 799205341b6b d | |
|
226 | > pick be9ae3a309c6 f | |
|
227 | > pick 38b92f448761 c | |
|
228 | > pick de71b079d9ce e | |
|
229 | 229 | > EOF |
|
230 |
$ HGEDITOR="cat \"$EDITED\" > " hg histedit |
|
|
230 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit 799205341b6b --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 | > pick 7c6fdd608667 e | |
|
237 | > pick 99a62755c625 c | |
|
236 | > pick de71b079d9ce e | |
|
237 | > pick 38b92f448761 c | |
|
238 | 238 | > EOF |
|
239 |
@ changeset: 7: |
|
|
239 | @ changeset: 7:803ef1c6fcfd | |
|
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 |
o changeset: 6: |
|
|
246 |
| parent: 3: |
|
|
245 | o changeset: 6:ece0b8d93dda | |
|
246 | | parent: 3:be9ae3a309c6 | |
|
247 | 247 | | user: test |
|
248 | 248 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
249 | 249 | | summary: c |
|
250 | 250 | | |
|
251 |
| o changeset: 5: |
|
|
251 | | o changeset: 5:38b92f448761 | |
|
252 | 252 | | | user: test |
|
253 | 253 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
254 | 254 | | | summary: c |
|
255 | 255 | | | |
|
256 |
| o changeset: 4: |
|
|
256 | | o changeset: 4:de71b079d9ce | |
|
257 | 257 | |/ user: test |
|
258 | 258 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
259 | 259 | | summary: e |
|
260 | 260 | | |
|
261 |
o changeset: 3: |
|
|
261 | o changeset: 3:be9ae3a309c6 | |
|
262 | 262 | | user: test |
|
263 | 263 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
264 | 264 | | summary: f |
|
265 | 265 | | |
|
266 |
o changeset: 2: |
|
|
266 | o changeset: 2:799205341b6b | |
|
267 | 267 | | user: test |
|
268 | 268 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
269 | 269 | | summary: d |
@@ -283,34 +283,34 b' 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 |
@ changeset: 7: |
|
|
286 | @ changeset: 7:803ef1c6fcfd | |
|
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 |
o changeset: 6: |
|
|
293 |
| parent: 3: |
|
|
292 | o changeset: 6:ece0b8d93dda | |
|
293 | | parent: 3:be9ae3a309c6 | |
|
294 | 294 | | user: test |
|
295 | 295 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
296 | 296 | | summary: c |
|
297 | 297 | | |
|
298 |
| o changeset: 5: |
|
|
298 | | o changeset: 5:38b92f448761 | |
|
299 | 299 | | | user: test |
|
300 | 300 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
301 | 301 | | | summary: c |
|
302 | 302 | | | |
|
303 |
| o changeset: 4: |
|
|
303 | | o changeset: 4:de71b079d9ce | |
|
304 | 304 | |/ user: test |
|
305 | 305 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
306 | 306 | | summary: e |
|
307 | 307 | | |
|
308 |
o changeset: 3: |
|
|
308 | o changeset: 3:be9ae3a309c6 | |
|
309 | 309 | | user: test |
|
310 | 310 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
311 | 311 | | summary: f |
|
312 | 312 | | |
|
313 |
o changeset: 2: |
|
|
313 | o changeset: 2:799205341b6b | |
|
314 | 314 | | user: test |
|
315 | 315 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
316 | 316 | | summary: d |
@@ -69,18 +69,18 b' edit the history' | |||
|
69 | 69 | |
|
70 | 70 | log after edit |
|
71 | 71 | $ hg log --graph |
|
72 |
@ changeset: 4: |
|
|
72 | @ changeset: 4:f518305ce889 | |
|
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 |
o changeset: 3: |
|
|
78 | o changeset: 3:a4f7421b80f7 | |
|
79 | 79 | | user: test |
|
80 | 80 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
81 | 81 | | summary: f |
|
82 | 82 | | |
|
83 |
o changeset: 2: |
|
|
83 | o changeset: 2:ee283cb5f2d5 | |
|
84 | 84 | | user: test |
|
85 | 85 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
86 | 86 | | summary: e |
@@ -96,6 +96,25 b' log after edit' | |||
|
96 | 96 | summary: a |
|
97 | 97 | |
|
98 | 98 | |
|
99 | Check histedit_source | |
|
100 | ||
|
101 | $ hg log --debug --rev f518305ce889 | |
|
102 | changeset: 4:f518305ce889c07cb5bd05522176d75590ef3324 | |
|
103 | tag: tip | |
|
104 | phase: draft | |
|
105 | parent: 3:a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3 | |
|
106 | parent: -1:0000000000000000000000000000000000000000 | |
|
107 | manifest: 4:d3d4f51c157ff242c32ff745d4799aaa26ccda44 | |
|
108 | user: test | |
|
109 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
110 | files+: d | |
|
111 | extra: branch=default | |
|
112 | extra: histedit_source=055a42cdd88768532f9cf79daa407fc8d138de9b | |
|
113 | description: | |
|
114 | d | |
|
115 | ||
|
116 | ||
|
117 | ||
|
99 | 118 | manifest after edit |
|
100 | 119 | $ hg manifest |
|
101 | 120 | a |
@@ -88,13 +88,13 b' commit, then edit the revision' | |||
|
88 | 88 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 89 | |
|
90 | 90 | $ hg log --graph |
|
91 |
@ changeset: 6:b |
|
|
91 | @ changeset: 6:b5f70786f9b0 | |
|
92 | 92 | | tag: tip |
|
93 | 93 | | user: test |
|
94 | 94 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
95 | 95 | | summary: f |
|
96 | 96 | | |
|
97 |
o changeset: 5: |
|
|
97 | o changeset: 5:a5e1ba2f7afb | |
|
98 | 98 | | user: test |
|
99 | 99 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
100 | 100 | | summary: foobaz |
@@ -128,8 +128,26 b' commit, then edit the revision' | |||
|
128 | 128 | $ hg cat e |
|
129 | 129 | a |
|
130 | 130 | |
|
131 | check histedit_source | |
|
132 | ||
|
133 | $ hg log --debug --rev 5 | |
|
134 | changeset: 5:a5e1ba2f7afb899ef1581cea528fd885d2fca70d | |
|
135 | phase: draft | |
|
136 | parent: 4:1a60820cd1f6004a362aa622ebc47d59bc48eb34 | |
|
137 | parent: -1:0000000000000000000000000000000000000000 | |
|
138 | manifest: 5:5ad3be8791f39117565557781f5464363b918a45 | |
|
139 | user: test | |
|
140 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
141 | files: e | |
|
142 | extra: branch=default | |
|
143 | extra: histedit_source=e860deea161a2f77de56603b340ebbb4536308ae | |
|
144 | description: | |
|
145 | foobaz | |
|
146 | ||
|
147 | ||
|
148 | ||
|
131 | 149 | $ cat > $EDITED <<EOF |
|
132 |
> edit b |
|
|
150 | > edit b5f70786f9b0 f | |
|
133 | 151 | > EOF |
|
134 | 152 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle |
|
135 | 153 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
@@ -139,11 +157,13 b' commit, then edit the revision' | |||
|
139 | 157 | A f |
|
140 | 158 | $ HGEDITOR='true' hg histedit --continue |
|
141 | 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) | |
|
161 | ||
|
142 | 162 | $ hg status |
|
143 | 163 | |
|
144 | 164 | log after edit |
|
145 | 165 | $ hg log --limit 1 |
|
146 |
changeset: 6: |
|
|
166 | changeset: 6:a107ee126658 | |
|
147 | 167 | tag: tip |
|
148 | 168 | user: test |
|
149 | 169 | date: Thu Jan 01 00:00:00 1970 +0000 |
@@ -160,7 +180,7 b" say we'll change the message, but don't." | |||
|
160 | 180 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
161 | 181 | $ hg status |
|
162 | 182 | $ hg log --limit 1 |
|
163 |
changeset: 6: |
|
|
183 | changeset: 6:1fd3b2fe7754 | |
|
164 | 184 | tag: tip |
|
165 | 185 | user: test |
|
166 | 186 | date: Thu Jan 01 00:00:00 1970 +0000 |
@@ -169,18 +189,18 b" say we'll change the message, but don't." | |||
|
169 | 189 | |
|
170 | 190 | modify the message |
|
171 | 191 | $ cat > $EDITED <<EOF |
|
172 |
> mess |
|
|
192 | > mess 1fd3b2fe7754 f | |
|
173 | 193 | > EOF |
|
174 | 194 | $ HGEDITOR="cat \"$EDITED\" > " hg histedit tip 2>&1 | fixbundle |
|
175 | 195 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
176 | 196 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
177 | 197 | $ hg status |
|
178 | 198 | $ hg log --limit 1 |
|
179 |
changeset: 6: |
|
|
199 | changeset: 6:5585e802ef99 | |
|
180 | 200 | tag: tip |
|
181 | 201 | user: test |
|
182 | 202 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
183 |
summary: mess |
|
|
203 | summary: mess 1fd3b2fe7754 f | |
|
184 | 204 | |
|
185 | 205 | |
|
186 | 206 | rollback should not work after a histedit |
@@ -136,13 +136,13 b' just continue this time' | |||
|
136 | 136 | |
|
137 | 137 | log after edit |
|
138 | 138 | $ hg log --graph |
|
139 |
@ changeset: 5: |
|
|
139 | @ changeset: 5:d9cf42e54966 | |
|
140 | 140 | | tag: tip |
|
141 | 141 | | user: test |
|
142 | 142 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
143 | 143 | | summary: f |
|
144 | 144 | | |
|
145 |
o changeset: 4: |
|
|
145 | o changeset: 4:10486af2e984 | |
|
146 | 146 | | user: test |
|
147 | 147 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
148 | 148 | | summary: d |
@@ -72,18 +72,18 b' edit the history' | |||
|
72 | 72 | |
|
73 | 73 | log after edit |
|
74 | 74 | $ hg log --graph |
|
75 |
@ changeset: 4: |
|
|
75 | @ changeset: 4:7e0a290363ed | |
|
76 | 76 | | tag: tip |
|
77 | 77 | | user: test |
|
78 | 78 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
79 | 79 | | summary: d |
|
80 | 80 | | |
|
81 |
o changeset: 3: |
|
|
81 | o changeset: 3:5e24935bad3d | |
|
82 | 82 | | user: test |
|
83 | 83 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
84 | 84 | | summary: pick e860deea161a e |
|
85 | 85 | | |
|
86 |
o changeset: 2: |
|
|
86 | o changeset: 2:ee283cb5f2d5 | |
|
87 | 87 | | user: test |
|
88 | 88 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
89 | 89 | | summary: e |
@@ -108,6 +108,28 b' post-fold manifest' | |||
|
108 | 108 | e |
|
109 | 109 | f |
|
110 | 110 | |
|
111 | ||
|
112 | check histedit_source | |
|
113 | ||
|
114 | $ hg log --debug --rev 3 | |
|
115 | changeset: 3:5e24935bad3d5a4486de3b90f233e991465ced72 | |
|
116 | phase: draft | |
|
117 | parent: 2:ee283cb5f2d5955443f23a27b697a04339e9a39a | |
|
118 | parent: -1:0000000000000000000000000000000000000000 | |
|
119 | manifest: 3:81eede616954057198ead0b2c73b41d1f392829a | |
|
120 | user: test | |
|
121 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
122 | files+: c f | |
|
123 | extra: branch=default | |
|
124 | extra: histedit_source=a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3,177f92b773850b59254aa5e923436f921b55483b | |
|
125 | description: | |
|
126 | pick e860deea161a e | |
|
127 | pick 652413bf663e f | |
|
128 | fold 177f92b77385 c | |
|
129 | pick 055a42cdd887 d | |
|
130 | ||
|
131 | ||
|
132 | ||
|
111 | 133 | $ cd .. |
|
112 | 134 | |
|
113 | 135 | folding and creating no new change doesn't break: |
@@ -258,7 +280,7 b' dropped revision.' | |||
|
258 | 280 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
259 | 281 | saved backup bundle to $TESTTMP/fold-with-dropped/.hg/strip-backup/617f94f13c0f-backup.hg (glob) |
|
260 | 282 | $ hg log -G |
|
261 |
@ changeset: 1: |
|
|
283 | @ changeset: 1:10c647b2cdd5 | |
|
262 | 284 | | tag: tip |
|
263 | 285 | | user: test |
|
264 | 286 | | date: Thu Jan 01 00:00:00 1970 +0000 |
@@ -273,7 +295,7 b' dropped revision.' | |||
|
273 | 295 | # HG changeset patch |
|
274 | 296 | # User test |
|
275 | 297 | # Date 0 0 |
|
276 | # Node ID e29e02896e6c2b149d2228a0a64b4f3a9a4237f3 | |
|
298 | # Node ID 10c647b2cdd54db0603ecb99b2ff5ce66d5a5323 | |
|
277 | 299 | # Parent 0189ba417d34df9dda55f88b637dcae9917b5964 |
|
278 | 300 | +4 |
|
279 | 301 | *** |
@@ -281,7 +303,7 b' dropped revision.' | |||
|
281 | 303 | *** |
|
282 | 304 | +6 |
|
283 | 305 | |
|
284 |
diff -r 0189ba417d34 -r |
|
|
306 | diff -r 0189ba417d34 -r 10c647b2cdd5 file | |
|
285 | 307 | --- a/file Thu Jan 01 00:00:00 1970 +0000 |
|
286 | 308 | +++ b/file Thu Jan 01 00:00:00 1970 +0000 |
|
287 | 309 | @@ -1,3 +1,6 @@ |
@@ -96,17 +96,19 b' editing a changeset without any actual c' | |||
|
96 | 96 | When you are finished, run hg histedit --continue to resume. |
|
97 | 97 | $ continueediting true "(leaving commit message unaltered)" |
|
98 | 98 | % finalize changeset editing (leaving commit message unaltered) |
|
99 |
|
|
|
99 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
100 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
101 | ||
|
100 | 102 | |
|
101 | 103 | check state of working copy |
|
102 | 104 | $ hg id |
|
103 | 652413bf663e tip | |
|
105 | 794fe033d0a0 tip | |
|
104 | 106 | |
|
105 | 107 | $ graphlog "log after history editing" |
|
106 | 108 | % log after history editing |
|
107 | @ 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | |
|
109 | @ 5 794fe033d0a030f8df77c5de945fca35c9181c30 "f" | |
|
108 | 110 | | |
|
109 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | |
|
111 | o 4 04d2fab980779f332dec458cc944f28de8b43435 "e" | |
|
110 | 112 | | |
|
111 | 113 | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" |
|
112 | 114 | | |
@@ -152,12 +154,14 b' check state of working copy' | |||
|
152 | 154 | When you are finished, run hg histedit --continue to resume. |
|
153 | 155 | $ graphlog "log after first edit" |
|
154 | 156 | % log after first edit |
|
155 | o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | |
|
157 | @ 6 e5ae3ca2f1ffdbd89ec41ebc273a231f7c3022f2 "d" | |
|
156 | 158 | | |
|
157 | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | |
|
158 | | | |
|
159 | @ 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" | |
|
160 | | | |
|
159 | | o 5 652413bf663ef2a641cab26574e46d5f5a64a55a "f" | |
|
160 | | | | |
|
161 | | o 4 e860deea161a2f77de56603b340ebbb4536308ae "e" | |
|
162 | | | | |
|
163 | | o 3 055a42cdd88768532f9cf79daa407fc8d138de9b "d" | |
|
164 | |/ | |
|
161 | 165 | o 2 177f92b773850b59254aa5e923436f921b55483b "c" |
|
162 | 166 | | |
|
163 | 167 | o 1 d2ae7f538514cd87c17547b0de4cea71fe1af9fb "b" |
@@ -174,13 +174,13 b' just continue this time' | |||
|
174 | 174 | |
|
175 | 175 | log after edit |
|
176 | 176 | $ hg log --graph |
|
177 |
@ changeset: 6: |
|
|
177 | @ changeset: 6:7efe1373e4bc | |
|
178 | 178 | | tag: tip |
|
179 | 179 | | user: test |
|
180 | 180 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
181 | 181 | | summary: f |
|
182 | 182 | | |
|
183 |
o changeset: 5: |
|
|
183 | o changeset: 5:e334d87a1e55 | |
|
184 | 184 | | user: test |
|
185 | 185 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
186 | 186 | | summary: does not commute with e |
@@ -255,13 +255,13 b' second edit also fails, but just continu' | |||
|
255 | 255 | |
|
256 | 256 | post message fix |
|
257 | 257 | $ hg log --graph |
|
258 |
@ changeset: 6: |
|
|
258 | @ changeset: 6:521c4c32c5e2 | |
|
259 | 259 | | tag: tip |
|
260 | 260 | | user: test |
|
261 | 261 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
262 | 262 | | summary: f |
|
263 | 263 | | |
|
264 |
o changeset: 5: |
|
|
264 | o changeset: 5:f4f088e8adf6 | |
|
265 | 265 | | user: test |
|
266 | 266 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
267 | 267 | | summary: pick 65a9a84f33fd 3 c |
@@ -66,13 +66,13 b' Enable obsolete' | |||
|
66 | 66 | > pick 652413bf663e 5 f |
|
67 | 67 | > EOF |
|
68 | 68 | $ hg histedit 1 --commands commands.txt --verbose | grep histedit |
|
69 |
saved backup bundle to $TESTTMP/base/.hg/strip-backup/ |
|
|
69 | saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-backup.hg (glob) | |
|
70 | 70 | $ hg log --graph --hidden |
|
71 |
@ 8: |
|
|
71 | @ 8:cacdfd884a93 f | |
|
72 | 72 | | |
|
73 | o 7:ae467701c500 d | |
|
73 | o 7:59d9f330561f d | |
|
74 | 74 | | |
|
75 | o 6:d36c0562f908 c | |
|
75 | o 6:b346ab9a313d c | |
|
76 | 76 | | |
|
77 | 77 | | x 5:652413bf663e f |
|
78 | 78 | | | |
@@ -88,10 +88,10 b' Enable obsolete' | |||
|
88 | 88 | |
|
89 | 89 | $ hg debugobsolete |
|
90 | 90 | d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '* *', 'user': 'test'} (glob) |
|
91 |
177f92b773850b59254aa5e923436f921b55483b |
|
|
92 |
055a42cdd88768532f9cf79daa407fc8d138de9b |
|
|
93 |
e860deea161a2f77de56603b340ebbb4536308ae |
|
|
94 |
652413bf663ef2a641cab26574e46d5f5a64a55a |
|
|
91 | 177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 {'date': '* *', 'user': 'test'} (glob) | |
|
92 | 055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 {'date': '* *', 'user': 'test'} (glob) | |
|
93 | e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 {'date': '* *', 'user': 'test'} (glob) | |
|
94 | 652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 {'date': '* *', 'user': 'test'} (glob) | |
|
95 | 95 | |
|
96 | 96 | |
|
97 | 97 | Ensure hidden revision does not prevent histedit |
@@ -100,25 +100,25 b' Ensure hidden revision does not prevent ' | |||
|
100 | 100 | create an hidden revision |
|
101 | 101 | |
|
102 | 102 | $ cat > commands.txt <<EOF |
|
103 | > pick d36c0562f908 6 c | |
|
104 |
> drop |
|
|
105 |
> pick |
|
|
103 | > pick b346ab9a313d 6 c | |
|
104 | > drop 59d9f330561f 7 d | |
|
105 | > pick cacdfd884a93 8 f | |
|
106 | 106 | > EOF |
|
107 | 107 | $ hg histedit 6 --commands commands.txt |
|
108 | 108 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
109 | 109 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
110 | 110 | $ hg log --graph |
|
111 |
@ 9: |
|
|
111 | @ 9:c13eb81022ca f | |
|
112 | 112 | | |
|
113 | o 6:d36c0562f908 c | |
|
113 | o 6:b346ab9a313d c | |
|
114 | 114 | | |
|
115 | 115 | o 0:cb9a9f314b8b a |
|
116 | 116 | |
|
117 | 117 | check hidden revision are ignored (6 have hidden children 7 and 8) |
|
118 | 118 | |
|
119 | 119 | $ cat > commands.txt <<EOF |
|
120 | > pick d36c0562f908 6 c | |
|
121 |
> pick |
|
|
120 | > pick b346ab9a313d 6 c | |
|
121 | > pick c13eb81022ca 8 f | |
|
122 | 122 | > EOF |
|
123 | 123 | $ hg histedit 6 --commands commands.txt |
|
124 | 124 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -130,9 +130,9 b' Check that histedit respect phases' | |||
|
130 | 130 | (not directly related to the test file but doesn't deserve it's own test case) |
|
131 | 131 | |
|
132 | 132 | $ hg log -G |
|
133 |
@ 9: |
|
|
133 | @ 9:c13eb81022ca f | |
|
134 | 134 | | |
|
135 | o 6:d36c0562f908 c | |
|
135 | o 6:b346ab9a313d c | |
|
136 | 136 | | |
|
137 | 137 | o 0:cb9a9f314b8b a |
|
138 | 138 | |
@@ -150,6 +150,6 b' Test that rewriting leaving instability ' | |||
|
150 | 150 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
151 | 151 | $ hg phase --force --draft . |
|
152 | 152 | $ hg log -r 'children(.)' |
|
153 |
9: |
|
|
153 | 9:c13eb81022ca f (no-eol) | |
|
154 | 154 | $ hg histedit -r '.' |
|
155 | 155 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
General Comments 0
You need to be logged in to leave comments.
Login now