changeset 6558:282a0467433e

evolve.serveronly: remove this extension, please use regular evolve extension With the introduction of topic namespaces, it seems no longer viable to add features and cover them by tests in multiple extensions (i.e. both evolve and evolve.serveronly). We suggest users switch to the regular evolve and topic extensions on the server side.
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 04 Oct 2023 14:08:53 -0300
parents 279c01842eca
children b56489871a56
files README.rst hgext3rd/evolve/__init__.py hgext3rd/evolve/serveronly.py tests/test-check-sdist.t tests/test-evolve-serveronly-bundle2.t tests/test-evolve-serveronly-legacy.t
diffstat 6 files changed, 1 insertions(+), 335 deletions(-) [+]
line wrap: on
line diff
--- a/README.rst	Wed Oct 04 14:04:40 2023 -0300
+++ b/README.rst	Wed Oct 04 14:08:53 2023 -0300
@@ -87,19 +87,6 @@
 * make sure evolve is installed for the same version of Python that you use for
   running Mercurial (``hg debuginstall | grep Python``).
 
-Server-only Setup
-=================
-
-It is possible to enable a smaller subset of the features aimed at servers that
-simply serve repositories::
-
-    $ hg config --edit # add these two lines:
-    [extensions]
-    evolve.serveronly =
-
-It skips the additions of the new commands and local UI messages that might add
-performance overhead.
-
 Extension Purpose
 =================
 
--- a/hgext3rd/evolve/__init__.py	Wed Oct 04 14:04:40 2023 -0300
+++ b/hgext3rd/evolve/__init__.py	Wed Oct 04 14:08:53 2023 -0300
@@ -14,9 +14,6 @@
 - enable the changeset-evolution feature for Mercurial,
 - improves some aspect of the early implementation in Mercurial core,
 
-Note that a version dedicated to server usage only (no local working copy) is
-available as 'evolve.serveronly'.
-
 While many feature related to changeset evolution are directly handled by core
 this extensions contains significant additions recommended to any user of
 changeset evolution.
--- a/hgext3rd/evolve/serveronly.py	Wed Oct 04 14:04:40 2023 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-'''enable experimental obsolescence feature of Mercurial (DEPRECATED)
-
-OBSOLESCENCE IS AN EXPERIMENTAL FEATURE MAKE SURE YOU UNDERSTOOD THE INVOLVED
-CONCEPT BEFORE USING IT.
-
-! THIS EXTENSION IS INTENDED FOR SERVER SIDE ONLY USAGE !
-
-For client side usages it is recommended to use the evolve extension for
-improved user interface.'''
-
-from __future__ import absolute_import
-
-import sys
-import os
-
-from mercurial import obsolete
-
-try:
-    from . import (
-        compat,
-        exthelper,
-        metadata,
-        obscache,
-        obsexchange,
-    )
-except (ValueError, ImportError) as exc:
-    if (isinstance(exc, ValueError)
-        and str(exc) != b'Attempted relative import in non-package'):
-        raise
-    # extension imported using direct path
-    sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
-    from evolve import (
-        compat,
-        exthelper,
-        metadata,
-        obscache,
-        obsexchange,
-    )
-
-__version__ = metadata.__version__
-testedwith = metadata.testedwith
-minimumhgversion = metadata.minimumhgversion
-buglink = metadata.buglink
-
-eh = exthelper.exthelper()
-eh.merge(compat.eh)
-eh.merge(obscache.eh)
-eh.merge(obsexchange.eh)
-uisetup = eh.finaluisetup
-extsetup = eh.finalextsetup
-reposetup = eh.finalreposetup
-cmdtable = eh.cmdtable
-configtable = eh.configtable
-
-@eh.reposetup
-def default2evolution(ui, repo):
-    evolveopts = repo.ui.configlist(b'experimental', b'evolution')
-    if not evolveopts:
-        evolveopts = b'all'
-        repo.ui.setconfig(b'experimental', b'evolution', evolveopts, b'evolve')
-    if obsolete.isenabled(repo, b'exchange'):
-        # if no config explicitly set, disable bundle1
-        if not isinstance(repo.ui.config(b'server', b'bundle1'), bytes):
-            repo.ui.setconfig(b'server', b'bundle1', False, b'evolve')
--- a/tests/test-check-sdist.t	Wed Oct 04 14:04:40 2023 -0300
+++ b/tests/test-check-sdist.t	Wed Oct 04 14:08:53 2023 -0300
@@ -37,7 +37,7 @@
   $ egrep '^tests/test-.*\.(t|py)$' files > test-files
   $ egrep -v '^tests/test-.*\.(t|py)$' files > other-files
   $ wc -l other-files
