Mercurial > hg
comparison hgext/rebase.py @ 15904:7d28d6a67dd3
rebase: write series file without removed mq patches
Rebase will remove empty changesets and will also completely remove the mq
patch file for rebased empty patches.
Starting with b28004513977 (1.9) it would preserve guards by writing the old
series file back. That would however also reintroduce removed patch files in
the series file and the inconsistency would make qpop + qpush fail.
This patch backs out most of b28004513977 and makes sure guards are preserved
without reintroducing removed patches.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 17 Jan 2012 02:55:55 +0100 |
parents | 2305baff673f |
children | e66084ef8449 |
comparison
equal
deleted
inserted
replaced
15903:0329d3b12d8e | 15904:7d28d6a67dd3 |
---|---|
458 name, isgit = mqrebase[rev] | 458 name, isgit = mqrebase[rev] |
459 repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name)) | 459 repo.ui.debug('import mq patch %d (%s)\n' % (state[rev], name)) |
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): |
469 'Move bookmarks to their correct changesets' | 473 'Move bookmarks to their correct changesets' |
470 current = repo._bookmarkcurrent | 474 current = repo._bookmarkcurrent |