[PATCH] readbundle: fix typo of None compression

Yuya Nishihara yuya at tcha.org
Fri Sep 18 09:45:41 CDT 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1442579563 -32400
#      Fri Sep 18 21:32:43 2015 +0900
# Node ID a02f5959e6752c27fe42a01995297343b60e738b
# Parent  8ea0009e22072e9216ca81069ce50920a8963aa2
readbundle: fix typo of None compression

The test simulates pre-d1b16a746db6 hgweb that sends "unbundle" capability
with no argument.

diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -80,7 +80,7 @@ def combineresults(results):
     return result
 
 bundletypes = {
-    "": ("", 'None'),     # only when using unbundle on ssh and old http servers
+    "": ("", None),       # only when using unbundle on ssh and old http servers
                           # since the unification ssh accepts a header but there
                           # is no capability signaling it.
     "HG20": (), # special-cased below
diff --git a/tests/test-push-http-bundle1.t b/tests/test-push-http-bundle1.t
--- a/tests/test-push-http-bundle1.t
+++ b/tests/test-push-http-bundle1.t
@@ -114,6 +114,36 @@ expect success, server lacks the unbundl
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
 
+expect success, pre-d1b16a746db6 server supports the unbundle capability, but
+has no parameter
+
+  $ cat <<EOF > notcapable-unbundleparam.py
+  > from mercurial import extensions, httppeer
+  > def capable(orig, self, name):
+  >     if name == 'unbundle':
+  >         return True
+  >     return orig(self, name)
+  > def uisetup(ui):
+  >     extensions.wrapfunction(httppeer.httppeer, 'capable', capable)
+  > EOF
+  $ cp $HGRCPATH $HGRCPATH.orig
+  $ cat <<EOF >> $HGRCPATH
+  > [extensions]
+  > notcapable-unbundleparam = `pwd`/notcapable-unbundleparam.py
+  > EOF
+  $ req
+  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
+  remote: changegroup hook: * (glob)
+  % serve errors
+  $ hg rollback
+  repository tip rolled back to revision 0 (undo serve)
+  $ mv $HGRCPATH.orig $HGRCPATH
+
 expect push success, phase change failure
 
   $ cat > .hg/hgrc <<EOF


More information about the Mercurial-devel mailing list