# HG changeset patch # User Matt Mackall # Date 2012-01-29 18:59:21 # Node ID 2605fc99072594b0e29f686f7d753686447fe183 # Parent 73da3e2b185fc72ca8e9e4d4435ec94db0cafa08 mq: add secret setting diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -38,6 +38,12 @@ preserving existing git patches upon qre 'no', mq will override the [diff] section and always generate git or regular patches, possibly losing data in the second case. +It may be desirable for mq changesets in the secret phase (see +:hg:`help phases`), which can be enabled with the following setting:: + + [mq] + secret = True + You will by default be managing a patch queue named "patches". You can create other, independent patch queues with the :hg:`qqueue` command. ''' @@ -256,6 +262,9 @@ def secretcommit(repo, *args, **kwargs): It should be used instead of repo.commit inside the mq source """ + if not repo.ui.configbool('mq', 'secret', False): + return repo.commit(*args, **kwargs) + backup = repo.ui.backupconfig('phases', 'new-commit') try: # ensure we create a secret changeset diff --git a/tests/test-mq-qclone-http.t b/tests/test-mq-qclone-http.t --- a/tests/test-mq-qclone-http.t +++ b/tests/test-mq-qclone-http.t @@ -43,7 +43,7 @@ test with recursive collection adding changesets adding manifests adding file changes - added 1 changesets with 1 changes to 1 files + added 2 changesets with 2 changes to 2 files requesting all changes adding changesets adding manifests @@ -82,7 +82,7 @@ test with normal collection adding changesets adding manifests adding file changes - added 1 changesets with 1 changes to 1 files + added 2 changesets with 2 changes to 2 files requesting all changes adding changesets adding manifests @@ -121,7 +121,7 @@ test with old-style collection adding changesets adding manifests adding file changes - added 1 changesets with 1 changes to 1 files + added 2 changesets with 2 changes to 2 files requesting all changes adding changesets adding manifests diff --git a/tests/test-mq-safety.t b/tests/test-mq-safety.t --- a/tests/test-mq-safety.t +++ b/tests/test-mq-safety.t @@ -144,17 +144,6 @@ Testing applied patches, push and --forc Pushing applied patch with --rev without --force -All secret - - $ hg push -r . ../forcepush2 - pushing to ../forcepush2 - searching for changes - no changes found (ignored 1 secret changesets) - -some draft - - $ hg phase --draft 'mq()' - $ hg push -r . ../forcepush2 pushing to ../forcepush2 abort: source has mq patches applied diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -50,6 +50,12 @@ help will override the [diff] section and always generate git or regular patches, possibly losing data in the second case. + It may be desirable for mq changesets in the secret phase (see "hg help + phases"), which can be enabled with the following setting: + + [mq] + secret = True + You will by default be managing a patch queue named "patches". You can create other, independent patch queues with the "hg qqueue" command. @@ -149,11 +155,11 @@ qinit -c should create both files if the $ checkundo qnew $ echo foo > foo $ hg phase -r qbase - 0: secret + 0: draft $ hg add foo $ hg qrefresh $ hg phase -r qbase - 0: secret + 0: draft $ hg qnew B $ echo >> foo $ hg qrefresh @@ -302,7 +308,7 @@ Dump the tag cache to ensure that it has applying test.patch now at: test.patch $ hg phase -r qbase - 2: secret + 2: draft $ hg tags > /dev/null .hg/cache/tags (post qpush): @@ -395,7 +401,6 @@ commit should fail push should fail if draft - $ hg phase --draft 'mq()' $ hg push ../../k pushing to ../../k abort: source has mq patches applied @@ -1214,11 +1219,6 @@ repo with unversioned patch dir repo with patches applied $ hg qclone qclonesource qclonedest - requesting all changes - adding changesets - adding manifests - adding file changes - added 1 changesets with 1 changes to 1 files updating to branch default 3 files updated, 0 files merged, 0 files removed, 0 files unresolved 1 files updated, 0 files merged, 0 files removed, 0 files unresolved