capabilities: properly sort capabilities after updating them
Capabilities are usually sorted. This is especially useful to avoid silly error
in test.
--- a/hgext3rd/evolve/serveronly.py Tue Mar 07 15:10:57 2017 +0100
+++ b/hgext3rd/evolve/serveronly.py Wed Mar 08 15:35:16 2017 -0800
@@ -219,12 +219,14 @@
caps = orig(repo, proto)
advertise = repo.ui.configbool('__temporary__', 'advertiseobsolete', True)
if obsolete.isenabled(repo, obsolete.exchangeopt) and advertise:
- caps += ' _evoext_pushobsmarkers_0'
- caps += ' _evoext_pullobsmarkers_0'
- caps += ' _evoext_obshash_0'
- caps += ' _evoext_obshash_1'
- caps += ' _evoext_getbundle_obscommon'
- return caps
+ caps = caps.split()
+ caps.append('_evoext_pushobsmarkers_0')
+ caps.append('_evoext_pullobsmarkers_0')
+ caps.append('_evoext_obshash_0')
+ caps.append('_evoext_obshash_1')
+ caps.append('_evoext_getbundle_obscommon')
+ caps.sort()
+ return ' '.join(caps)
def _getbundleobsmarkerpart(orig, bundler, repo, source, **kwargs):
if 'evo_obscommon' not in kwargs:
--- a/tests/test-simple4server-bundle2.t Tue Mar 07 15:10:57 2017 +0100
+++ b/tests/test-simple4server-bundle2.t Wed Mar 08 15:35:16 2017 -0800
@@ -81,9 +81,9 @@
===================
$ curl -s http://localhost:$HGPORT/?cmd=hello
- capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
+ capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob)
$ curl -s http://localhost:$HGPORT/?cmd=capabilities
- * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
+ _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob)
$ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort
bookmarks
@@ -143,9 +143,9 @@
obsolete
phases
$ curl -s http://localhost:$HGPORT/?cmd=hello
- capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
+ capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob)
$ curl -s http://localhost:$HGPORT/?cmd=capabilities
- * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
+ _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob)
$ echo '[__temporary__]' >> server/.hg/hgrc
$ echo 'advertiseobsolete=False' >> server/.hg/hgrc
@@ -170,6 +170,6 @@
phases
$ curl -s http://localhost:$HGPORT/?cmd=hello
- capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
+ capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob)
$ curl -s http://localhost:$HGPORT/?cmd=capabilities
- * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
+ _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob)
--- a/tests/test-simple4server.t Tue Mar 07 15:10:57 2017 +0100
+++ b/tests/test-simple4server.t Wed Mar 08 15:35:16 2017 -0800
@@ -89,9 +89,9 @@
===================
$ curl -s http://localhost:$HGPORT/?cmd=hello
- capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
+ capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob)
$ curl -s http://localhost:$HGPORT/?cmd=capabilities
- * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
+ _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob)
$ curl -s "http://localhost:$HGPORT/?cmd=listkeys&namespace=namespaces" | sort
bookmarks
@@ -159,9 +159,9 @@
obsolete
phases
$ curl -s http://localhost:$HGPORT/?cmd=hello
- capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
+ capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob)
$ curl -s http://localhost:$HGPORT/?cmd=capabilities
- * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
+ _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob)
$ echo '[__temporary__]' >> server/.hg/hgrc
$ echo 'advertiseobsolete=False' >> server/.hg/hgrc
@@ -189,6 +189,6 @@
obsolete
phases
$ curl -s http://localhost:$HGPORT/?cmd=hello
- capabilities: * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (glob)
+ capabilities: _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (glob)
$ curl -s http://localhost:$HGPORT/?cmd=capabilities
- * _evoext_pushobsmarkers_0 _evoext_pullobsmarkers_0 _evoext_obshash_0 _evoext_obshash_1 _evoext_getbundle_obscommon (no-eol) (glob)
+ _evoext_getbundle_obscommon _evoext_obshash_0 _evoext_obshash_1 _evoext_pullobsmarkers_0 _evoext_pushobsmarkers_0 batch * (no-eol) (glob)