D6267: incoming: detect if server send partial replies
joerg.sonnenberger (Joerg Sonnenberger)
phabricator at mercurial-scm.org
Wed Apr 17 19:31:47 EDT 2019
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
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:
To: joerg.sonnenberger, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
More information about the Mercurial-devel
mailing list