--- 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))
--- a/tests/test-mq-qrefresh.t Mon Jan 30 17:33:09 2012 +0100
+++ b/tests/test-mq-qrefresh.t Mon Jan 30 17:36:30 2012 +0100
@@ -523,3 +523,23 @@
diff --git a/a b/a
new file mode 100644
$ cd ..
+
+Refresh with phase data:
+
+
+
+ $ cd repo
+ $ echo 'babar' >> a
+ $ hg qnew -m 'update a' p2.diff
+ $ hg phase p2.diff
+ 2: draft
+ $ echo 'beber' >> a
+ $ hg qref
+ $ hg phase p2.diff
+ 2: draft
+ $ hg phase --force --secret p2.diff
+ $ echo 'bibir' >> a
+ $ hg qref
+ $ hg phase p2.diff
+ 2: secret
+