infinitepush: wrap findcommonincoming if nodes are requested

Summary:
Previously we don't set findcommonincoming to True, and that bug was unnoticed
because we send this info anyway in server-side `getbundlechunks()` function.

But next diff in the stack uses a fast path server-side which won't work if
fincommonincoming is not set to True.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4770830

Tasks: 15389402

Signature: t1:4770830:1490719209:c251002d992e244580b7dbfeca0c30dff95734d2
This commit is contained in:
Stanislau Hlebik 2017-03-29 03:10:12 -07:00
parent 099ba152f5
commit e094644fb2
3 changed files with 13 additions and 8 deletions

View File

@ -581,6 +581,11 @@ def _pull(orig, ui, repo, source="default", **opts):
source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
scratchbookmarks = {}
unfi = repo.unfiltered()
unknownnodes = []
for rev in opts.get('rev', []):
if rev not in unfi:
unknownnodes.append(rev)
if opts.get('bookmark'):
bookmarks = []
revs = opts.get('rev') or []
@ -623,9 +628,9 @@ def _pull(orig, ui, repo, source="default", **opts):
except error.RepoLookupError:
pass
if scratchbookmarks:
if scratchbookmarks or unknownnodes:
# Set anyincoming to True
wrapfunction(discovery, 'findcommonincoming', _findcommonincoming)
wrapfunction(discovery, 'findcommonincoming', _findcommonincoming)
try:
# Remote scratch bookmarks will be deleted because remotenames doesn't
# know about them. Let's save it before pull and restore after

View File

@ -614,11 +614,11 @@ Make sure testpullbycommithash2 has not fetched
$ hg pull -r `cat ../testpullbycommithash1`
pulling from ssh://user@dummy/repo
searching for changes
no changes found
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
$ hg log -G -T '{desc} {phase} {bookmarks}'
o testpullbycommithash1 draft
|
@ -676,11 +676,11 @@ Strip scratchontopofpublic commit and do hg update
'c70aee6da07d7cdb9897375473690df3a8563339' does not exist locally - looking for it remotely...
pulling from ssh://user@dummy/repo
searching for changes
no changes found
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
'c70aee6da07d7cdb9897375473690df3a8563339' found remotely
2 files updated, 0 files merged, 2 files removed, 0 files unresolved

View File

@ -31,11 +31,11 @@ Restore
$ cd restored
$ hg pullbackup
pulling from ssh://user@dummy/repo
no changes found
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
$ hg log --graph -T '{desc}'
o firstcommit
@ -66,11 +66,11 @@ Restore with ambiguous repo root
[255]
$ hg pullbackup --reporoot $TESTTMP/backupsource2
pulling from ssh://user@dummy/repo
no changes found
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
$ hg log --graph -T '{desc}'
o secondcommit
@ -87,11 +87,11 @@ Check bookmarks escaping
$ hg pullbackup --reporoot $TESTTMP/backupsource
pulling from ssh://user@dummy/repo
searching for changes
no changes found
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg book
abook 1:89ecc969c0ac
book/bookmarks/somebook 1:89ecc969c0ac
@ -116,11 +116,11 @@ Create a repo with `/bookmarks/` in path
$ hg pullbackup --reporoot $TESTTMP/bookmarks/backupsource3
pulling from ssh://user@dummy/repo
searching for changes
no changes found
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
(run 'hg heads .' to see heads, 'hg merge' to merge)
$ hg book
abook 1:89ecc969c0ac
book/bookmarks/somebook 1:89ecc969c0ac