##// END OF EJS Templates
rebase: restore mq guards after rebasing (issue2107)...
Stefano Tortarolo -
r13766:627e50e9 default
parent child Browse files
Show More
@@ -361,6 +361,8 def updatemq(repo, state, skipped, **opt
361 361 'Update rebased mq patches - finalize and then import them'
362 362 mqrebase = {}
363 363 mq = repo.mq
364 original_series = mq.full_series[:]
365
364 366 for p in mq.applied:
365 367 rev = repo[p.node].rev()
366 368 if rev in state:
@@ -378,6 +380,15 def updatemq(repo, state, skipped, **opt
378 380 repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name))
379 381 mq.qimport(repo, (), patchname=name, git=isgit,
380 382 rev=[str(state[rev])])
383
384 # Restore missing guards
385 for s in original_series:
386 pname = mq.guard_re.split(s, 1)[0]
387 if pname in mq.full_series:
388 repo.ui.debug('restoring guard for patch %s' % (pname))
389 mq.full_series.remove(pname)
390 mq.full_series.append(s)
391 mq.series_dirty = True
381 392 mq.save_dirty()
382 393
383 394 def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches,
@@ -235,3 +235,73 Rebase the applied mq patches:
235 235 -mq1
236 236 +mq2
237 237
238
239 Rebase with guards
240
241 $ hg init foo
242 $ cd foo
243 $ echo a > a
244 $ hg ci -Am a
245 adding a
246
247 Create mq repo with guarded patches foo and bar:
248
249 $ hg qinit
250 $ hg qnew foo
251 $ hg qguard foo +baz
252 $ echo foo > foo
253 $ hg qref
254 $ hg qpop
255 popping foo
256 patch queue now empty
257
258 $ hg qnew bar
259 $ hg qguard bar +baz
260 $ echo bar > bar
261 $ hg qref
262
263 $ hg qguard -l
264 bar: +baz
265 foo: +baz
266
267 $ hg tglog
268 @ 1:* '[mq]: bar' tags: bar qbase qtip tip (glob)
269 |
270 o 0:* 'a' tags: qparent (glob)
271
272 Create new head to rebase bar onto:
273
274 $ hg up -C 0
275 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 $ echo b > b
277 $ hg add b
278 $ hg ci -m b
279 created new head
280 $ hg up -C 1
281 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
282 $ echo a >> a
283 $ hg qref
284
285 $ hg tglog
286 @ 2:* '[mq]: bar' tags: bar qbase qtip tip (glob)
287 |
288 | o 1:* 'b' tags: (glob)
289 |/
290 o 0:* 'a' tags: qparent (glob)
291
292
293 Rebase bar:
294
295 $ hg -q rebase -d 1
296
297 $ hg qguard -l
298 foo: +baz
299 bar: +baz
300
301 $ hg tglog
302 @ 2:* '[mq]: bar' tags: bar qbase qtip tip (glob)
303 |
304 o 1:* 'b' tags: qparent (glob)
305 |
306 o 0:* 'a' tags: (glob)
307
General Comments 0
You need to be logged in to leave comments. Login now