##// END OF EJS Templates
rebase: write series file without removed mq patches...
Mads Kiilerich -
r15904:7d28d6a6 default
parent child Browse files
Show More
@@ -460,9 +460,13 b' def updatemq(repo, state, skipped, **opt'
460 mq.qimport(repo, (), patchname=name, git=isgit,
460 mq.qimport(repo, (), patchname=name, git=isgit,
461 rev=[str(state[rev])])
461 rev=[str(state[rev])])
462
462
463 # restore old series to preserve guards
463 # restore missing guards
464 mq.fullseries = original_series
464 for s in original_series:
465 mq.series_dirty = True
465 pname = mq.guard_re.split(s, 1)[0]
466 if pname in mq.fullseries:
467 repo.ui.debug('restoring guard for patch %s' % (pname))
468 mq.fullseries[mq.fullseries.index(pname)] = s
469 mq.series_dirty = True
466 mq.savedirty()
470 mq.savedirty()
467
471
468 def updatebookmarks(repo, nstate, originalbookmarks, **opts):
472 def updatebookmarks(repo, nstate, originalbookmarks, **opts):
@@ -244,7 +244,7 b' Rebase with guards'
244 $ hg ci -Am a
244 $ hg ci -Am a
245 adding a
245 adding a
246
246
247 Create mq repo with guarded patches foo and bar:
247 Create mq repo with guarded patches foo and bar and empty patch:
248
248
249 $ hg qinit
249 $ hg qinit
250 $ hg qnew foo
250 $ hg qnew foo
@@ -256,6 +256,8 b' Create mq repo with guarded patches foo '
256 popping foo
256 popping foo
257 patch queue now empty
257 patch queue now empty
258
258
259 $ hg qnew empty-important -m 'important commit message'
260
259 $ hg qnew bar
261 $ hg qnew bar
260 $ hg qguard bar +baz
262 $ hg qguard bar +baz
261 $ echo bar > bar
263 $ echo bar > bar
@@ -263,13 +265,16 b' Create mq repo with guarded patches foo '
263 $ hg qref
265 $ hg qref
264
266
265 $ hg qguard -l
267 $ hg qguard -l
268 empty-important: unguarded
266 bar: +baz
269 bar: +baz
267 foo: +baz
270 foo: +baz
268
271
269 $ hg tglog
272 $ hg tglog
270 @ 1:* '[mq]: bar' tags: bar qbase qtip tip (glob)
273 @ 2: '[mq]: bar' tags: bar qtip tip
271 |
274 |
272 o 0:* 'a' tags: qparent (glob)
275 o 1: 'important commit message' tags: empty-important qbase
276 |
277 o 0: 'a' tags: qparent
273
278
274 Create new head to rebase bar onto:
279 Create new head to rebase bar onto:
275
280
@@ -279,28 +284,35 b' Create new head to rebase bar onto:'
279 $ hg add b
284 $ hg add b
280 $ hg ci -m b
285 $ hg ci -m b
281 created new head
286 created new head
282 $ hg up -C 1
287 $ hg up -C 2
283 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
288 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
284 $ echo a >> a
289 $ echo a >> a
285 $ hg qref
290 $ hg qref
286
291
287 $ hg tglog
292 $ hg tglog
288 @ 2:* '[mq]: bar' tags: bar qbase qtip tip (glob)
293 @ 3: '[mq]: bar' tags: bar qtip tip
289 |
294 |
290 | o 1:* 'b' tags: (glob)
295 | o 2: 'b' tags:
296 | |
297 o | 1: 'important commit message' tags: empty-important qbase
291 |/
298 |/
292 o 0:* 'a' tags: qparent (glob)
299 o 0: 'a' tags: qparent
293
300
294
301
295 Rebase bar (make sure series order is preserved):
302 Rebase bar (make sure series order is preserved and empty-important also is
303 removed from the series):
296
304
297 $ hg qseries
305 $ hg qseries
306 empty-important
307 bar
308 foo
309 $ [ -f .hg/patches/empty-important ]
310 $ hg -q rebase -d 2
311 $ hg qseries
298 bar
312 bar
299 foo
313 foo
300 $ hg -q rebase -d 1
314 $ [ -f .hg/patches/empty-important ]
301 $ hg qseries
315 [1]
302 bar
303 foo
304
316
305 $ hg qguard -l
317 $ hg qguard -l
306 bar: +baz
318 bar: +baz
General Comments 0
You need to be logged in to leave comments. Login now