Skip to content
Snippets Groups Projects
Commit 2d9902f0 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

safeguard: allow push to succeed (and without warning) with --publish

parent 41980174
No related branches found
No related tags found
No related merge requests found
Changelog
=========
8.4.0 - in progress
-------------------
* push: have `--publish` overrule the `auto-publish` config
8.3.2 - in progress
-------------------
......
......@@ -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)
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment