# HG changeset patch # User Anton Shestakov # Date 1541418993 -28800 # Node ID 2d9902f0ff175ff5e1baa4a4d8f7f37c7c9c7bf5 # Parent 419801742d0829183aeb2b0ad09f35e58c4c4317 safeguard: allow push to succeed (and without warning) with --publish diff -r 419801742d08 -r 2d9902f0ff17 CHANGELOG --- a/CHANGELOG Sun Nov 04 22:06:23 2018 +0800 +++ b/CHANGELOG Mon Nov 05 19:56:33 2018 +0800 @@ -1,6 +1,10 @@ Changelog ========= +8.4.0 - in progress +------------------- + + * push: have `--publish` overrule the `auto-publish` config 8.3.2 - in progress ------------------- diff -r 419801742d08 -r 2d9902f0ff17 hgext3rd/evolve/safeguard.py --- a/hgext3rd/evolve/safeguard.py Sun Nov 04 22:06:23 2018 +0800 +++ b/hgext3rd/evolve/safeguard.py Mon Nov 05 19:56:33 2018 +0800 @@ -26,7 +26,8 @@ def checkpush(self, pushop): super(noautopublishrepo, self).checkpush(pushop) behavior = self.ui.config('experimental', 'auto-publish', 'default') - if behavior not in ('warn', 'abort'): + nocheck = behavior not in ('warn', 'abort') + if nocheck or getattr(pushop, 'publish', False): return remotephases = pushop.remote.listkeys('phases') publishing = remotephases.get('publishing', False) diff -r 419801742d08 -r 2d9902f0ff17 tests/test-obsolete-push.t --- a/tests/test-obsolete-push.t Sun Nov 04 22:06:23 2018 +0800 +++ b/tests/test-obsolete-push.t Mon Nov 05 19:56:33 2018 +0800 @@ -4,6 +4,7 @@ > [extensions] > EOF $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH + $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> $HGRCPATH $ template='{rev}:{node|short}@{branch}({separate("/", obsolete, phase)}) {desc|firstline}\n' $ glog() { @@ -91,3 +92,15 @@ adding manifests adding file changes added 0 changesets with 0 changes to 1 files + +--publish overrides auto-publish + + $ echo d > d + $ hg ci -qAm D d + $ hg push -r . --publish --config experimental.auto-publish=abort + pushing to $TESTTMP/source + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files