Skip to content
Snippets Groups Projects
Commit cd403d6d authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

incoming: fix incoming when a local head is remotely filtered (issue3805)

In its current state discovery may return (remotely) filtered elements
in "common". This has usually no impact as "missing" is kept clear of
filtered elements. However when the "remote" repo is a local repo (disk
accessible, and directly created in memory) the incoming code takes a
shortcut and directly uses the "remote" repo to generate the incoming
output. When some common elements are filtered this led to a crash. We
now ensure we use an unfiltered repository to generate the incoming
output. This does not change the behavior as missing is clear of
filtered revision.

Now that we have proper low level filtering, incoming code needs a
deeper cleanup but it is already planned.
parent 6d098adc
No related branches found
No related tags found
No related merge requests found
......@@ -367,6 +367,11 @@
localrepo = bundlerepo = bundlerepository(ui, repo.root, fname)
# this repo contains local and other now, so filter out local again
common = repo.heads()
if localrepo:
# Part of common may be remotely filtered
# So use an unfiltered version
# The discovery process probably need cleanup to avoid that
localrepo = localrepo.unfiltered()
csets = localrepo.changelog.findmissing(common, rheads)
......
......@@ -776,4 +776,10 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: add celestine
reenable for later test
$ echo '[extensions]' >> $HGRCPATH
$ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
#endif
......@@ -779,1 +785,83 @@
#endif
Test incoming/outcoming with changesets obsoleted remotely, known locally
===============================================================================
This test issue 3805
$ hg init repo-issue3805
$ cd repo-issue3805
$ echo "foo" > foo
$ hg ci -Am "A"
adding foo
$ hg clone . ../other-issue3805
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo "bar" >> foo
$ hg ci --amend
$ cd ../other-issue3805
$ hg log -G
@ changeset: 0:193e9254ce7e
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: A
$ hg log -G -R ../repo-issue3805
@ changeset: 2:3816541e5485
tag: tip
parent: -1:000000000000
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: A
$ hg incoming
comparing with $TESTTMP/tmpe/repo-issue3805
searching for changes
changeset: 2:3816541e5485
tag: tip
parent: -1:000000000000
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: A
$ hg incoming --bundle ../issue3805.hg
comparing with $TESTTMP/tmpe/repo-issue3805
searching for changes
changeset: 2:3816541e5485
tag: tip
parent: -1:000000000000
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: A
$ hg outgoing
comparing with $TESTTMP/tmpe/repo-issue3805
searching for changes
no changes found
[1]
#if serve
$ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
$ cat hg.pid >> $DAEMON_PIDS
$ hg incoming http://localhost:$HGPORT
comparing with http://localhost:$HGPORT/
searching for changes
changeset: 1:3816541e5485
tag: tip
parent: -1:000000000000
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: A
$ hg outgoing http://localhost:$HGPORT
comparing with http://localhost:$HGPORT/
searching for changes
no changes found
[1]
$ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment