mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
f0dcadfa28
Summary: The old code basically selects ancestors of heads. Rewrite the logic using revsets. Assuming we're only interested in ancestors that are drafts, we can take advantage of `draft() & ::x` optimization. The new logic also assumes master rev is public. Otherwise it can be slightly different from the old logic. The new code is much faster on my repo: New code: quark@devvm33994 ~/fbcode/scm/hg % ./hg log -r 'smartlog()' --hidden -T . --time | wc -c time: real 0.630 secs (user 0.550+0.000 sys 0.030+0.000) 6716 Old code: quark@devvm33994 ~/fbcode/scm/hg % hg.real log -r 'smartlog()' --hidden -T . --time | wc -c time: real 5.470 secs (user 3.920+0.000 sys 1.550+0.000) 6716 This might make the ancestorcache hack (D5135746) unnecessary. Reviewed By: DurhamG, sfilipco Differential Revision: D14436008 fbshipit-source-id: 3c3bf47ccb67ea0e238542995009da9b9250b43b
40 lines
871 B
Perl
40 lines
871 B
Perl
$ cat >> $HGRCPATH << EOF
|
|
> [extensions]
|
|
> amend=
|
|
> smartlog=
|
|
> [experimental]
|
|
> evolution = createmarkers
|
|
> EOF
|
|
|
|
Test that changesets with visible precursors are rendered as x's
|
|
$ hg init repo
|
|
$ cd repo
|
|
$ hg debugbuilddag +4
|
|
$ hg book -r 3 test
|
|
$ hg up 1
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ hg amend -m "amended" --no-rebase
|
|
hint[amend-restack]: descendants of 66f7d451a68b are left behind - use 'hg restack' to rebase them
|
|
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
|
|
$ hg smartlog -T '{rev} {bookmarks}'
|
|
@ 4
|
|
|
|
|
| o 3 test
|
|
| |
|
|
| o 2
|
|
| |
|
|
| x 1
|
|
|/
|
|
o 0
|
|
|
|
$ hg unamend
|
|
$ hg up 2
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
$ hg phase -r '.' --public
|
|
$ hg smartlog -T '{rev} {bookmarks}'
|
|
o 3 test
|
|
|
|
|
@ 2
|
|
|
|
|
~
|