diff tests/test-discovery-obshashrange.t @ 4479:2db0aca03a88 stable

extensions: avoid enabling evolve for unrelated repositories (issue6057) The support for the `experimental.evolve` config have been there forever. So we can stop using the global variable. This help avoiding evolve to enable itself of repository that did not explicitly activated it. For example, this is useful for hgwebdir. Before this change, evolution feature had to be explicitly disabled or enabled in every single repository.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 09 Apr 2019 20:45:36 +0200
parents b2e2f9fe7a45
children e4fc3af2d0a9 77f3699e711e
line wrap: on
line diff
--- a/tests/test-discovery-obshashrange.t	Wed Feb 13 21:39:10 2019 +0800
+++ b/tests/test-discovery-obshashrange.t	Tue Apr 09 20:45:36 2019 +0200
@@ -1158,3 +1158,64 @@
   saved backup bundle to $TESTTMP/client/.hg/strip-backup/c8d03c1b5e94-b257442b-backup.hg
   $ f -s .hg/cache/evoext*
   .hg/cache/evoext-obscache-00: size=70
+  $ cd ..
+
+Check capabilities advertisement
+================================
+
+  $ hg init with-evolve
+  $ cat << EOF >> with-evolve/.hg/hgrc
+  > [experimental]
+  > evolution.exchange=yes
+  > EOF
+  $ hg init without-evolve
+  $ cat << EOF >> without-evolve/.hg/hgrc
+  > [experimental]
+  > evolution.exchange=no
+  > EOF
+
+  $ hg debugcapabilities ssh://user@dummy/with-evolve | grep _evoext
+    _evoext_getbundle_obscommon
+    _evoext_obshash_0
+    _evoext_obshash_1
+    _evoext_obshashrange_v1
+  $ hg debugcapabilities ssh://user@dummy/without-evolve | grep _evoext
+  [1]
+
+Using http:
+
+  $ cat > web.conf << EOF
+  > [paths]
+  > / = *
+  > EOF
+
+(evolve version first)
+
+  $ hg serve --web-conf web.conf -p $HGPORT -d --pid-file hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+
+  $ hg debugcapabilities http://localhost:$HGPORT/with-evolve| grep _evoext
+    _evoext_getbundle_obscommon
+    _evoext_obshash_0
+    _evoext_obshash_1
+    _evoext_obshashrange_v1
+  $ hg debugcapabilities http://localhost:$HGPORT/without-evolve| grep _evoext
+  [1]
+
+  $ killdaemons.py
+
+
+(evolve version second)
+
+  $ hg serve --web-conf web.conf -p $HGPORT -d --pid-file hg.pid
+  $ cat hg.pid >> $DAEMON_PIDS
+
+  $ hg debugcapabilities http://localhost:$HGPORT/without-evolve| grep _evoext
+  [1]
+  $ hg debugcapabilities http://localhost:$HGPORT/with-evolve| grep _evoext
+    _evoext_getbundle_obscommon
+    _evoext_obshash_0
+    _evoext_obshash_1
+    _evoext_obshashrange_v1
+
+  $ killdaemons.py