Mercurial > hg
view tests/test-revset-outgoing.t @ 49510:e02dcc625171
revset: handle wdir() in `roots()`
This is already handled in `heads()`, and both are needed to determine if a set
is contiguous.
I'm guessing the `0 <= p` check was to try to filter out the null revision, but
it looks like that comes through in the corner case of a new repo with no
commits. But that was already the case, as shown by the tests.
Before (on a clone of hg):
$ python3.8 hg perf::revset --config extensions.perf=contrib/perf.py 'roots(all())'
! wall 0.059301 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
After:
$ python3.8 hg perf::revset --config extensions.perf=contrib/perf.py 'roots(all())'
! wall 0.059387 comb 0.060000 user 0.060000 sys 0.000000 (best of 100)
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 03 Oct 2022 17:24:52 -0400 |
parents | 95c4cca641f6 |
children |
line wrap: on
line source
$ cat >> $HGRCPATH <<EOF > [alias] > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n" > tglog = tlog -G > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n" > EOF $ hg init a $ cd a $ echo a > a $ hg ci -Aqm0 $ echo foo >> a $ hg ci -Aqm1 $ hg up -q 0 $ hg branch stable marked working directory as branch stable (branches are permanent and global, did you want a bookmark?) $ echo bar >> a $ hg ci -qm2 $ hg tglog @ 2:7bee6c3bea3a: '2' stable | | o 1:3560197d8331: '1' |/ o 0:f7b1eb17ad24: '0' $ cd .. $ hg clone -q a#stable b $ cd b $ cat .hg/hgrc # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/a#stable # path aliases to other clones of this repo in URLs or filesystem paths # (see 'hg help config.paths' for more info) # # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork # my-fork = ssh://jdoe@example.net/hg/jdoes-fork # my-clone = /home/jdoe/jdoes-clone [ui] # name and email (local to this repository, optional), e.g. # username = Jane Doe <jdoe@example.com> $ echo red >> a $ hg ci -qm3 $ hg up -q default $ echo blue >> a $ hg ci -qm4 $ hg tglog @ 3:f0461977a3db: '4' | | o 2:1d4099801a4e: '3' stable | | | o 1:7bee6c3bea3a: '2' stable |/ o 0:f7b1eb17ad24: '0' $ hg tout comparing with $TESTTMP/a searching for changes 2:1d4099801a4e: '3' stable $ hg tlog -r 'outgoing()' 2:1d4099801a4e: '3' stable $ hg tout ../a#default comparing with ../a searching for changes 3:f0461977a3db: '4' $ hg tlog -r 'outgoing("../a#default")' 3:f0461977a3db: '4' $ echo "green = ../a#default" >> .hg/hgrc $ cat .hg/hgrc # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/a#stable # path aliases to other clones of this repo in URLs or filesystem paths # (see 'hg help config.paths' for more info) # # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork # my-fork = ssh://jdoe@example.net/hg/jdoes-fork # my-clone = /home/jdoe/jdoes-clone [ui] # name and email (local to this repository, optional), e.g. # username = Jane Doe <jdoe@example.com> green = ../a#default $ hg tout green abort: repository green does not exist [255] $ hg tlog -r 'outgoing("green")' abort: repository green does not exist [255] $ cd ..