-  149 other-files
+  148 other-files
   $ wc -l test-files
   ??? test-files (glob)
   $ fgrep debian files
--- a/tests/test-evolve-serveronly-bundle2.t	Wed Oct 04 14:04:40 2023 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-
-  $ . ${TESTDIR}/testlib/pythonpath.sh
-
-  $ cat >> $HGRCPATH <<EOF
-  > [web]
-  > push_ssl = false
-  > allow_push = *
-  > [ui]
-  > ssh = "$PYTHON" "$RUNTESTDIR/dummyssh"
-  > [phases]
-  > publish = False
-  > [experimental]
-  > bundle2-exp=True
-  > EOF
-
-  $ mkcommit() {
-  >    echo "$1" > "$1"
-  >    hg add "$1"
-  >    hg ci -m "add $1"
-  > }
-
-  $ hg init server
-
-Try the multiple ways to setup the extension
-
-  $ hg -R server log --config 'extensions.evolve.serveronly='
-  $ hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py"
-  $ PYTHONPATH=$HGTEST_ORIG_PYTHONPATH hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py"
-
-setup repo
-
-  $ echo "[extensions]" >> ./server/.hg/hgrc
-  $ echo "evolve.serveronly=" >> ./server/.hg/hgrc
-  $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-  $ cat hg.pid >> $DAEMON_PIDS
-
-  $ hg clone http://localhost:$HGPORT/ client
-  no changes found
-  updating to branch default
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ cat ./errors.log
-  $ echo "[extensions]" >> ./client/.hg/hgrc
-  $ echo "evolve=" >> ./client/.hg/hgrc
-  $ echo "[paths]" >> ./client/.hg/hgrc
-  $ echo "ssh=ssh://user@dummy/server/" >> ./client/.hg/hgrc
-  $ cp -r client other
-
-Smoke testing
-===============
-
-  $ cd client
-  $ mkcommit 0
-  $ mkcommit a
-  $ hg push
-  pushing to http://localhost:$HGPORT/
-  searching for changes
-  remote: adding changesets
-  remote: adding manifests
-  remote: adding file changes
-  remote: added 2 changesets with 2 changes to 2 files
-  $ hg pull
-  pulling from http://localhost:$HGPORT/
-  searching for changes
-  no changes found
-  $ cat ../errors.log
-  $ hg pull -R ../other
-  pulling from http://localhost:$HGPORT/
-  requesting all changes
-  adding changesets
-  adding manifests
-  adding file changes
-  added 2 changesets with 2 changes to 2 files
-  new changesets 8685c6d34325:4957bfdac07e (2 drafts)
-  (run 'hg update' to get a working copy)
-  $ cat ../errors.log
-  $ hg push -R ../other
-  pushing to http://localhost:$HGPORT/
-  searching for changes
-  no changes found
-  [1]
-  $ cat ../errors.log
-
-Capacity testing
-===================
-
-  $ hg debugdownload http://localhost:$HGPORT/?cmd=hello
-  capabilities: _evoext_getbundle_obscommon _evoext_obshashrange_v1 batch * (glob)
-  $ hg debugdownload http://localhost:$HGPORT/?cmd=capabilities
-  _evoext_getbundle_obscommon _evoext_obshashrange_v1 batch * (glob)
-
-  $ hg debugpushkey http://localhost:$HGPORT namespaces
-  bookmarks	
-  namespaces	
-  obsolete	
-  phases	
-
-Push
-=============
-
-  $ echo 'A' > a
-  $ hg amend
-  $ hg push
-  pushing to http://localhost:$HGPORT/
-  searching for changes
-  remote: adding changesets
-  remote: adding manifests
-  remote: adding file changes
-  remote: added 1 changesets with 1 changes to 1 files (+1 heads)
-  remote: 1 new obsolescence markers
-  remote: obsoleted 1 changesets
-  $ cat ../errors.log
-  $ hg push
-  pushing to http://localhost:$HGPORT/
-  searching for changes
-  no changes found
-  [1]
-  $ cat ../errors.log
-
-Pull
-=============
-
-  $ hg -R ../other pull
-  pulling from http://localhost:$HGPORT/
-  searching for changes
-  adding changesets
-  adding manifests
-  adding file changes
-  added 1 changesets with 1 changes to [12] files \(\+1 heads\) (re)
-  1 new obsolescence markers
-  obsoleted 1 changesets
-  new changesets 9d1c114e7797 (1 drafts)
-  (run 'hg heads' to see heads)
-  $ cat ../errors.log
-  $ hg -R ../other pull
-  pulling from http://localhost:$HGPORT/
-  searching for changes
-  no changes found
-  $ cat ../errors.log
-
-  $ cd ..
-
-Test disabling obsolete advertisement
-===========================================
-(used by bitbucket to select which repo use evolve)
-
-  $ hg debugpushkey http://localhost:$HGPORT namespaces
-  bookmarks	
-  namespaces	
-  obsolete	
-  phases	
-  $ hg debugdownload http://localhost:$HGPORT/?cmd=hello
-  capabilities: _evoext_getbundle_obscommon _evoext_obshashrange_v1 batch * (glob)
-  $ hg debugdownload http://localhost:$HGPORT/?cmd=capabilities
-  _evoext_getbundle_obscommon _evoext_obshashrange_v1 batch * (glob)
-
-  $ echo '[experimental]' >> server/.hg/hgrc
-  $ echo 'evolution=!' >> server/.hg/hgrc
-  $ $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
-  $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-  $ cat hg.pid >> $DAEMON_PIDS
-
-  $ hg debugpushkey http://localhost:$HGPORT namespaces
-  bookmarks	
-  namespaces	
-  phases	
-
-  $ echo 'evolution=all' >> server/.hg/hgrc
-  $ $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
-  $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
-  $ cat hg.pid >> $DAEMON_PIDS
-
-  $ hg debugpushkey http://localhost:$HGPORT namespaces
-  bookmarks	
-  namespaces	
-  obsolete	
-  phases	
-
-  $ hg debugdownload http://localhost:$HGPORT/?cmd=hello
-  capabilities: _evoext_getbundle_obscommon _evoext_obshashrange_v1 batch * (glob)
-  $ hg debugdownload http://localhost:$HGPORT/?cmd=capabilities
-  _evoext_getbundle_obscommon _evoext_obshashrange_v1 batch * (glob)
-
-Test obshashrange discover
-===========================================
-
-  $ cat >> $HGRCPATH <<EOF
-  > [experimental]
-  > obshashrange = True
-  > EOF
-  $ cd client
-  $ hg pull ssh
-  pulling from ssh://user@dummy/server/
-  searching for changes
-  no changes found
--- a/tests/test-evolve-serveronly-legacy.t	Wed Oct 04 14:04:40 2023 -0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-
-  $ . ${TESTDIR}/testlib/pythonpath.sh
-
-  $ cat >> $HGRCPATH <<EOF
-  > [web]
-  > push_ssl = false
-  > allow_push = *
-  > [phases]
-  > publish = False
-  > [experimental]
-  > bundle2-exp=False # < Mercurial-4.0
-  > [devel]
-  > legacy.exchange=bundle1
-  > EOF
-
-  $ mkcommit() {
-  >    echo "$1" > "$1"
-  >    hg add "$1"
-  >    hg ci -m "add $1"
-  > }
-
-
-  $ hg init server
-
-Try the multiple ways to setup the extension
-
-  $ hg -R server log --config 'extensions.evolve.serveronly='
-  $ hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py"
-  $ PYTHONPATH=$HGTEST_ORIG_PYTHONPATH hg -R server log --config "extensions.evolve.serveronly=${SRCDIR}/hgext3rd/evolve/serveronly.py"
-
-setup repo
-
-  $ echo "[extensions]" >> ./server/.hg/hgrc
-  $ echo "evolve.serveronly=" >> ./server/.hg/hgrc
-  $ hg serve -R server -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log --traceback
-  $ cat hg.pid >> $DAEMON_PIDS
-
-  $ hg clone http://localhost:$HGPORT/ client
-  no changes found
-  updating to branch default
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ cat ./errors.log
-  $ echo "[extensions]" >> ./client/.hg/hgrc
-  $ echo "evolve=" >> ./client/.hg/hgrc
-  $ cp -r client other
-
-Smoke testing
-===============
-
-  $ cd client
-  $ mkcommit 0
-  $ mkcommit a
-  $ hg push
-  pushing to http://localhost:$HGPORT/
-  searching for changes
-  abort: remote error:
-  incompatible Mercurial client; bundle2 required
-  (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
-  [100]
-  $ cat ../errors.log