Patchwork D6267: incoming: detect if server send partial replies

login
register
mail settings
Submitter phabricator
Date April 17, 2019, 11:31 p.m.
Message ID <f36c2d32953985060cbb63bbd315e9c1@localhost.localdomain>
Download mbox | patch
Permalink /patch/39736/
State Not Applicable
Headers show

Comments

phabricator - April 17, 2019, 11:31 p.m.
joerg.sonnenberger updated this revision to Diff 14835.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6267?vs=14808&id=14835

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

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

CHANGE DETAILS




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

Patch

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: the server did not send all changes; the follow list is incomplete
+  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,11 @@ 
         # The discovery process probably need cleanup to avoid that
         localrepo = localrepo.unfiltered()
 
+        hasnode = localrepo.changelog.hasnode
+        if rheads and any(not hasnode(x) for x in rheads):
+            ui.warn(_("warning: the server did not send all changes; "
+                      "the follow list is incomplete\n"))
+            rheads = [x for x in rheads if hasnode(x)]
     csets = localrepo.changelog.findmissing(common, rheads)
 
     if bundlerepo: