##// END OF EJS Templates
revisions: allow "x123" to refer to nodeid prefix "123"...
revisions: allow "x123" to refer to nodeid prefix "123" When resolving "123" to a revision, we try to interpret it as revnum before we try to interpret it as a nodeid hex prefix. This can lead to the shortest valid prefix being longer than necessary. This patch lets us write such nodeids in a shorter form by prefixing them with "x" instead of adding more hex digits until they're longer than the longest decimal revnum. On my hg repo with almost 69k revisions, turning this feature on saves on average 0.4% on the average nodeid length. That clearly doesn't justify this patch. However, it becomes more usefule when combined with the earlier patches in this series that let you disambiguate nodeid prefixes within a configured revset. Note that we attempt to resolve symbols as nodeid prefixes after we've exhausted all other posibilities, so this is a backwards compatible change (only queries that would previously fail may now succeed). I've still hidden this feature behind an experiemntal config option so we can roll it back if needed. Differential Revision: https://phab.mercurial-scm.org/D4041

File last commit:

r33209:fe0667cc default
r38891:7848f284 default
Show More
test-fileset-generated.t
198 lines | 6.4 KiB | text/troff | Tads3Lexer
/ tests / test-fileset-generated.t
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg init
Set up history and working copy
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 1
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg addremove -q --similarity 0
$ hg commit -m first
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 2
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg addremove -q --similarity 0
$ hg commit -m second
Augie Fackler
cleanup: use $PYTHON to run python in many more tests...
r32940 $ $PYTHON $TESTDIR/generate-working-copy-states.py state 2 wc
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg addremove -q --similarity 0
$ hg forget *_*_*-untracked
$ rm *_*_missing-*
Test status
$ hg st -A 'set:modified()'
M content1_content1_content3-tracked
M content1_content2_content1-tracked
M content1_content2_content3-tracked
M missing_content2_content3-tracked
$ hg st -A 'set:added()'
A content1_missing_content1-tracked
A content1_missing_content3-tracked
A missing_missing_content3-tracked
$ hg st -A 'set:removed()'
R content1_content1_content1-untracked
R content1_content1_content3-untracked
R content1_content1_missing-untracked
R content1_content2_content1-untracked
R content1_content2_content2-untracked
R content1_content2_content3-untracked
R content1_content2_missing-untracked
R missing_content2_content2-untracked
R missing_content2_content3-untracked
R missing_content2_missing-untracked
$ hg st -A 'set:deleted()'
! content1_content1_missing-tracked
! content1_content2_missing-tracked
! content1_missing_missing-tracked
! missing_content2_missing-tracked
! missing_missing_missing-tracked
liscju
fileset: add missing() predicate (issue4925)...
r27024 $ hg st -A 'set:missing()'
! content1_content1_missing-tracked
! content1_content2_missing-tracked
! content1_missing_missing-tracked
! missing_content2_missing-tracked
! missing_missing_missing-tracked
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg st -A 'set:unknown()'
? content1_missing_content1-untracked
? content1_missing_content3-untracked
? missing_missing_content3-untracked
$ hg st -A 'set:clean()'
C content1_content1_content1-tracked
C content1_content2_content2-tracked
C missing_content2_content2-tracked
Test log
$ hg log -T '{rev}\n' --stat 'set:modified()'
1
content1_content2_content1-tracked | 2 +-
content1_content2_content3-tracked | 2 +-
missing_content2_content3-tracked | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
0
content1_content1_content3-tracked | 1 +
content1_content2_content1-tracked | 1 +
content1_content2_content3-tracked | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
Matt Harbison
largefiles: don't mangle filesets when fixing up the log matcher...
r24813 Largefiles doesn't crash
$ hg log -T '{rev}\n' --stat 'set:modified()' --config extensions.largefiles=
FUJIWARA Katsunori
tests: add fsmonitor specific output lines at enabling largefiles...
r33209 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
Matt Harbison
largefiles: don't mangle filesets when fixing up the log matcher...
r24813 1
content1_content2_content1-tracked | 2 +-
content1_content2_content3-tracked | 2 +-
missing_content2_content3-tracked | 1 +
3 files changed, 3 insertions(+), 2 deletions(-)
0
content1_content1_content3-tracked | 1 +
content1_content2_content1-tracked | 1 +
content1_content2_content3-tracked | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg log -T '{rev}\n' --stat 'set:added()'
1
content1_missing_content1-tracked | 1 -
content1_missing_content3-tracked | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
Martin von Zweigbergk
log: evaluate filesets on working copy, not its parent...
r23950 0
content1_missing_content1-tracked | 1 +
content1_missing_content3-tracked | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg log -T '{rev}\n' --stat 'set:removed()'
1
content1_content2_content1-untracked | 2 +-
content1_content2_content2-untracked | 2 +-
content1_content2_content3-untracked | 2 +-
content1_content2_missing-untracked | 2 +-
missing_content2_content2-untracked | 1 +
missing_content2_content3-untracked | 1 +
missing_content2_missing-untracked | 1 +
7 files changed, 7 insertions(+), 4 deletions(-)
0
content1_content1_content1-untracked | 1 +
content1_content1_content3-untracked | 1 +
content1_content1_missing-untracked | 1 +
content1_content2_content1-untracked | 1 +
content1_content2_content2-untracked | 1 +
content1_content2_content3-untracked | 1 +
content1_content2_missing-untracked | 1 +
7 files changed, 7 insertions(+), 0 deletions(-)
Martin von Zweigbergk
log: evaluate filesets on working copy, not its parent...
r23950
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg log -T '{rev}\n' --stat 'set:deleted()'
Martin von Zweigbergk
log: evaluate filesets on working copy, not its parent...
r23950 1
content1_content2_missing-tracked | 2 +-
content1_missing_missing-tracked | 1 -
missing_content2_missing-tracked | 1 +
3 files changed, 2 insertions(+), 2 deletions(-)
0
content1_content1_missing-tracked | 1 +
content1_content2_missing-tracked | 1 +
content1_missing_missing-tracked | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg log -T '{rev}\n' --stat 'set:unknown()'
Martin von Zweigbergk
log: evaluate filesets on working copy, not its parent...
r23950 1
content1_missing_content1-untracked | 1 -
content1_missing_content3-untracked | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
0
content1_missing_content1-untracked | 1 +
content1_missing_content3-untracked | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 $ hg log -T '{rev}\n' --stat 'set:clean()'
Martin von Zweigbergk
log: evaluate filesets on working copy, not its parent...
r23950 1
content1_content2_content2-tracked | 2 +-
missing_content2_content2-tracked | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 0
content1_content1_content1-tracked | 1 +
content1_content2_content2-tracked | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)
Test revert
$ hg revert 'set:modified()'
reverting content1_content1_content3-tracked
reverting content1_content2_content1-tracked
reverting content1_content2_content3-tracked
reverting missing_content2_content3-tracked
$ hg revert 'set:added()'
forgetting content1_missing_content1-tracked
forgetting content1_missing_content3-tracked
forgetting missing_missing_content3-tracked
$ hg revert 'set:removed()'
undeleting content1_content1_content1-untracked
undeleting content1_content1_content3-untracked
undeleting content1_content1_missing-untracked
Martin von Zweigbergk
revert: evaluate filesets against working directory (issue4497)...
r24438 undeleting content1_content2_content1-untracked
undeleting content1_content2_content2-untracked
undeleting content1_content2_content3-untracked
undeleting content1_content2_missing-untracked
undeleting missing_content2_content2-untracked
undeleting missing_content2_content3-untracked
undeleting missing_content2_missing-untracked
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949
$ hg revert 'set:deleted()'
reverting content1_content1_missing-tracked
Martin von Zweigbergk
revert: evaluate filesets against working directory (issue4497)...
r24438 reverting content1_content2_missing-tracked
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 forgetting content1_missing_missing-tracked
Martin von Zweigbergk
revert: evaluate filesets against working directory (issue4497)...
r24438 reverting missing_content2_missing-tracked
Martin von Zweigbergk
fileset: add tests of generated working copy states
r23949 forgetting missing_missing_missing-tracked
$ hg revert 'set:unknown()'
$ hg revert 'set:clean()'