bundle2: don't send "shared" requirement when cloning from a share
authormitchell plamann <mplamann@janestreet.com>
Wed, 20 Feb 2019 15:02:59 -0500
changeset 41801 2d835c42ab41
parent 41800 a62ad1be1671
child 41802 68bbcc70e274
bundle2: don't send "shared" requirement when cloning from a share Differential Revision: https://phab.mercurial-scm.org/D5985
mercurial/bundle2.py
tests/test-share.t
--- a/mercurial/bundle2.py	Wed Feb 20 14:57:00 2019 -0500
+++ b/mercurial/bundle2.py	Wed Feb 20 15:02:59 2019 -0500
@@ -1664,6 +1664,7 @@
                     mandatory=False)
 
 def _formatrequirementsspec(requirements):
+    requirements = [req for req in requirements if req != "shared"]
     return urlreq.quote(','.join(sorted(requirements)))
 
 def _formatrequirementsparams(requirements):
--- a/tests/test-share.t	Wed Feb 20 14:57:00 2019 -0500
+++ b/tests/test-share.t	Wed Feb 20 15:02:59 2019 -0500
@@ -124,15 +124,14 @@
   -rw-r--r-- 2 b
   
   
-Cloning a shared repo via bundle2 wrongly adds "shared" to the clone's requirements
+Cloning a shared repo via bundle2 results in a non-shared clone
 
   $ cd ..
   $ hg clone -q --stream --config ui.ssh="$PYTHON \"$TESTDIR/dummyssh\"" ssh://user@dummy/`pwd`/repo2 cloned-via-bundle2
   $ cat ./cloned-via-bundle2/.hg/requires | grep "shared"
-  shared
+  [1]
   $ hg id --cwd cloned-via-bundle2 -r tip
-  abort: $ENOENT$: '$TESTTMP/cloned-via-bundle2/.hg/sharedpath'
-  [255]
+  c2e0ac586386 tip
   $ cd repo2
 
 test unshare command