Commit bd60c5e4 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

topic: announce ext-topics-publish capability in case of SSH and HTTP too

--HG--
branch : stable
parent 8d36bfe9968a
Pipeline #22289 passed with stage
in 4 minutes and 25 seconds
......@@ -71,6 +71,13 @@ def wireprotocaps(orig, repo, proto):
caps = orig(repo, proto)
if common.hastopicext(repo) and repo.peer().capable(b'topics'):
caps.append(b'_exttopics_heads')
if repo.ui.configbool(b'phases', b'publish'):
mode = b'all'
elif repo.ui.configbool(b'experimental', b'topic.publish-bare-branch'):
mode = b'auto'
else:
mode = b'none'
caps.append(b'ext-topics-publish=%s' % mode)
return caps
def setupserver(ui):
......
......@@ -132,6 +132,7 @@ Check topic isolation
[1]
$ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-topic | egrep 'topics|evoext'
_exttopics_heads
ext-topics-publish=all
topics
$ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-no-ext | egrep 'topics|evoext'
[1]
......@@ -145,12 +146,14 @@ Check coupled isolation
_evoext_getbundle_obscommon
_evoext_obshashrange_v1
_exttopics_heads
ext-topics-publish=all
topics
$ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-evo | egrep 'topics|evoext'
_evoext_getbundle_obscommon
_evoext_obshashrange_v1
$ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-topic | egrep 'topics|evoext'
_exttopics_heads
ext-topics-publish=all
topics
$ hg debugcapabilities http://$LOCALIP:$HGPORT/repo-evo | egrep 'topics|evoext'
_evoext_getbundle_obscommon
......
......@@ -8,6 +8,8 @@ Test workflow options
Also testing auto-publish config option with this publishing mode
$ cat << EOF >> "$HGRCPATH"
> [ui]
> ssh = "$PYTHON" "$RUNTESTDIR/dummyssh"
> [experimental]
> auto-publish = warn
> [alias]
......@@ -343,12 +345,26 @@ Checking the option to prevent automatic publishing
$ hg up branchA
2 files updated, 0 files merged, 5 files removed, 0 files unresolved
Trying to push changeset without topic (would publish them)
Making sure the topic-publishing mode is announced as a capability
$ mkcommit c_aM0
$ hg debugcapabilities $TESTTMP/bare-branch-server | grep topics
ext-topics-publish=auto
topics
$ hg debugcapabilities ssh://user@dummy/bare-branch-server | grep topics
_exttopics_heads
ext-topics-publish=auto
topics
$ hg serve -R ../bare-branch-server -p $HGPORT -d --pid-file hg.pid
$ cat hg.pid >> $DAEMON_PIDS
$ hg debugcapabilities http://localhost:$HGPORT | grep topics
_exttopics_heads
ext-topics-publish=auto
topics
$ killdaemons.py
Trying to push changeset without topic (would publish them)
$ mkcommit c_aM0
$ hg push --config experimental.auto-publish=abort -r .
pushing to $TESTTMP/bare-branch-server
abort: push would publish 1 changesets
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment