mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
856e8ab3ef
Summary: Re-implement the `findcommonheads` logic using `changelog` APIs that are going to have native support from Rust. This decouples from revlog-based Python DAG logic, namely `dagutil.revlogdag`, and `ancestor.incrementalmissingancestors`, unblocking Rust DAG progress, and cleans up the algorithm to not use revision numbers. The core algorithm is unchanged. The sampling logic is simplified and tweaked a bit (ex. no 'initial' / 'quick initial' special cases). The debug and progress messages are more verbose, and variable names are chosen to match the docstrings. I improved the doc a bit, and added some TODO notes about where I think can be improved. Reviewed By: sfilipco Differential Revision: D22519582 fbshipit-source-id: ac8cc8bebad91b4045d69f402e69b7ca28146414
74 lines
2.2 KiB
Perl
74 lines
2.2 KiB
Perl
$ . "$TESTDIR/library.sh"
|
|
$ setconfig devel.print-metrics=1
|
|
|
|
|
|
$ hginit master
|
|
$ cd master
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [treemanifest]
|
|
> server=True
|
|
> [remotefilelog]
|
|
> server=True
|
|
> EOF
|
|
$ echo x > x
|
|
$ hg commit -qAm 'add x'
|
|
$ cd ..
|
|
|
|
$ hgcloneshallow ssh://user@dummy/master client -q
|
|
fetching tree '' bc0c2c938b929f98b1c31a8c5994396ebb096bf0
|
|
1 trees fetched over * (glob)
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob) (?)
|
|
{ metrics : { ssh : { connections : 2,
|
|
getpack : { calls : 1, revs : 1},
|
|
gettreepack : { basemfnodes : 0,
|
|
calls : 1,
|
|
mfnodes : 1},
|
|
read : { bytes : 2002},
|
|
write : { bytes : 976}}}}
|
|
$ cd client
|
|
$ cat >> .hg/hgrc <<EOF
|
|
> [treemanifest]
|
|
> autocreatetrees=True
|
|
> EOF
|
|
|
|
Test auto creating trees for merge commit
|
|
$ cd ../master
|
|
$ hg up -q null
|
|
$ echo z >> z
|
|
$ hg commit -qAm 'add z'
|
|
$ hg up -q 0
|
|
$ hg merge -q -r 1
|
|
$ hg commit -qAm 'merge'
|
|
|
|
$ cd ../client
|
|
$ hg pull
|
|
pulling from ssh://user@dummy/master
|
|
searching for changes
|
|
adding changesets
|
|
adding manifests
|
|
adding file changes
|
|
added 2 changesets with 0 changes to 0 files
|
|
{ metrics : { ssh : { connections : 1,
|
|
read : { bytes : 1135},
|
|
write : { bytes : 667}}}}
|
|
$ hg manifest -r tip
|
|
fetching tree '' 13532a59874531175abc845749c0491b36effb18, found via 92f4ca0e667c
|
|
1 trees fetched over 0.00s
|
|
x
|
|
z
|
|
{ metrics : { ssh : { connections : 1,
|
|
gettreepack : { basemfnodes : 0,
|
|
calls : 1,
|
|
mfnodes : 1},
|
|
read : { bytes : 882},
|
|
write : { bytes : 222}}}}
|
|
$ hg debughistorypack $TESTTMP/hgcache/master/packs/manifests/*.histidx
|
|
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
|
13532a598745 bc0c2c938b92 ddb35f099a64 92f4ca0e667c
|
|
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
|
bc0c2c938b92 000000000000 000000000000 085784c01c08
|