D6267: incoming: detect if server send partial replies

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Wed Apr 17 17:36:55 EDT 2019


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

REVISION SUMMARY
  incoming is not using the normal exchange logic and therefore doesn't
  know how to tell with pullbundles. Fixing that is involved and it is
  currently not sure if the current incoming code will survive, so apply a
  band aid for now.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/bundlerepo.py
  tests/test-pull-bundle.t

CHANGE DETAILS

diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t
--- a/tests/test-pull-bundle.t
+++ b/tests/test-pull-bundle.t
@@ -136,20 +136,21 @@
   updating to branch default
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd repo.pullbundle2a
-  $ hg incoming -r ed1b79f46b9a
+  $ hg incoming
   comparing with http://localhost:$HGPORT2/
   searching for changes
-  changeset:   1:ed1b79f46b9a
+  warning: partial reply from server
+  changeset:   1:effea6de0384
   tag:         tip
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     change foo
+  summary:     add bar
   
   $ cd ..
   $ killdaemons.py
   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
   * sending pullbundle "0.hg" (glob)
-  * sending pullbundle "1.hg" (glob)
+  * sending pullbundle "2.hg" (glob)
   $ rm repo/.hg/blackbox.log
 
 Test recovery from misconfigured server sending no new data
diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py
+++ b/mercurial/bundlerepo.py
@@ -636,6 +636,9 @@
         # The discovery process probably need cleanup to avoid that
         localrepo = localrepo.unfiltered()
 
+        if rheads and any(x not in localrepo for x in rheads):
+            ui.warn(_("warning: partial reply from server\n"))
+            rheads = [x for x in rheads if x in localrepo]
     csets = localrepo.changelog.findmissing(common, rheads)
 
     if bundlerepo:



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list