Show More
@@ -354,6 +354,8 def updatemq(repo, state, skipped, **opt | |||||
354 | 'Update rebased mq patches - finalize and then import them' |
|
354 | 'Update rebased mq patches - finalize and then import them' | |
355 | mqrebase = {} |
|
355 | mqrebase = {} | |
356 | mq = repo.mq |
|
356 | mq = repo.mq | |
|
357 | original_series = mq.full_series[:] | |||
|
358 | ||||
357 | for p in mq.applied: |
|
359 | for p in mq.applied: | |
358 | rev = repo[p.node].rev() |
|
360 | rev = repo[p.node].rev() | |
359 | if rev in state: |
|
361 | if rev in state: | |
@@ -371,6 +373,15 def updatemq(repo, state, skipped, **opt | |||||
371 | repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name)) |
|
373 | repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name)) | |
372 | mq.qimport(repo, (), patchname=name, git=isgit, |
|
374 | mq.qimport(repo, (), patchname=name, git=isgit, | |
373 | rev=[str(state[rev])]) |
|
375 | rev=[str(state[rev])]) | |
|
376 | ||||
|
377 | # Restore missing guards | |||
|
378 | for s in original_series: | |||
|
379 | pname = mq.guard_re.split(s, 1)[0] | |||
|
380 | if pname in mq.full_series: | |||
|
381 | repo.ui.debug('restoring guard for patch %s' % (pname)) | |||
|
382 | mq.full_series.remove(pname) | |||
|
383 | mq.full_series.append(s) | |||
|
384 | mq.series_dirty = True | |||
374 | mq.save_dirty() |
|
385 | mq.save_dirty() | |
375 |
|
386 | |||
376 | def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches, |
|
387 | def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches, |
@@ -235,3 +235,73 Rebase the applied mq patches: | |||||
235 | -mq1 |
|
235 | -mq1 | |
236 | +mq2 |
|
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