Mercurial > public > mercurial-scm > hg
diff hgext/mq.py @ 16026:31c02546e6de stable
qrefresh: keep changeset phase during refresh
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Mon, 30 Jan 2012 17:36:30 +0100 |
parents | 2605fc990725 |
children | 29ea059be33c |
line wrap: on
line diff
--- a/hgext/mq.py Mon Jan 30 17:33:09 2012 +0100 +++ b/hgext/mq.py Mon Jan 30 17:36:30 2012 +0100 @@ -1511,6 +1511,8 @@ user = ph.user or changes[1] + oldphase = repo[top].phase() + # assumes strip can roll itself back if interrupted repo.dirstate.setparents(*cparents) self.applied.pop() @@ -1523,8 +1525,15 @@ try: # might be nice to attempt to roll back strip after this - n = secretcommit(repo, message, user, ph.date, match=match, - force=True) + backup = repo.ui.backupconfig('phases', 'new-commit') + try: + # Ensure we create a new changeset in the same phase than + # the old one. + repo.ui.setconfig('phases', 'new-commit', oldphase) + n = repo.commit(message, user, ph.date, match=match, + force=True) + finally: + repo.ui.restoreconfig(backup) # only write patch after a successful commit patchf.close() self.applied.append(statusentry(n, patchfn))