--- a/hgext/mq.py Mon Jan 30 17:37:45 2012 +0100
+++ b/hgext/mq.py Mon Jan 30 17:39:05 2012 +0100
@@ -3159,8 +3159,12 @@
def mqphasedefaults(repo, roots):
"""callback used to set mq changeset as secret when no phase data exists"""
if repo.mq.applied:
+ if repo.ui.configbool('mq', 'secret', False):
+ mqphase = phases.secret
+ else:
+ mqphase = phases.draft
qbase = repo[repo.mq.applied[0].node]
- roots[phases.secret].add(qbase.node())
+ roots[mqphase].add(qbase.node())
return roots
def reposetup(ui, repo):
--- a/tests/test-mq.t Mon Jan 30 17:37:45 2012 +0100
+++ b/tests/test-mq.t Mon Jan 30 17:39:05 2012 +0100
@@ -1448,4 +1448,19 @@
applying modify-file
now at: modify-file
- $ cd ..
+Proper phase default with mq:
+
+1. mq.secret=false
+
+ $ rm .hg/store/phaseroots
+ $ hg phase 'qparent::'
+ 0: draft
+ 1: draft
+ 2: draft
+ $ echo '[mq]' >> $HGRCPATH
+ $ echo 'secret=true' >> $HGRCPATH
+ $ rm -f .hg/store/phaseroots
+ $ hg phase 'qparent::'
+ 0: secret
+ 1: secret
+ 2: secret