Show More
@@ -1,1407 +1,1460 b'' | |||
|
1 | 1 | $ echo "[extensions]" >> $HGRCPATH |
|
2 | 2 | $ echo "strip=" >> $HGRCPATH |
|
3 | 3 | $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH |
|
4 | 4 | |
|
5 | 5 | $ restore() { |
|
6 | 6 | > hg unbundle -q .hg/strip-backup/* |
|
7 | 7 | > rm .hg/strip-backup/* |
|
8 | 8 | > } |
|
9 | 9 | $ teststrip() { |
|
10 | 10 | > hg up -C $1 |
|
11 | 11 | > echo % before update $1, strip $2 |
|
12 | 12 | > hg log -G -T '{rev}:{node}' |
|
13 | 13 | > hg --traceback strip $2 |
|
14 | 14 | > echo % after update $1, strip $2 |
|
15 | 15 | > hg log -G -T '{rev}:{node}' |
|
16 | 16 | > restore |
|
17 | 17 | > } |
|
18 | 18 | |
|
19 | 19 | $ hg init test |
|
20 | 20 | $ cd test |
|
21 | 21 | |
|
22 | 22 | $ echo foo > bar |
|
23 | 23 | $ hg ci -Ama |
|
24 | 24 | adding bar |
|
25 | 25 | |
|
26 | 26 | $ echo more >> bar |
|
27 | 27 | $ hg ci -Amb |
|
28 | 28 | |
|
29 | 29 | $ echo blah >> bar |
|
30 | 30 | $ hg ci -Amc |
|
31 | 31 | |
|
32 | 32 | $ hg up 1 |
|
33 | 33 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
34 | 34 | $ echo blah >> bar |
|
35 | 35 | $ hg ci -Amd |
|
36 | 36 | created new head |
|
37 | 37 | |
|
38 | 38 | $ echo final >> bar |
|
39 | 39 | $ hg ci -Ame |
|
40 | 40 | |
|
41 | 41 | $ hg log |
|
42 | 42 | changeset: 4:443431ffac4f |
|
43 | 43 | tag: tip |
|
44 | 44 | user: test |
|
45 | 45 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
46 | 46 | summary: e |
|
47 | 47 | |
|
48 | 48 | changeset: 3:65bd5f99a4a3 |
|
49 | 49 | parent: 1:ef3a871183d7 |
|
50 | 50 | user: test |
|
51 | 51 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
52 | 52 | summary: d |
|
53 | 53 | |
|
54 | 54 | changeset: 2:264128213d29 |
|
55 | 55 | user: test |
|
56 | 56 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
57 | 57 | summary: c |
|
58 | 58 | |
|
59 | 59 | changeset: 1:ef3a871183d7 |
|
60 | 60 | user: test |
|
61 | 61 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
62 | 62 | summary: b |
|
63 | 63 | |
|
64 | 64 | changeset: 0:9ab35a2d17cb |
|
65 | 65 | user: test |
|
66 | 66 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
67 | 67 | summary: a |
|
68 | 68 | |
|
69 | 69 | |
|
70 | 70 | $ teststrip 4 4 |
|
71 | 71 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
72 | 72 | % before update 4, strip 4 |
|
73 | 73 | @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
74 | 74 | | |
|
75 | 75 | o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
76 | 76 | | |
|
77 | 77 | | o 2:264128213d290d868c54642d13aeaa3675551a78 |
|
78 | 78 | |/ |
|
79 | 79 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
80 | 80 | | |
|
81 | 81 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
82 | 82 | |
|
83 | 83 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
84 | 84 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
85 | 85 | % after update 4, strip 4 |
|
86 | 86 | @ 3:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
87 | 87 | | |
|
88 | 88 | | o 2:264128213d290d868c54642d13aeaa3675551a78 |
|
89 | 89 | |/ |
|
90 | 90 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
91 | 91 | | |
|
92 | 92 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
93 | 93 | |
|
94 | 94 | $ teststrip 4 3 |
|
95 | 95 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
96 | 96 | % before update 4, strip 3 |
|
97 | 97 | @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
98 | 98 | | |
|
99 | 99 | o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
100 | 100 | | |
|
101 | 101 | | o 2:264128213d290d868c54642d13aeaa3675551a78 |
|
102 | 102 | |/ |
|
103 | 103 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
104 | 104 | | |
|
105 | 105 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
106 | 106 | |
|
107 | 107 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
108 | 108 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
109 | 109 | % after update 4, strip 3 |
|
110 | 110 | o 2:264128213d290d868c54642d13aeaa3675551a78 |
|
111 | 111 | | |
|
112 | 112 | @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
113 | 113 | | |
|
114 | 114 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
115 | 115 | |
|
116 | 116 | $ teststrip 1 4 |
|
117 | 117 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
118 | 118 | % before update 1, strip 4 |
|
119 | 119 | o 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
120 | 120 | | |
|
121 | 121 | o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
122 | 122 | | |
|
123 | 123 | | o 2:264128213d290d868c54642d13aeaa3675551a78 |
|
124 | 124 | |/ |
|
125 | 125 | @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
126 | 126 | | |
|
127 | 127 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
128 | 128 | |
|
129 | 129 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
130 | 130 | % after update 1, strip 4 |
|
131 | 131 | o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
132 | 132 | | |
|
133 | 133 | | o 2:264128213d290d868c54642d13aeaa3675551a78 |
|
134 | 134 | |/ |
|
135 | 135 | @ 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
136 | 136 | | |
|
137 | 137 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
138 | 138 | |
|
139 | 139 | $ teststrip 4 2 |
|
140 | 140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 141 | % before update 4, strip 2 |
|
142 | 142 | @ 4:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
143 | 143 | | |
|
144 | 144 | o 3:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
145 | 145 | | |
|
146 | 146 | | o 2:264128213d290d868c54642d13aeaa3675551a78 |
|
147 | 147 | |/ |
|
148 | 148 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
149 | 149 | | |
|
150 | 150 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
151 | 151 | |
|
152 | 152 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
153 | 153 | % after update 4, strip 2 |
|
154 | 154 | @ 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
155 | 155 | | |
|
156 | 156 | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
157 | 157 | | |
|
158 | 158 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
159 | 159 | | |
|
160 | 160 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
161 | 161 | |
|
162 | 162 | $ teststrip 4 1 |
|
163 | 163 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
164 | 164 | % before update 4, strip 1 |
|
165 | 165 | @ 4:264128213d290d868c54642d13aeaa3675551a78 |
|
166 | 166 | | |
|
167 | 167 | | o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
168 | 168 | | | |
|
169 | 169 | | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
170 | 170 | |/ |
|
171 | 171 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
172 | 172 | | |
|
173 | 173 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
174 | 174 | |
|
175 | 175 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
176 | 176 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
177 | 177 | % after update 4, strip 1 |
|
178 | 178 | @ 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
179 | 179 | |
|
180 | 180 | $ teststrip null 4 |
|
181 | 181 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
182 | 182 | % before update null, strip 4 |
|
183 | 183 | o 4:264128213d290d868c54642d13aeaa3675551a78 |
|
184 | 184 | | |
|
185 | 185 | | o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
186 | 186 | | | |
|
187 | 187 | | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
188 | 188 | |/ |
|
189 | 189 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
190 | 190 | | |
|
191 | 191 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
192 | 192 | |
|
193 | 193 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
194 | 194 | % after update null, strip 4 |
|
195 | 195 | o 3:443431ffac4f5b5a19b0b6c298a21b7ba736bcce |
|
196 | 196 | | |
|
197 | 197 | o 2:65bd5f99a4a376cdea23a1153f07856b0d881d64 |
|
198 | 198 | | |
|
199 | 199 | o 1:ef3a871183d7199c541cc140218298bbfcc6c28a |
|
200 | 200 | | |
|
201 | 201 | o 0:9ab35a2d17cb64271241ea881efcc19dd953215b |
|
202 | 202 | |
|
203 | 203 | |
|
204 | 204 | $ hg log |
|
205 | 205 | changeset: 4:264128213d29 |
|
206 | 206 | tag: tip |
|
207 | 207 | parent: 1:ef3a871183d7 |
|
208 | 208 | user: test |
|
209 | 209 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
210 | 210 | summary: c |
|
211 | 211 | |
|
212 | 212 | changeset: 3:443431ffac4f |
|
213 | 213 | user: test |
|
214 | 214 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
215 | 215 | summary: e |
|
216 | 216 | |
|
217 | 217 | changeset: 2:65bd5f99a4a3 |
|
218 | 218 | user: test |
|
219 | 219 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
220 | 220 | summary: d |
|
221 | 221 | |
|
222 | 222 | changeset: 1:ef3a871183d7 |
|
223 | 223 | user: test |
|
224 | 224 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
225 | 225 | summary: b |
|
226 | 226 | |
|
227 | 227 | changeset: 0:9ab35a2d17cb |
|
228 | 228 | user: test |
|
229 | 229 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
230 | 230 | summary: a |
|
231 | 231 | |
|
232 | 232 | $ hg up -C 4 |
|
233 | 233 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
234 | 234 | $ hg parents |
|
235 | 235 | changeset: 4:264128213d29 |
|
236 | 236 | tag: tip |
|
237 | 237 | parent: 1:ef3a871183d7 |
|
238 | 238 | user: test |
|
239 | 239 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
240 | 240 | summary: c |
|
241 | 241 | |
|
242 | 242 | |
|
243 | 243 | $ hg --traceback strip 4 |
|
244 | 244 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
245 | 245 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg |
|
246 | 246 | $ hg parents |
|
247 | 247 | changeset: 1:ef3a871183d7 |
|
248 | 248 | user: test |
|
249 | 249 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
250 | 250 | summary: b |
|
251 | 251 | |
|
252 | 252 | $ hg debugbundle .hg/strip-backup/* |
|
253 | 253 | Stream params: {Compression: BZ} |
|
254 | 254 | changegroup -- {nbchanges: 1, version: 02} (mandatory: True) |
|
255 | 255 | 264128213d290d868c54642d13aeaa3675551a78 |
|
256 | 256 | cache:rev-branch-cache -- {} (mandatory: False) |
|
257 | 257 | phase-heads -- {} (mandatory: True) |
|
258 | 258 | 264128213d290d868c54642d13aeaa3675551a78 draft |
|
259 | 259 | $ hg unbundle .hg/strip-backup/* |
|
260 | 260 | adding changesets |
|
261 | 261 | adding manifests |
|
262 | 262 | adding file changes |
|
263 | 263 | added 1 changesets with 0 changes to 1 files (+1 heads) |
|
264 | 264 | new changesets 264128213d29 (1 drafts) |
|
265 | 265 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
266 | 266 | $ rm .hg/strip-backup/* |
|
267 | 267 | $ hg log --graph |
|
268 | 268 | o changeset: 4:264128213d29 |
|
269 | 269 | | tag: tip |
|
270 | 270 | | parent: 1:ef3a871183d7 |
|
271 | 271 | | user: test |
|
272 | 272 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
273 | 273 | | summary: c |
|
274 | 274 | | |
|
275 | 275 | | o changeset: 3:443431ffac4f |
|
276 | 276 | | | user: test |
|
277 | 277 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
278 | 278 | | | summary: e |
|
279 | 279 | | | |
|
280 | 280 | | o changeset: 2:65bd5f99a4a3 |
|
281 | 281 | |/ user: test |
|
282 | 282 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
283 | 283 | | summary: d |
|
284 | 284 | | |
|
285 | 285 | @ changeset: 1:ef3a871183d7 |
|
286 | 286 | | user: test |
|
287 | 287 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
288 | 288 | | summary: b |
|
289 | 289 | | |
|
290 | 290 | o changeset: 0:9ab35a2d17cb |
|
291 | 291 | user: test |
|
292 | 292 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
293 | 293 | summary: a |
|
294 | 294 | |
|
295 | 295 | $ hg up -C 2 |
|
296 | 296 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
297 | 297 | $ hg merge 4 |
|
298 | 298 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
299 | 299 | (branch merge, don't forget to commit) |
|
300 | 300 | |
|
301 | 301 | before strip of merge parent |
|
302 | 302 | |
|
303 | 303 | $ hg parents |
|
304 | 304 | changeset: 2:65bd5f99a4a3 |
|
305 | 305 | user: test |
|
306 | 306 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
307 | 307 | summary: d |
|
308 | 308 | |
|
309 | 309 | changeset: 4:264128213d29 |
|
310 | 310 | tag: tip |
|
311 | 311 | parent: 1:ef3a871183d7 |
|
312 | 312 | user: test |
|
313 | 313 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
314 | 314 | summary: c |
|
315 | 315 | |
|
316 | 316 | ##strip not allowed with merge in progress |
|
317 | 317 | $ hg strip 4 |
|
318 | 318 | abort: outstanding uncommitted merge |
|
319 | 319 | (use 'hg commit' or 'hg merge --abort') |
|
320 | 320 | [255] |
|
321 | 321 | ##strip allowed --force with merge in progress |
|
322 | 322 | $ hg strip 4 --force |
|
323 | 323 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
324 | 324 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
325 | 325 | |
|
326 | 326 | after strip of merge parent |
|
327 | 327 | |
|
328 | 328 | $ hg parents |
|
329 | 329 | changeset: 1:ef3a871183d7 |
|
330 | 330 | user: test |
|
331 | 331 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
332 | 332 | summary: b |
|
333 | 333 | |
|
334 | 334 | $ restore |
|
335 | 335 | |
|
336 | 336 | $ hg up |
|
337 | 337 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
338 | 338 | updated to "264128213d29: c" |
|
339 | 339 | 1 other heads for branch "default" |
|
340 | 340 | $ hg log -G |
|
341 | 341 | @ changeset: 4:264128213d29 |
|
342 | 342 | | tag: tip |
|
343 | 343 | | parent: 1:ef3a871183d7 |
|
344 | 344 | | user: test |
|
345 | 345 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
346 | 346 | | summary: c |
|
347 | 347 | | |
|
348 | 348 | | o changeset: 3:443431ffac4f |
|
349 | 349 | | | user: test |
|
350 | 350 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
351 | 351 | | | summary: e |
|
352 | 352 | | | |
|
353 | 353 | | o changeset: 2:65bd5f99a4a3 |
|
354 | 354 | |/ user: test |
|
355 | 355 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
356 | 356 | | summary: d |
|
357 | 357 | | |
|
358 | 358 | o changeset: 1:ef3a871183d7 |
|
359 | 359 | | user: test |
|
360 | 360 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
361 | 361 | | summary: b |
|
362 | 362 | | |
|
363 | 363 | o changeset: 0:9ab35a2d17cb |
|
364 | 364 | user: test |
|
365 | 365 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
366 | 366 | summary: a |
|
367 | 367 | |
|
368 | 368 | |
|
369 | 369 | 2 is parent of 3, only one strip should happen |
|
370 | 370 | |
|
371 | 371 | $ hg strip "roots(2)" 3 |
|
372 | 372 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
373 | 373 | $ hg log -G |
|
374 | 374 | @ changeset: 2:264128213d29 |
|
375 | 375 | | tag: tip |
|
376 | 376 | | user: test |
|
377 | 377 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
378 | 378 | | summary: c |
|
379 | 379 | | |
|
380 | 380 | o changeset: 1:ef3a871183d7 |
|
381 | 381 | | user: test |
|
382 | 382 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
383 | 383 | | summary: b |
|
384 | 384 | | |
|
385 | 385 | o changeset: 0:9ab35a2d17cb |
|
386 | 386 | user: test |
|
387 | 387 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
388 | 388 | summary: a |
|
389 | 389 | |
|
390 | 390 | $ restore |
|
391 | 391 | $ hg log -G |
|
392 | 392 | o changeset: 4:443431ffac4f |
|
393 | 393 | | tag: tip |
|
394 | 394 | | user: test |
|
395 | 395 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
396 | 396 | | summary: e |
|
397 | 397 | | |
|
398 | 398 | o changeset: 3:65bd5f99a4a3 |
|
399 | 399 | | parent: 1:ef3a871183d7 |
|
400 | 400 | | user: test |
|
401 | 401 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
402 | 402 | | summary: d |
|
403 | 403 | | |
|
404 | 404 | | @ changeset: 2:264128213d29 |
|
405 | 405 | |/ user: test |
|
406 | 406 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
407 | 407 | | summary: c |
|
408 | 408 | | |
|
409 | 409 | o changeset: 1:ef3a871183d7 |
|
410 | 410 | | user: test |
|
411 | 411 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
412 | 412 | | summary: b |
|
413 | 413 | | |
|
414 | 414 | o changeset: 0:9ab35a2d17cb |
|
415 | 415 | user: test |
|
416 | 416 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
417 | 417 | summary: a |
|
418 | 418 | |
|
419 | 419 | Failed hook while applying "saveheads" bundle. |
|
420 | 420 | |
|
421 | 421 | $ hg strip 2 --config hooks.pretxnchangegroup.bad=false |
|
422 | 422 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
423 | 423 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
424 | 424 | transaction abort! |
|
425 | 425 | rollback completed |
|
426 | 426 | strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob) |
|
427 | 427 | strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob) |
|
428 | 428 | (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob) |
|
429 | 429 | abort: pretxnchangegroup.bad hook exited with status 1 |
|
430 | 430 | [255] |
|
431 | 431 | $ restore |
|
432 | 432 | $ hg log -G |
|
433 | 433 | o changeset: 4:443431ffac4f |
|
434 | 434 | | tag: tip |
|
435 | 435 | | user: test |
|
436 | 436 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
437 | 437 | | summary: e |
|
438 | 438 | | |
|
439 | 439 | o changeset: 3:65bd5f99a4a3 |
|
440 | 440 | | parent: 1:ef3a871183d7 |
|
441 | 441 | | user: test |
|
442 | 442 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
443 | 443 | | summary: d |
|
444 | 444 | | |
|
445 | 445 | | o changeset: 2:264128213d29 |
|
446 | 446 | |/ user: test |
|
447 | 447 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
448 | 448 | | summary: c |
|
449 | 449 | | |
|
450 | 450 | @ changeset: 1:ef3a871183d7 |
|
451 | 451 | | user: test |
|
452 | 452 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
453 | 453 | | summary: b |
|
454 | 454 | | |
|
455 | 455 | o changeset: 0:9ab35a2d17cb |
|
456 | 456 | user: test |
|
457 | 457 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
458 | 458 | summary: a |
|
459 | 459 | |
|
460 | 460 | |
|
461 | 461 | 2 different branches: 2 strips |
|
462 | 462 | |
|
463 | 463 | $ hg strip 2 4 |
|
464 | 464 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
465 | 465 | $ hg log -G |
|
466 | 466 | o changeset: 2:65bd5f99a4a3 |
|
467 | 467 | | tag: tip |
|
468 | 468 | | user: test |
|
469 | 469 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
470 | 470 | | summary: d |
|
471 | 471 | | |
|
472 | 472 | @ changeset: 1:ef3a871183d7 |
|
473 | 473 | | user: test |
|
474 | 474 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
475 | 475 | | summary: b |
|
476 | 476 | | |
|
477 | 477 | o changeset: 0:9ab35a2d17cb |
|
478 | 478 | user: test |
|
479 | 479 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
480 | 480 | summary: a |
|
481 | 481 | |
|
482 | 482 | $ restore |
|
483 | 483 | |
|
484 | 484 | 2 different branches and a common ancestor: 1 strip |
|
485 | 485 | |
|
486 | 486 | $ hg strip 1 "2|4" |
|
487 | 487 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
488 | 488 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
489 | 489 | $ restore |
|
490 | 490 | |
|
491 | 491 | verify fncache is kept up-to-date |
|
492 | 492 | |
|
493 | 493 | $ touch a |
|
494 | 494 | $ hg ci -qAm a |
|
495 | 495 | #if repofncache |
|
496 | 496 | $ cat .hg/store/fncache | sort |
|
497 | 497 | data/a.i |
|
498 | 498 | data/bar.i |
|
499 | 499 | #endif |
|
500 | 500 | |
|
501 | 501 | $ hg strip tip |
|
502 | 502 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
503 | 503 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
504 | 504 | #if repofncache |
|
505 | 505 | $ cat .hg/store/fncache |
|
506 | 506 | data/bar.i |
|
507 | 507 | #endif |
|
508 | 508 | |
|
509 | 509 | stripping an empty revset |
|
510 | 510 | |
|
511 | 511 | $ hg strip "1 and not 1" |
|
512 | 512 | abort: empty revision set |
|
513 | 513 | [255] |
|
514 | 514 | |
|
515 | 515 | remove branchy history for qimport tests |
|
516 | 516 | |
|
517 | 517 | $ hg strip 3 |
|
518 | 518 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
519 | 519 | |
|
520 | 520 | |
|
521 | 521 | strip of applied mq should cleanup status file |
|
522 | 522 | |
|
523 | 523 | $ echo "mq=" >> $HGRCPATH |
|
524 | 524 | $ hg up -C 3 |
|
525 | 525 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
526 | 526 | $ echo fooagain >> bar |
|
527 | 527 | $ hg ci -mf |
|
528 | 528 | $ hg qimport -r tip:2 |
|
529 | 529 | |
|
530 | 530 | applied patches before strip |
|
531 | 531 | |
|
532 | 532 | $ hg qapplied |
|
533 | 533 | d |
|
534 | 534 | e |
|
535 | 535 | f |
|
536 | 536 | |
|
537 | 537 | stripping revision in queue |
|
538 | 538 | |
|
539 | 539 | $ hg strip 3 |
|
540 | 540 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
541 | 541 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
542 | 542 | |
|
543 | 543 | applied patches after stripping rev in queue |
|
544 | 544 | |
|
545 | 545 | $ hg qapplied |
|
546 | 546 | d |
|
547 | 547 | |
|
548 | 548 | stripping ancestor of queue |
|
549 | 549 | |
|
550 | 550 | $ hg strip 1 |
|
551 | 551 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
552 | 552 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
553 | 553 | |
|
554 | 554 | applied patches after stripping ancestor of queue |
|
555 | 555 | |
|
556 | 556 | $ hg qapplied |
|
557 | 557 | |
|
558 | 558 | Verify strip protects against stripping wc parent when there are uncommitted mods |
|
559 | 559 | |
|
560 | 560 | $ echo b > b |
|
561 | 561 | $ echo bb > bar |
|
562 | 562 | $ hg add b |
|
563 | 563 | $ hg ci -m 'b' |
|
564 | 564 | $ hg log --graph |
|
565 | 565 | @ changeset: 1:76dcf9fab855 |
|
566 | 566 | | tag: tip |
|
567 | 567 | | user: test |
|
568 | 568 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
569 | 569 | | summary: b |
|
570 | 570 | | |
|
571 | 571 | o changeset: 0:9ab35a2d17cb |
|
572 | 572 | user: test |
|
573 | 573 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
574 | 574 | summary: a |
|
575 | 575 | |
|
576 | 576 | $ hg up 0 |
|
577 | 577 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
578 | 578 | $ echo c > bar |
|
579 | 579 | $ hg up -t false |
|
580 | 580 | merging bar |
|
581 | 581 | merging bar failed! |
|
582 | 582 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
583 | 583 | use 'hg resolve' to retry unresolved file merges |
|
584 | 584 | [1] |
|
585 | 585 | $ hg sum |
|
586 | 586 | parent: 1:76dcf9fab855 tip |
|
587 | 587 | b |
|
588 | 588 | branch: default |
|
589 | 589 | commit: 1 modified, 1 unknown, 1 unresolved |
|
590 | 590 | update: (current) |
|
591 | 591 | phases: 2 draft |
|
592 | 592 | mq: 3 unapplied |
|
593 | 593 | |
|
594 | 594 | $ hg log --graph |
|
595 | 595 | @ changeset: 1:76dcf9fab855 |
|
596 | 596 | | tag: tip |
|
597 | 597 | | user: test |
|
598 | 598 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
599 | 599 | | summary: b |
|
600 | 600 | | |
|
601 | 601 | % changeset: 0:9ab35a2d17cb |
|
602 | 602 | user: test |
|
603 | 603 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
604 | 604 | summary: a |
|
605 | 605 | |
|
606 | 606 | $ echo c > b |
|
607 | 607 | $ hg strip tip |
|
608 | 608 | abort: uncommitted changes |
|
609 | 609 | [255] |
|
610 | 610 | $ hg strip tip --keep |
|
611 | 611 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
612 | 612 | $ hg log --graph |
|
613 | 613 | @ changeset: 0:9ab35a2d17cb |
|
614 | 614 | tag: tip |
|
615 | 615 | user: test |
|
616 | 616 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
617 | 617 | summary: a |
|
618 | 618 | |
|
619 | 619 | $ hg status |
|
620 | 620 | M bar |
|
621 | 621 | ? b |
|
622 | 622 | ? bar.orig |
|
623 | 623 | |
|
624 | 624 | $ rm bar.orig |
|
625 | 625 | $ hg sum |
|
626 | 626 | parent: 0:9ab35a2d17cb tip |
|
627 | 627 | a |
|
628 | 628 | branch: default |
|
629 | 629 | commit: 1 modified, 1 unknown |
|
630 | 630 | update: (current) |
|
631 | 631 | phases: 1 draft |
|
632 | 632 | mq: 3 unapplied |
|
633 | 633 | |
|
634 | 634 | Strip adds, removes, modifies with --keep |
|
635 | 635 | |
|
636 | 636 | $ touch b |
|
637 | 637 | $ hg add b |
|
638 | 638 | $ hg commit -mb |
|
639 | 639 | $ touch c |
|
640 | 640 | |
|
641 | 641 | ... with a clean working dir |
|
642 | 642 | |
|
643 | 643 | $ hg add c |
|
644 | 644 | $ hg rm bar |
|
645 | 645 | $ hg commit -mc |
|
646 | 646 | $ hg status |
|
647 | 647 | $ hg strip --keep tip |
|
648 | 648 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
649 | 649 | $ hg status |
|
650 | 650 | ! bar |
|
651 | 651 | ? c |
|
652 | 652 | |
|
653 | 653 | ... with a dirty working dir |
|
654 | 654 | |
|
655 | 655 | $ hg add c |
|
656 | 656 | $ hg rm bar |
|
657 | 657 | $ hg commit -mc |
|
658 | 658 | $ hg status |
|
659 | 659 | $ echo b > b |
|
660 | 660 | $ echo d > d |
|
661 | 661 | $ hg strip --keep tip |
|
662 | 662 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
663 | 663 | $ hg status |
|
664 | 664 | M b |
|
665 | 665 | ! bar |
|
666 | 666 | ? c |
|
667 | 667 | ? d |
|
668 | 668 | |
|
669 | 669 | ... after updating the dirstate |
|
670 | 670 | $ hg add c |
|
671 | 671 | $ hg commit -mc |
|
672 | 672 | $ hg rm c |
|
673 | 673 | $ hg commit -mc |
|
674 | 674 | $ hg strip --keep '.^' -q |
|
675 | 675 | $ cd .. |
|
676 | 676 | |
|
677 | 677 | stripping many nodes on a complex graph (issue3299) |
|
678 | 678 | |
|
679 | 679 | $ hg init issue3299 |
|
680 | 680 | $ cd issue3299 |
|
681 | 681 | $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a' |
|
682 | 682 | $ hg strip 'not ancestors(x)' |
|
683 | 683 | saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob) |
|
684 | 684 | |
|
685 | 685 | test hg strip -B bookmark |
|
686 | 686 | |
|
687 | 687 | $ cd .. |
|
688 | 688 | $ hg init bookmarks |
|
689 | 689 | $ cd bookmarks |
|
690 | 690 | $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f' |
|
691 | 691 | $ hg bookmark -r 'a' 'todelete' |
|
692 | 692 | $ hg bookmark -r 'b' 'B' |
|
693 | 693 | $ hg bookmark -r 'b' 'nostrip' |
|
694 | 694 | $ hg bookmark -r 'c' 'delete' |
|
695 | 695 | $ hg bookmark -r 'd' 'multipledelete1' |
|
696 | 696 | $ hg bookmark -r 'e' 'multipledelete2' |
|
697 | 697 | $ hg bookmark -r 'f' 'singlenode1' |
|
698 | 698 | $ hg bookmark -r 'f' 'singlenode2' |
|
699 | 699 | $ hg up -C todelete |
|
700 | 700 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
701 | 701 | (activating bookmark todelete) |
|
702 | 702 | $ hg strip -B nostrip |
|
703 | 703 | bookmark 'nostrip' deleted |
|
704 | 704 | abort: empty revision set |
|
705 | 705 | [255] |
|
706 | 706 | $ hg strip -B todelete |
|
707 | 707 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
708 | 708 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
709 | 709 | bookmark 'todelete' deleted |
|
710 | 710 | $ hg id -ir dcbb326fdec2 |
|
711 | 711 | abort: unknown revision 'dcbb326fdec2'! |
|
712 | 712 | [255] |
|
713 | 713 | $ hg id -ir d62d843c9a01 |
|
714 | 714 | d62d843c9a01 |
|
715 | 715 | $ hg bookmarks |
|
716 | 716 | B 9:ff43616e5d0f |
|
717 | 717 | delete 6:2702dd0c91e7 |
|
718 | 718 | multipledelete1 11:e46a4836065c |
|
719 | 719 | multipledelete2 12:b4594d867745 |
|
720 | 720 | singlenode1 13:43227190fef8 |
|
721 | 721 | singlenode2 13:43227190fef8 |
|
722 | 722 | $ hg strip -B multipledelete1 -B multipledelete2 |
|
723 | 723 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg |
|
724 | 724 | bookmark 'multipledelete1' deleted |
|
725 | 725 | bookmark 'multipledelete2' deleted |
|
726 | 726 | $ hg id -ir e46a4836065c |
|
727 | 727 | abort: unknown revision 'e46a4836065c'! |
|
728 | 728 | [255] |
|
729 | 729 | $ hg id -ir b4594d867745 |
|
730 | 730 | abort: unknown revision 'b4594d867745'! |
|
731 | 731 | [255] |
|
732 | 732 | $ hg strip -B singlenode1 -B singlenode2 |
|
733 | 733 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg |
|
734 | 734 | bookmark 'singlenode1' deleted |
|
735 | 735 | bookmark 'singlenode2' deleted |
|
736 | 736 | $ hg id -ir 43227190fef8 |
|
737 | 737 | abort: unknown revision '43227190fef8'! |
|
738 | 738 | [255] |
|
739 | 739 | $ hg strip -B unknownbookmark |
|
740 | 740 | abort: bookmark 'unknownbookmark' not found |
|
741 | 741 | [255] |
|
742 | 742 | $ hg strip -B unknownbookmark1 -B unknownbookmark2 |
|
743 | 743 | abort: bookmark 'unknownbookmark1,unknownbookmark2' not found |
|
744 | 744 | [255] |
|
745 | 745 | $ hg strip -B delete -B unknownbookmark |
|
746 | 746 | abort: bookmark 'unknownbookmark' not found |
|
747 | 747 | [255] |
|
748 | 748 | $ hg strip -B delete |
|
749 | 749 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
750 | 750 | bookmark 'delete' deleted |
|
751 | 751 | $ hg id -ir 6:2702dd0c91e7 |
|
752 | 752 | abort: unknown revision '2702dd0c91e7'! |
|
753 | 753 | [255] |
|
754 | 754 | $ hg update B |
|
755 | 755 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
756 | 756 | (activating bookmark B) |
|
757 | 757 | $ echo a > a |
|
758 | 758 | $ hg add a |
|
759 | 759 | $ hg strip -B B |
|
760 | 760 | abort: uncommitted changes |
|
761 | 761 | [255] |
|
762 | 762 | $ hg bookmarks |
|
763 | 763 | * B 6:ff43616e5d0f |
|
764 | 764 | |
|
765 | 765 | Make sure no one adds back a -b option: |
|
766 | 766 | |
|
767 | 767 | $ hg strip -b tip |
|
768 | 768 | hg strip: option -b not recognized |
|
769 | 769 | hg strip [-k] [-f] [-B bookmark] [-r] REV... |
|
770 | 770 | |
|
771 | 771 | strip changesets and all their descendants from the repository |
|
772 | 772 | |
|
773 | 773 | (use 'hg help -e strip' to show help for the strip extension) |
|
774 | 774 | |
|
775 | 775 | options ([+] can be repeated): |
|
776 | 776 | |
|
777 | 777 | -r --rev REV [+] strip specified revision (optional, can specify |
|
778 | 778 | revisions without this option) |
|
779 | 779 | -f --force force removal of changesets, discard uncommitted |
|
780 | 780 | changes (no backup) |
|
781 | 781 | --no-backup do not save backup bundle |
|
782 | 782 | -k --keep do not modify working directory during strip |
|
783 | 783 | -B --bookmark BOOKMARK [+] remove revs only reachable from given bookmark |
|
784 | 784 | --mq operate on patch repository |
|
785 | 785 | |
|
786 | 786 | (use 'hg strip -h' to show more help) |
|
787 | 787 | [255] |
|
788 | 788 | |
|
789 | 789 | $ cd .. |
|
790 | 790 | |
|
791 | 791 | Verify bundles don't get overwritten: |
|
792 | 792 | |
|
793 | 793 | $ hg init doublebundle |
|
794 | 794 | $ cd doublebundle |
|
795 | 795 | $ touch a |
|
796 | 796 | $ hg commit -Aqm a |
|
797 | 797 | $ touch b |
|
798 | 798 | $ hg commit -Aqm b |
|
799 | 799 | $ hg strip -r 0 |
|
800 | 800 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
801 | 801 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg |
|
802 | 802 | $ ls .hg/strip-backup |
|
803 | 803 | 3903775176ed-e68910bd-backup.hg |
|
804 | 804 | #if repobundlerepo |
|
805 | 805 | $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg |
|
806 | 806 | $ hg strip -r 0 |
|
807 | 807 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg |
|
808 | 808 | $ ls .hg/strip-backup |
|
809 | 809 | 3903775176ed-54390173-backup.hg |
|
810 | 810 | 3903775176ed-e68910bd-backup.hg |
|
811 | 811 | #endif |
|
812 | 812 | $ cd .. |
|
813 | 813 | |
|
814 | 814 | Test that we only bundle the stripped changesets (issue4736) |
|
815 | 815 | ------------------------------------------------------------ |
|
816 | 816 | |
|
817 | 817 | initialization (previous repo is empty anyway) |
|
818 | 818 | |
|
819 | 819 | $ hg init issue4736 |
|
820 | 820 | $ cd issue4736 |
|
821 | 821 | $ echo a > a |
|
822 | 822 | $ hg add a |
|
823 | 823 | $ hg commit -m commitA |
|
824 | 824 | $ echo b > b |
|
825 | 825 | $ hg add b |
|
826 | 826 | $ hg commit -m commitB |
|
827 | 827 | $ echo c > c |
|
828 | 828 | $ hg add c |
|
829 | 829 | $ hg commit -m commitC |
|
830 | 830 | $ hg up 'desc(commitB)' |
|
831 | 831 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
832 | 832 | $ echo d > d |
|
833 | 833 | $ hg add d |
|
834 | 834 | $ hg commit -m commitD |
|
835 | 835 | created new head |
|
836 | 836 | $ hg up 'desc(commitC)' |
|
837 | 837 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
838 | 838 | $ hg merge 'desc(commitD)' |
|
839 | 839 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
840 | 840 | (branch merge, don't forget to commit) |
|
841 | 841 | $ hg ci -m 'mergeCD' |
|
842 | 842 | $ hg log -G |
|
843 | 843 | @ changeset: 4:d8db9d137221 |
|
844 | 844 | |\ tag: tip |
|
845 | 845 | | | parent: 2:5c51d8d6557d |
|
846 | 846 | | | parent: 3:6625a5168474 |
|
847 | 847 | | | user: test |
|
848 | 848 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
849 | 849 | | | summary: mergeCD |
|
850 | 850 | | | |
|
851 | 851 | | o changeset: 3:6625a5168474 |
|
852 | 852 | | | parent: 1:eca11cf91c71 |
|
853 | 853 | | | user: test |
|
854 | 854 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
855 | 855 | | | summary: commitD |
|
856 | 856 | | | |
|
857 | 857 | o | changeset: 2:5c51d8d6557d |
|
858 | 858 | |/ user: test |
|
859 | 859 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
860 | 860 | | summary: commitC |
|
861 | 861 | | |
|
862 | 862 | o changeset: 1:eca11cf91c71 |
|
863 | 863 | | user: test |
|
864 | 864 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
865 | 865 | | summary: commitB |
|
866 | 866 | | |
|
867 | 867 | o changeset: 0:105141ef12d0 |
|
868 | 868 | user: test |
|
869 | 869 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
870 | 870 | summary: commitA |
|
871 | 871 | |
|
872 | 872 | |
|
873 | 873 | Check bundle behavior: |
|
874 | 874 | |
|
875 | 875 | $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg |
|
876 | 876 | 2 changesets found |
|
877 | 877 | #if repobundlerepo |
|
878 | 878 | $ hg log -r 'bundle()' -R ../issue4736.hg |
|
879 | 879 | changeset: 3:6625a5168474 |
|
880 | 880 | parent: 1:eca11cf91c71 |
|
881 | 881 | user: test |
|
882 | 882 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
883 | 883 | summary: commitD |
|
884 | 884 | |
|
885 | 885 | changeset: 4:d8db9d137221 |
|
886 | 886 | tag: tip |
|
887 | 887 | parent: 2:5c51d8d6557d |
|
888 | 888 | parent: 3:6625a5168474 |
|
889 | 889 | user: test |
|
890 | 890 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
891 | 891 | summary: mergeCD |
|
892 | 892 | |
|
893 | 893 | #endif |
|
894 | 894 | |
|
895 | 895 | check strip behavior |
|
896 | 896 | |
|
897 | 897 | $ hg --config extensions.strip= strip 'desc(commitD)' --debug |
|
898 | 898 | resolving manifests |
|
899 | 899 | branchmerge: False, force: True, partial: False |
|
900 | 900 | ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71 |
|
901 | 901 | c: other deleted -> r |
|
902 | 902 | removing c |
|
903 | 903 | d: other deleted -> r |
|
904 | 904 | removing d |
|
905 | 905 | starting 4 threads for background file closing (?) |
|
906 | 906 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
907 | 907 | 2 changesets found |
|
908 | 908 | list of changesets: |
|
909 | 909 | 6625a516847449b6f0fa3737b9ba56e9f0f3032c |
|
910 | 910 | d8db9d1372214336d2b5570f20ee468d2c72fa8b |
|
911 | 911 | bundle2-output-bundle: "HG20", (1 params) 3 parts total |
|
912 | 912 | bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
|
913 | 913 | bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload |
|
914 | 914 | bundle2-output-part: "phase-heads" 24 bytes payload |
|
915 | 915 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg |
|
916 | 916 | updating the branch cache |
|
917 | 917 | invalid branch cache (served): tip differs |
|
918 | 918 | $ hg log -G |
|
919 | 919 | o changeset: 2:5c51d8d6557d |
|
920 | 920 | | tag: tip |
|
921 | 921 | | user: test |
|
922 | 922 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
923 | 923 | | summary: commitC |
|
924 | 924 | | |
|
925 | 925 | @ changeset: 1:eca11cf91c71 |
|
926 | 926 | | user: test |
|
927 | 927 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
928 | 928 | | summary: commitB |
|
929 | 929 | | |
|
930 | 930 | o changeset: 0:105141ef12d0 |
|
931 | 931 | user: test |
|
932 | 932 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
933 | 933 | summary: commitA |
|
934 | 934 | |
|
935 | 935 | |
|
936 | 936 | strip backup content |
|
937 | 937 | |
|
938 | 938 | #if repobundlerepo |
|
939 | 939 | $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg |
|
940 | 940 | changeset: 3:6625a5168474 |
|
941 | 941 | parent: 1:eca11cf91c71 |
|
942 | 942 | user: test |
|
943 | 943 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
944 | 944 | summary: commitD |
|
945 | 945 | |
|
946 | 946 | changeset: 4:d8db9d137221 |
|
947 | 947 | tag: tip |
|
948 | 948 | parent: 2:5c51d8d6557d |
|
949 | 949 | parent: 3:6625a5168474 |
|
950 | 950 | user: test |
|
951 | 951 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
952 | 952 | summary: mergeCD |
|
953 | 953 | |
|
954 | 954 | |
|
955 | 955 | #endif |
|
956 | 956 | |
|
957 | 957 | Check that the phase cache is properly invalidated after a strip with bookmark. |
|
958 | 958 | |
|
959 | 959 | $ cat > ../stripstalephasecache.py << EOF |
|
960 | 960 | > from mercurial import extensions, localrepo |
|
961 | 961 | > def transactioncallback(orig, repo, desc, *args, **kwargs): |
|
962 | 962 | > def test(transaction): |
|
963 | 963 | > # observe cache inconsistency |
|
964 | 964 | > try: |
|
965 | 965 | > [repo.changelog.node(r) for r in repo.revs(b"not public()")] |
|
966 | 966 | > except IndexError: |
|
967 | 967 | > repo.ui.status(b"Index error!\n") |
|
968 | 968 | > transaction = orig(repo, desc, *args, **kwargs) |
|
969 | 969 | > # warm up the phase cache |
|
970 | 970 | > list(repo.revs(b"not public()")) |
|
971 | 971 | > if desc != b'strip': |
|
972 | 972 | > transaction.addpostclose(b"phase invalidation test", test) |
|
973 | 973 | > return transaction |
|
974 | 974 | > def extsetup(ui): |
|
975 | 975 | > extensions.wrapfunction(localrepo.localrepository, b"transaction", |
|
976 | 976 | > transactioncallback) |
|
977 | 977 | > EOF |
|
978 | 978 | $ hg up -C 2 |
|
979 | 979 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
980 | 980 | $ echo k > k |
|
981 | 981 | $ hg add k |
|
982 | 982 | $ hg commit -m commitK |
|
983 | 983 | $ echo l > l |
|
984 | 984 | $ hg add l |
|
985 | 985 | $ hg commit -m commitL |
|
986 | 986 | $ hg book -r tip blah |
|
987 | 987 | $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py |
|
988 | 988 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
989 | 989 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg |
|
990 | 990 | $ hg up -C 1 |
|
991 | 991 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
992 | 992 | |
|
993 | 993 | Error during post-close callback of the strip transaction |
|
994 | 994 | (They should be gracefully handled and reported) |
|
995 | 995 | |
|
996 | 996 | $ cat > ../crashstrip.py << EOF |
|
997 | 997 | > from mercurial import error |
|
998 | 998 | > def reposetup(ui, repo): |
|
999 | 999 | > class crashstriprepo(repo.__class__): |
|
1000 | 1000 | > def transaction(self, desc, *args, **kwargs): |
|
1001 | 1001 | > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs) |
|
1002 | 1002 | > if desc == b'strip': |
|
1003 | 1003 | > def crash(tra): raise error.Abort(b'boom') |
|
1004 | 1004 | > tr.addpostclose(b'crash', crash) |
|
1005 | 1005 | > return tr |
|
1006 | 1006 | > repo.__class__ = crashstriprepo |
|
1007 | 1007 | > EOF |
|
1008 | 1008 | $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py |
|
1009 | 1009 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg |
|
1010 | 1010 | strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' |
|
1011 | 1011 | abort: boom |
|
1012 | 1012 | [255] |
|
1013 | 1013 | |
|
1014 | 1014 | test stripping a working directory parent doesn't switch named branches |
|
1015 | 1015 | |
|
1016 | 1016 | $ hg log -G |
|
1017 | 1017 | @ changeset: 1:eca11cf91c71 |
|
1018 | 1018 | | tag: tip |
|
1019 | 1019 | | user: test |
|
1020 | 1020 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1021 | 1021 | | summary: commitB |
|
1022 | 1022 | | |
|
1023 | 1023 | o changeset: 0:105141ef12d0 |
|
1024 | 1024 | user: test |
|
1025 | 1025 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1026 | 1026 | summary: commitA |
|
1027 | 1027 | |
|
1028 | 1028 | |
|
1029 | 1029 | $ hg branch new-branch |
|
1030 | 1030 | marked working directory as branch new-branch |
|
1031 | 1031 | (branches are permanent and global, did you want a bookmark?) |
|
1032 | 1032 | $ hg ci -m "start new branch" |
|
1033 | 1033 | $ echo 'foo' > foo.txt |
|
1034 | 1034 | $ hg ci -Aqm foo |
|
1035 | 1035 | $ hg up default |
|
1036 | 1036 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1037 | 1037 | $ echo 'bar' > bar.txt |
|
1038 | 1038 | $ hg ci -Aqm bar |
|
1039 | 1039 | $ hg up new-branch |
|
1040 | 1040 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1041 | 1041 | $ hg merge default |
|
1042 | 1042 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1043 | 1043 | (branch merge, don't forget to commit) |
|
1044 | 1044 | $ hg log -G |
|
1045 | 1045 | @ changeset: 4:35358f982181 |
|
1046 | 1046 | | tag: tip |
|
1047 | 1047 | | parent: 1:eca11cf91c71 |
|
1048 | 1048 | | user: test |
|
1049 | 1049 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1050 | 1050 | | summary: bar |
|
1051 | 1051 | | |
|
1052 | 1052 | | @ changeset: 3:f62c6c09b707 |
|
1053 | 1053 | | | branch: new-branch |
|
1054 | 1054 | | | user: test |
|
1055 | 1055 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1056 | 1056 | | | summary: foo |
|
1057 | 1057 | | | |
|
1058 | 1058 | | o changeset: 2:b1d33a8cadd9 |
|
1059 | 1059 | |/ branch: new-branch |
|
1060 | 1060 | | user: test |
|
1061 | 1061 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1062 | 1062 | | summary: start new branch |
|
1063 | 1063 | | |
|
1064 | 1064 | o changeset: 1:eca11cf91c71 |
|
1065 | 1065 | | user: test |
|
1066 | 1066 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1067 | 1067 | | summary: commitB |
|
1068 | 1068 | | |
|
1069 | 1069 | o changeset: 0:105141ef12d0 |
|
1070 | 1070 | user: test |
|
1071 | 1071 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1072 | 1072 | summary: commitA |
|
1073 | 1073 | |
|
1074 | 1074 | |
|
1075 | 1075 | $ hg strip --force -r 35358f982181 |
|
1076 | 1076 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1077 | 1077 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-50d992d4-backup.hg |
|
1078 | 1078 | $ hg log -G |
|
1079 | 1079 | @ changeset: 3:f62c6c09b707 |
|
1080 | 1080 | | branch: new-branch |
|
1081 | 1081 | | tag: tip |
|
1082 | 1082 | | user: test |
|
1083 | 1083 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1084 | 1084 | | summary: foo |
|
1085 | 1085 | | |
|
1086 | 1086 | o changeset: 2:b1d33a8cadd9 |
|
1087 | 1087 | | branch: new-branch |
|
1088 | 1088 | | user: test |
|
1089 | 1089 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1090 | 1090 | | summary: start new branch |
|
1091 | 1091 | | |
|
1092 | 1092 | o changeset: 1:eca11cf91c71 |
|
1093 | 1093 | | user: test |
|
1094 | 1094 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1095 | 1095 | | summary: commitB |
|
1096 | 1096 | | |
|
1097 | 1097 | o changeset: 0:105141ef12d0 |
|
1098 | 1098 | user: test |
|
1099 | 1099 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1100 | 1100 | summary: commitA |
|
1101 | 1101 | |
|
1102 | 1102 | |
|
1103 | 1103 | $ hg up default |
|
1104 | 1104 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1105 | 1105 | $ echo 'bar' > bar.txt |
|
1106 | 1106 | $ hg ci -Aqm bar |
|
1107 | 1107 | $ hg up new-branch |
|
1108 | 1108 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1109 | 1109 | $ hg merge default |
|
1110 | 1110 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1111 | 1111 | (branch merge, don't forget to commit) |
|
1112 | 1112 | $ hg ci -m merge |
|
1113 | 1113 | $ hg log -G |
|
1114 | 1114 | @ changeset: 5:4cf5e92caec2 |
|
1115 | 1115 | |\ branch: new-branch |
|
1116 | 1116 | | | tag: tip |
|
1117 | 1117 | | | parent: 3:f62c6c09b707 |
|
1118 | 1118 | | | parent: 4:35358f982181 |
|
1119 | 1119 | | | user: test |
|
1120 | 1120 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1121 | 1121 | | | summary: merge |
|
1122 | 1122 | | | |
|
1123 | 1123 | | o changeset: 4:35358f982181 |
|
1124 | 1124 | | | parent: 1:eca11cf91c71 |
|
1125 | 1125 | | | user: test |
|
1126 | 1126 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1127 | 1127 | | | summary: bar |
|
1128 | 1128 | | | |
|
1129 | 1129 | o | changeset: 3:f62c6c09b707 |
|
1130 | 1130 | | | branch: new-branch |
|
1131 | 1131 | | | user: test |
|
1132 | 1132 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1133 | 1133 | | | summary: foo |
|
1134 | 1134 | | | |
|
1135 | 1135 | o | changeset: 2:b1d33a8cadd9 |
|
1136 | 1136 | |/ branch: new-branch |
|
1137 | 1137 | | user: test |
|
1138 | 1138 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1139 | 1139 | | summary: start new branch |
|
1140 | 1140 | | |
|
1141 | 1141 | o changeset: 1:eca11cf91c71 |
|
1142 | 1142 | | user: test |
|
1143 | 1143 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1144 | 1144 | | summary: commitB |
|
1145 | 1145 | | |
|
1146 | 1146 | o changeset: 0:105141ef12d0 |
|
1147 | 1147 | user: test |
|
1148 | 1148 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1149 | 1149 | summary: commitA |
|
1150 | 1150 | |
|
1151 | 1151 | |
|
1152 | 1152 | $ hg strip -r 35358f982181 |
|
1153 | 1153 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1154 | 1154 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg |
|
1155 | 1155 | $ hg log -G |
|
1156 | 1156 | @ changeset: 3:f62c6c09b707 |
|
1157 | 1157 | | branch: new-branch |
|
1158 | 1158 | | tag: tip |
|
1159 | 1159 | | user: test |
|
1160 | 1160 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1161 | 1161 | | summary: foo |
|
1162 | 1162 | | |
|
1163 | 1163 | o changeset: 2:b1d33a8cadd9 |
|
1164 | 1164 | | branch: new-branch |
|
1165 | 1165 | | user: test |
|
1166 | 1166 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1167 | 1167 | | summary: start new branch |
|
1168 | 1168 | | |
|
1169 | 1169 | o changeset: 1:eca11cf91c71 |
|
1170 | 1170 | | user: test |
|
1171 | 1171 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1172 | 1172 | | summary: commitB |
|
1173 | 1173 | | |
|
1174 | 1174 | o changeset: 0:105141ef12d0 |
|
1175 | 1175 | user: test |
|
1176 | 1176 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1177 | 1177 | summary: commitA |
|
1178 | 1178 | |
|
1179 | 1179 | |
|
1180 | stripping a set containing a merge properly reset file content, including items on other branches | |
|
1181 | ||
|
1182 | BROKEN, The added file should move to unknown, which is the behavior we have been seeing for other `hg strip --keep` call. | |
|
1183 | ||
|
1180 | 1184 | $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg |
|
1181 | 1185 | adding changesets |
|
1182 | 1186 | adding manifests |
|
1183 | 1187 | adding file changes |
|
1184 | 1188 | added 2 changesets with 1 changes to 1 files |
|
1185 | 1189 | new changesets 35358f982181:4cf5e92caec2 (2 drafts) |
|
1186 | 1190 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1187 | 1191 | |
|
1192 | $ hg id | |
|
1193 | 4cf5e92caec2 (new-branch) tip | |
|
1194 | $ hg status --rev "f62c6c09b707" | |
|
1195 | A bar.txt | |
|
1196 | $ hg diff --rev "f62c6c09b707" | |
|
1197 | diff -r f62c6c09b707 bar.txt | |
|
1198 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
1199 | +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 | |
|
1200 | @@ -0,0 +1,1 @@ | |
|
1201 | +bar | |
|
1202 | $ hg log -G -v --rev 35358f982181:: --patch | |
|
1203 | @ changeset: 5:4cf5e92caec2 | |
|
1204 | |\ branch: new-branch | |
|
1205 | | ~ tag: tip | |
|
1206 | | parent: 3:f62c6c09b707 | |
|
1207 | | parent: 4:35358f982181 | |
|
1208 | | user: test | |
|
1209 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
1210 | | description: | |
|
1211 | | merge | |
|
1212 | | | |
|
1213 | | | |
|
1214 | | diff -r f62c6c09b707 -r 4cf5e92caec2 bar.txt | |
|
1215 | | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
1216 | | +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 | |
|
1217 | | @@ -0,0 +1,1 @@ | |
|
1218 | | +bar | |
|
1219 | | | |
|
1220 | o changeset: 4:35358f982181 | |
|
1221 | | parent: 1:eca11cf91c71 | |
|
1222 | ~ user: test | |
|
1223 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
1224 | files: bar.txt | |
|
1225 | description: | |
|
1226 | bar | |
|
1227 | ||
|
1228 | ||
|
1229 | diff -r eca11cf91c71 -r 35358f982181 bar.txt | |
|
1230 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
1231 | +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 | |
|
1232 | @@ -0,0 +1,1 @@ | |
|
1233 | +bar | |
|
1234 | ||
|
1235 | ||
|
1188 | 1236 | $ hg strip -k -r 35358f982181 |
|
1189 | 1237 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg |
|
1190 | 1238 | $ hg log -G |
|
1191 | 1239 | @ changeset: 3:f62c6c09b707 |
|
1192 | 1240 | | branch: new-branch |
|
1193 | 1241 | | tag: tip |
|
1194 | 1242 | | user: test |
|
1195 | 1243 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1196 | 1244 | | summary: foo |
|
1197 | 1245 | | |
|
1198 | 1246 | o changeset: 2:b1d33a8cadd9 |
|
1199 | 1247 | | branch: new-branch |
|
1200 | 1248 | | user: test |
|
1201 | 1249 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1202 | 1250 | | summary: start new branch |
|
1203 | 1251 | | |
|
1204 | 1252 | o changeset: 1:eca11cf91c71 |
|
1205 | 1253 | | user: test |
|
1206 | 1254 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1207 | 1255 | | summary: commitB |
|
1208 | 1256 | | |
|
1209 | 1257 | o changeset: 0:105141ef12d0 |
|
1210 | 1258 | user: test |
|
1211 | 1259 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1212 | 1260 | summary: commitA |
|
1213 | 1261 | |
|
1214 | $ hg diff | |
|
1215 | diff -r f62c6c09b707 bar.txt | |
|
1216 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
1217 | +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000 | |
|
1218 | @@ -0,0 +1,1 @@ | |
|
1219 | +bar | |
|
1262 | ||
|
1263 | BROKEN: 'bar.txt' cannot possibly be clean since it is not part of the current | |
|
1264 | working copy parents. | |
|
1265 | ||
|
1266 | $ hg status -A | |
|
1267 | C a | |
|
1268 | C b | |
|
1269 | C bar.txt | |
|
1270 | C foo.txt | |
|
1271 | $ cat bar.txt | |
|
1272 | bar | |
|
1220 | 1273 | |
|
1221 | 1274 | Use delayedstrip to strip inside a transaction |
|
1222 | 1275 | |
|
1223 | 1276 | $ cd $TESTTMP |
|
1224 | 1277 | $ hg init delayedstrip |
|
1225 | 1278 | $ cd delayedstrip |
|
1226 | 1279 | $ hg debugdrawdag <<'EOS' |
|
1227 | 1280 | > D |
|
1228 | 1281 | > | |
|
1229 | 1282 | > C F H # Commit on top of "I", |
|
1230 | 1283 | > | |/| # Strip B+D+I+E+G+H+Z |
|
1231 | 1284 | > I B E G |
|
1232 | 1285 | > \|/ |
|
1233 | 1286 | > A Z |
|
1234 | 1287 | > EOS |
|
1235 | 1288 | $ cp -R . ../scmutilcleanup |
|
1236 | 1289 | |
|
1237 | 1290 | $ hg up -C I |
|
1238 | 1291 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1239 | 1292 | $ echo 3 >> I |
|
1240 | 1293 | $ cat > $TESTTMP/delayedstrip.py <<EOF |
|
1241 | 1294 | > from __future__ import absolute_import |
|
1242 | 1295 | > from mercurial import commands, registrar, repair |
|
1243 | 1296 | > cmdtable = {} |
|
1244 | 1297 | > command = registrar.command(cmdtable) |
|
1245 | 1298 | > @command(b'testdelayedstrip') |
|
1246 | 1299 | > def testdelayedstrip(ui, repo): |
|
1247 | 1300 | > def getnodes(expr): |
|
1248 | 1301 | > return [repo.changelog.node(r) for r in repo.revs(expr)] |
|
1249 | 1302 | > with repo.wlock(): |
|
1250 | 1303 | > with repo.lock(): |
|
1251 | 1304 | > with repo.transaction(b'delayedstrip'): |
|
1252 | 1305 | > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J') |
|
1253 | 1306 | > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I') |
|
1254 | 1307 | > commands.commit(ui, repo, message=b'J', date=b'0 0') |
|
1255 | 1308 | > EOF |
|
1256 | 1309 | $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py |
|
1257 | 1310 | warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22 |
|
1258 | 1311 | saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg |
|
1259 | 1312 | |
|
1260 | 1313 | $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)' |
|
1261 | 1314 | @ 6:2f2d51af6205 J |
|
1262 | 1315 | | |
|
1263 | 1316 | o 3:08ebfeb61bac I |
|
1264 | 1317 | | |
|
1265 | 1318 | | o 5:64a8289d2492 F |
|
1266 | 1319 | | | |
|
1267 | 1320 | | o 2:7fb047a69f22 E |
|
1268 | 1321 | |/ |
|
1269 | 1322 | | o 4:26805aba1e60 C |
|
1270 | 1323 | | | |
|
1271 | 1324 | | o 1:112478962961 B |
|
1272 | 1325 | |/ |
|
1273 | 1326 | o 0:426bada5c675 A |
|
1274 | 1327 | |
|
1275 | 1328 | Test high-level scmutil.cleanupnodes API |
|
1276 | 1329 | |
|
1277 | 1330 | $ cd $TESTTMP/scmutilcleanup |
|
1278 | 1331 | $ hg debugdrawdag <<'EOS' |
|
1279 | 1332 | > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G |
|
1280 | 1333 | > | | | |
|
1281 | 1334 | > C H G |
|
1282 | 1335 | > EOS |
|
1283 | 1336 | $ for i in B C D F G I Z; do |
|
1284 | 1337 | > hg bookmark -i -r $i b-$i |
|
1285 | 1338 | > done |
|
1286 | 1339 | $ hg bookmark -i -r E 'b-F@divergent1' |
|
1287 | 1340 | $ hg bookmark -i -r H 'b-F@divergent2' |
|
1288 | 1341 | $ hg bookmark -i -r G 'b-F@divergent3' |
|
1289 | 1342 | $ cp -R . ../scmutilcleanup.obsstore |
|
1290 | 1343 | |
|
1291 | 1344 | $ cat > $TESTTMP/scmutilcleanup.py <<EOF |
|
1292 | 1345 | > from mercurial import registrar, scmutil |
|
1293 | 1346 | > cmdtable = {} |
|
1294 | 1347 | > command = registrar.command(cmdtable) |
|
1295 | 1348 | > @command(b'testnodescleanup') |
|
1296 | 1349 | > def testnodescleanup(ui, repo): |
|
1297 | 1350 | > def nodes(expr): |
|
1298 | 1351 | > return [repo.changelog.node(r) for r in repo.revs(expr)] |
|
1299 | 1352 | > def node(expr): |
|
1300 | 1353 | > return nodes(expr)[0] |
|
1301 | 1354 | > with repo.wlock(): |
|
1302 | 1355 | > with repo.lock(): |
|
1303 | 1356 | > with repo.transaction(b'delayedstrip'): |
|
1304 | 1357 | > mapping = {node(b'F'): [node(b'F2')], |
|
1305 | 1358 | > node(b'D'): [node(b'D2')], |
|
1306 | 1359 | > node(b'G'): [node(b'G2')]} |
|
1307 | 1360 | > scmutil.cleanupnodes(repo, mapping, b'replace') |
|
1308 | 1361 | > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2-obsolete()'), |
|
1309 | 1362 | > b'replace') |
|
1310 | 1363 | > EOF |
|
1311 | 1364 | $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
|
1312 | 1365 | warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60 |
|
1313 | 1366 | saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg |
|
1314 | 1367 | |
|
1315 | 1368 | $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' |
|
1316 | 1369 | o 8:1473d4b996d1 G2 b-F@divergent3 b-G |
|
1317 | 1370 | | |
|
1318 | 1371 | | o 7:d11b3456a873 F2 b-F |
|
1319 | 1372 | | | |
|
1320 | 1373 | | o 5:5cb05ba470a7 H |
|
1321 | 1374 | |/| |
|
1322 | 1375 | | o 3:7fb047a69f22 E b-F@divergent1 |
|
1323 | 1376 | | | |
|
1324 | 1377 | | | o 6:7c78f703e465 D2 b-D |
|
1325 | 1378 | | | | |
|
1326 | 1379 | | | o 4:26805aba1e60 C |
|
1327 | 1380 | | | | |
|
1328 | 1381 | | | o 2:112478962961 B |
|
1329 | 1382 | | |/ |
|
1330 | 1383 | o | 1:1fc8102cda62 G |
|
1331 | 1384 | / |
|
1332 | 1385 | o 0:426bada5c675 A b-B b-C b-I |
|
1333 | 1386 | |
|
1334 | 1387 | $ hg bookmark |
|
1335 | 1388 | b-B 0:426bada5c675 |
|
1336 | 1389 | b-C 0:426bada5c675 |
|
1337 | 1390 | b-D 6:7c78f703e465 |
|
1338 | 1391 | b-F 7:d11b3456a873 |
|
1339 | 1392 | b-F@divergent1 3:7fb047a69f22 |
|
1340 | 1393 | b-F@divergent3 8:1473d4b996d1 |
|
1341 | 1394 | b-G 8:1473d4b996d1 |
|
1342 | 1395 | b-I 0:426bada5c675 |
|
1343 | 1396 | b-Z -1:000000000000 |
|
1344 | 1397 | |
|
1345 | 1398 | Test the above using obsstore "by the way". Not directly related to strip, but |
|
1346 | 1399 | we have reusable code here |
|
1347 | 1400 | |
|
1348 | 1401 | $ cd $TESTTMP/scmutilcleanup.obsstore |
|
1349 | 1402 | $ cat >> .hg/hgrc <<EOF |
|
1350 | 1403 | > [experimental] |
|
1351 | 1404 | > evolution=true |
|
1352 | 1405 | > evolution.track-operation=1 |
|
1353 | 1406 | > EOF |
|
1354 | 1407 | |
|
1355 | 1408 | $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py |
|
1356 | 1409 | 4 new orphan changesets |
|
1357 | 1410 | |
|
1358 | 1411 | $ rm .hg/localtags |
|
1359 | 1412 | $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)' |
|
1360 | 1413 | * 12:1473d4b996d1 G2 b-F@divergent3 b-G |
|
1361 | 1414 | | |
|
1362 | 1415 | | * 11:d11b3456a873 F2 b-F |
|
1363 | 1416 | | | |
|
1364 | 1417 | | * 8:5cb05ba470a7 H |
|
1365 | 1418 | |/| |
|
1366 | 1419 | | o 4:7fb047a69f22 E b-F@divergent1 |
|
1367 | 1420 | | | |
|
1368 | 1421 | | | * 10:7c78f703e465 D2 b-D |
|
1369 | 1422 | | | | |
|
1370 | 1423 | | | x 6:26805aba1e60 C |
|
1371 | 1424 | | | | |
|
1372 | 1425 | | | x 3:112478962961 B |
|
1373 | 1426 | | |/ |
|
1374 | 1427 | x | 1:1fc8102cda62 G |
|
1375 | 1428 | / |
|
1376 | 1429 | o 0:426bada5c675 A b-B b-C b-I |
|
1377 | 1430 | |
|
1378 | 1431 | $ hg debugobsolete |
|
1379 | 1432 | 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'} |
|
1380 | 1433 | 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'} |
|
1381 | 1434 | f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'replace', 'user': 'test'} |
|
1382 | 1435 | 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'} |
|
1383 | 1436 | 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'} |
|
1384 | 1437 | 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'} |
|
1385 | 1438 | 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'} |
|
1386 | 1439 | $ cd .. |
|
1387 | 1440 | |
|
1388 | 1441 | Test that obsmarkers are restored even when not using generaldelta |
|
1389 | 1442 | |
|
1390 | 1443 | $ hg --config format.usegeneraldelta=no init issue5678 |
|
1391 | 1444 | $ cd issue5678 |
|
1392 | 1445 | $ cat >> .hg/hgrc <<EOF |
|
1393 | 1446 | > [experimental] |
|
1394 | 1447 | > evolution=true |
|
1395 | 1448 | > EOF |
|
1396 | 1449 | $ echo a > a |
|
1397 | 1450 | $ hg ci -Aqm a |
|
1398 | 1451 | $ hg ci --amend -m a2 |
|
1399 | 1452 | $ hg debugobsolete |
|
1400 | 1453 | cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'} |
|
1401 | 1454 | $ hg strip . |
|
1402 | 1455 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1403 | 1456 | saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg |
|
1404 | 1457 | $ hg unbundle -q .hg/strip-backup/* |
|
1405 | 1458 | $ hg debugobsolete |
|
1406 | 1459 | cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'} |
|
1407 | 1460 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now