Patchwork D1956: streamclonebundle: add a test for stream clone bundle v2

login
register
mail settings
Submitter phabricator
Date Jan. 31, 2018, 4:25 p.m.
Message ID <differential-rev-PHID-DREV-b2cjlojy4d2hcs7i5j4w-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27091/
State New
Headers show

Comments

phabricator - Jan. 31, 2018, 4:25 p.m.
lothiraldan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1956

AFFECTED FILES
  tests/test-stream-bundle-v2.t

CHANGE DETAILS




To: lothiraldan, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-stream-bundle-v2.t b/tests/test-stream-bundle-v2.t
--- a/tests/test-stream-bundle-v2.t
+++ b/tests/test-stream-bundle-v2.t
@@ -21,6 +21,7 @@ 
   > publish=False
   > [extensions]
   > drawdag=$TESTDIR/drawdag.py
+  > clonebundles=
   > EOF
 
 The extension requires a repo (currently unused)
@@ -46,3 +47,68 @@ 
   stream2 -- {bytecount: 1693, filecount: 11, requirements: dotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Cstore}
   $ hg debugbundle --spec bundle.hg
   none-v2;stream=v2;requirements%3Ddotencode%2Cfncache%2Cgeneraldelta%2Crevlogv1%2Cstore
+
+Test that we can apply the bundle as a stream clone bundle
+
+  $ cat > .hg/clonebundles.manifest << EOF
+  > http://localhost:$HGPORT1/bundle.hg BUNDLESPEC=`hg debugbundle --spec bundle.hg`
+  > EOF
+
+  $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
+  $ cat hg.pid >> $DAEMON_PIDS
+
+  $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
+  $ cat http.pid >> $DAEMON_PIDS
+
+  $ cd ..
+  $ hg clone http://localhost:$HGPORT streamv2-clone-implicit --debug
+  using http://localhost:$HGPORT/
+  sending capabilities command
+  sending clonebundles command
+  applying clone bundle from http://localhost:$HGPORT1/bundle.hg
+  bundle2-input-bundle: with-transaction
+  bundle2-input-part: "stream2" (params: 3 mandatory) supported
+  applying stream bundle
+  11 files to transfer, 1.65 KB of data
+  adding [s] data/A.i (66 bytes)
+  adding [s] data/B.i (66 bytes)
+  adding [s] data/C.i (66 bytes)
+  adding [s] data/D.i (66 bytes)
+  adding [s] data/E.i (66 bytes)
+  adding [s] 00manifest.i (584 bytes)
+  adding [s] 00changelog.i (595 bytes)
+  adding [s] phaseroots (43 bytes)
+  adding [c] branch2-served (94 bytes)
+  adding [c] rbc-names-v1 (7 bytes)
+  adding [c] rbc-revs-v1 (40 bytes)
+  transferred 1.65 KB in \d\.\d seconds \(.*/sec\) (re)
+  bundle2-input-part: total payload size 1840
+  bundle2-input-bundle: 0 parts total
+  finished applying clone bundle
+  query 1; heads
+  sending batch command
+  searching for changes
+  all remote heads known locally
+  no changes found
+  sending getbundle command
+  bundle2-input-bundle: with-transaction
+  bundle2-input-part: "listkeys" (params: 1 mandatory) supported
+  bundle2-input-part: "phase-heads" supported
+  bundle2-input-part: total payload size 24
+  bundle2-input-bundle: 1 parts total
+  checking for updated bookmarks
+  updating to branch default
+  resolving manifests
+   branchmerge: False, force: False, partial: False
+   ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
+   A: remote created -> g
+  getting A
+   B: remote created -> g
+  getting B
+   C: remote created -> g
+  getting C
+   D: remote created -> g
+  getting D
+   E: remote created -> g
+  getting E
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved