D3072: tests: add tests showing pulling from infinitepush works over wire

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Wed Apr 4 12:27:41 UTC 2018


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  The current tests in test-infinitepush-ci.t showed that `hg pull -r <rev>` does
  not work. Digging in code, I found that we have logic for pulling from
  bundlestore without having client side logic. This patch adds test demonstrating
  that pulling from bundlestore works when working over wire.
  Pulling from bundlestore when the peer is a localpeer still does not works.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  tests/test-infinitepush-ci.t

CHANGE DETAILS

diff --git a/tests/test-infinitepush-ci.t b/tests/test-infinitepush-ci.t
--- a/tests/test-infinitepush-ci.t
+++ b/tests/test-infinitepush-ci.t
@@ -7,6 +7,8 @@
 
   $ . "$TESTDIR/library-infinitepush.sh"
   $ cat >> $HGRCPATH <<EOF
+  > [ui]
+  > ssh = python "$TESTDIR/dummyssh"
   > [alias]
   > glog = log -GT "{rev}:{node|short} {desc}\n{phase}"
   > EOF
@@ -24,6 +26,7 @@
   $ cd ..
   $ hg clone repo client -q
   $ hg clone repo client2 -q
+  $ hg clone ssh://user@dummy/repo client3 -q
   $ cd client
 
 Pushing a new commit from the client to the server
@@ -173,8 +176,8 @@
   searching for changes
   no changes found
 
-Pulling from second client to test `hg pull -r <rev>`
-------------------------------------------------------
+Pulling from second client which is a localpeer to test `hg pull -r <rev>`
+--------------------------------------------------------------------------
 
 Pulling the revision which is applied
 
@@ -195,8 +198,8 @@
      public
 
 Pulling the revision which is in bundlestore
-XXX: we should support pulling revisions from bundlestore without client side
-wrapping
+XXX: we should support pulling revisions from a local peers bundlestore without
+client side wrapping
 
   $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
   pulling from $TESTTMP/repo
@@ -210,6 +213,62 @@
 
   $ cd ../client
 
+Pulling from third client which is not a localpeer
+---------------------------------------------------
+
+Pulling the revision which is applied
+
+  $ cd ../client3
+  $ hg pull -r 6cb0989601f1
+  pulling from ssh://user@dummy/repo
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 1 changesets with 1 changes to 1 files
+  new changesets 6cb0989601f1
+  (run 'hg update' to get a working copy)
+  $ hg glog
+  o  1:6cb0989601f1 added a
+  |  public
+  @  0:67145f466344 initialcommit
+     public
+
+Pulling the revision which is in bundlestore
+
+Trying to specify short hash
+XXX: we should support this
+  $ hg pull -r b4e4bce660512
+  pulling from ssh://user@dummy/repo
+  abort: unknown revision 'b4e4bce660512'!
+  [255]
+
+XXX: we should show better message when the pull is happening from bundlestore
+  $ hg pull -r b4e4bce660512ad3e71189e14588a70ac8e31fef
+  pulling from ssh://user@dummy/repo
+  searching for changes
+  no changes found
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 4 changes to 4 files
+  new changesets eaba929e866c:b4e4bce66051
+  $ hg glog
+  o  5:b4e4bce66051 added e
+  |  public
+  o  4:1bb96358eda2 added d
+  |  public
+  o  3:bf8a6e3011b3 added c
+  |  public
+  o  2:eaba929e866c added b
+  |  public
+  o  1:6cb0989601f1 added a
+  |  public
+  @  0:67145f466344 initialcommit
+     public
+
+  $ cd ../client
+
 Checking storage of phase information with the bundle on bundlestore
 ---------------------------------------------------------------------
 



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


More information about the Mercurial-devel mailing list