mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
e4c5f94935
Summary: Reduce local heads from unfiltered raw heads to visible heads. Reduce remote heads from all heads to selected heads, plus those explicitly specified via `-r`, `-B`, or via `repo.pull`. This should speed up both pull and push for repos with lots of heads (ex. fbsource), and make fastdiscovery less necessary. Reviewed By: DurhamG Differential Revision: D26207588 fbshipit-source-id: b64485566e0651ad47a5d1ee47e68301ba371e57
56 lines
1.1 KiB
Perl
56 lines
1.1 KiB
Perl
#chg-compatible
|
|
|
|
Test discovery with modern setup: selectivepull, visibility.
|
|
|
|
$ configure modern
|
|
$ enable pushrebase
|
|
|
|
$ newserver server
|
|
|
|
$ clone server client1
|
|
$ clone server client2
|
|
|
|
Push 2 branches to the server.
|
|
|
|
$ cd client1
|
|
|
|
$ drawdag << 'EOS'
|
|
> B C
|
|
> |/
|
|
> A
|
|
> EOS
|
|
|
|
$ hg push -r $B --to master --create -q
|
|
$ hg push -r $C --to other --create -q
|
|
|
|
Pull exchange should only consider 1 remote head (master, B, ignore C), but
|
|
consider all visible local heads (X, Y):
|
|
|
|
$ cd $TESTTMP/client2
|
|
$ drawdag << 'EOS'
|
|
> X Y Z
|
|
> \|/
|
|
> A
|
|
> EOS
|
|
|
|
$ hg hide $Z -q
|
|
|
|
$ hg pull --debug 2>&1 | grep 'remote heads'
|
|
local heads: 2; remote heads: 1 (explicit: 1); initial common: 0
|
|
|
|
$ hg log -G -r 'all()' -T '{desc} {remotenames}'
|
|
o B remote/master
|
|
│
|
|
│ o Y
|
|
├─╯
|
|
│ o X
|
|
├─╯
|
|
o A
|
|
|
|
|
|
Push exchange should only consider heads being pushed (X), and selected remote
|
|
names (master, B, ignore C):
|
|
|
|
$ hg push -r $X --to x --create --debug 2>&1 | grep 'local heads'
|
|
local heads: 1; remote heads: 1 (explicit: 0); initial common: 1
|