Patchwork [2,of,4,V2] clone: test streaming disabled because client is missing requirement

login
register
mail settings
Submitter Siddharth Agarwal
Date May 11, 2017, 5:51 p.m.
Message ID <16696b166a70288f05d9.1494525081@devvm028.frc2.facebook.com>
Download mbox | patch
Permalink /patch/20572/
State Accepted
Headers show

Comments

Siddharth Agarwal - May 11, 2017, 5:51 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1494294444 25200
#      Mon May 08 18:47:24 2017 -0700
# Node ID 16696b166a70288f05d9306591d66fdd87c51702
# Parent  b433f29233e32d1c1e665b0c04ae0ef356ce0396
clone: test streaming disabled because client is missing requirement

Turns out we had no coverage for this important case.

Patch

diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
--- a/tests/test-http-bundle1.t
+++ b/tests/test-http-bundle1.t
@@ -66,6 +66,23 @@  try to clone via stream, should use pull
   updating to branch default
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+try to clone via stream but missing requirements, so should use pull instead
+
+  $ cat > $TESTTMP/removesupportedformat.py << EOF
+  > from mercurial import localrepo
+  > def extsetup(ui):
+  >     localrepo.localrepository.supportedformats.remove('generaldelta')
+  > EOF
+
+  $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --uncompressed http://localhost:$HGPORT/ copy3
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 4 changes to 4 files
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
 clone via pull
 
   $ hg clone http://localhost:$HGPORT1/ copy-pull
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -57,6 +57,23 @@  try to clone via stream, should use pull
   updating to branch default
   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
+try to clone via stream but missing requirements, so should use pull instead
+
+  $ cat > $TESTTMP/removesupportedformat.py << EOF
+  > from mercurial import localrepo
+  > def extsetup(ui):
+  >     localrepo.localrepository.supportedformats.remove('generaldelta')
+  > EOF
+
+  $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --uncompressed http://localhost:$HGPORT/ copy3
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 4 changes to 4 files
+  updating to branch default
+  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
 clone via pull
 
   $ hg clone http://localhost:$HGPORT1/ copy-pull