Mercurial > hg
comparison tests/test-revset2.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 | 8c4881c07f57 |
children | 117dcc4a0e67 |
comparison
equal
deleted
inserted
replaced
49509:946c023212b8 | 49510:e02dcc625171 |
---|---|
1479 prepare repository that has "default" branches of multiple roots | 1479 prepare repository that has "default" branches of multiple roots |
1480 | 1480 |
1481 $ hg init namedbranch | 1481 $ hg init namedbranch |
1482 $ cd namedbranch | 1482 $ cd namedbranch |
1483 | 1483 |
1484 $ log 'roots(.)' | |
1485 -1 | |
1486 $ log 'roots(. or wdir())' | |
1487 -1 | |
1488 $ log 'roots(wdir())' | |
1489 2147483647 | |
1490 | |
1484 $ echo default0 >> a | 1491 $ echo default0 >> a |
1485 $ hg ci -Aqm0 | 1492 $ hg ci -Aqm0 |
1486 $ echo default1 >> a | 1493 $ echo default1 >> a |
1487 $ hg ci -m1 | 1494 $ hg ci -m1 |
1488 | 1495 |
1495 $ hg update -q null | 1502 $ hg update -q null |
1496 $ echo default4 >> a | 1503 $ echo default4 >> a |
1497 $ hg ci -Aqm4 | 1504 $ hg ci -Aqm4 |
1498 $ echo default5 >> a | 1505 $ echo default5 >> a |
1499 $ hg ci -m5 | 1506 $ hg ci -m5 |
1507 | |
1508 $ log 'roots(. or wdir())' | |
1509 5 | |
1510 $ log 'roots(wdir())' | |
1511 2147483647 | |
1500 | 1512 |
1501 "null" revision belongs to "default" branch (issue4683) | 1513 "null" revision belongs to "default" branch (issue4683) |
1502 | 1514 |
1503 $ log 'branch(null)' | 1515 $ log 'branch(null)' |
1504 0 | 1516 0 |