##// END OF EJS Templates
run-tests: don't warn on unnecessary globs mandated by check-code.py...
run-tests: don't warn on unnecessary globs mandated by check-code.py When test output is processed, if os.altsep is defined (i.e. on Windows), TTest.globmatch() will cause a warning later on if a line has a glob that isn't necessary. Unfortunately, the regex checking in check-code.py doesn't have this context. Therefore we ended up with cases where the test would get flagged with a warning only on Windows because a glob was present, because check-code.py would warn if it wasn't. For example, from test-subrepo.t: $ hg -R issue1852a push `pwd`/issue1852c pushing to $TESTTMP/issue1852c (glob) The glob isn't necessary here because the slash is shown as it was provided. However, check-code mandates one to handle the case where the default path has backslashes in it. Break the cycle by checking against a subset of the check-code rules before flagging the test with a warning, and ignore the superfluous glob if it matches a rule. This change fixes warnings in test-largefiles-update.t, test-subrepo.t, test-tag.t, and test-rename-dir-merge.t on Windows. I really hate that the rules are copy/pasted here (minus the leading two spaces) because it would be nice to only update the rules once, in a single place. But I'm not sure how else to do it. I'm open to suggestions. Splitting some of the rules out of check-code.py seems wrong, but so does moving check-code.py out of contrib, given that other checking scripts live there. There are other glob patterns that could be copied over, but this is enough to make the current tests run on Windows.

File last commit:

r23230:7f4f4217 default
r23352:5bd04faa default
Show More
test-status-rev.t
161 lines | 6.3 KiB | text/troff | Tads3Lexer
Tests of 'hg status --rev <rev>' to make sure status between <rev> and '.' get
combined correctly with the dirstate status.
$ hg init
First commit
$ python $TESTDIR/generate-working-copy-states.py base
$ hg addremove --similarity 0
adding content1_content1_content1-tracked
adding content1_content1_content1-untracked
adding content1_content1_content3-tracked
adding content1_content1_content3-untracked
adding content1_content1_missing-tracked
adding content1_content1_missing-untracked
adding content1_content2_content1-tracked
adding content1_content2_content1-untracked
adding content1_content2_content2-tracked
adding content1_content2_content2-untracked
adding content1_content2_content3-tracked
adding content1_content2_content3-untracked
adding content1_content2_missing-tracked
adding content1_content2_missing-untracked
adding content1_missing_content1-tracked
adding content1_missing_content1-untracked
adding content1_missing_content3-tracked
adding content1_missing_content3-untracked
adding content1_missing_missing-tracked
adding content1_missing_missing-untracked
$ hg commit -m first
Second commit
$ python $TESTDIR/generate-working-copy-states.py parent
$ hg addremove --similarity 0
removing content1_missing_content1-tracked
removing content1_missing_content1-untracked
removing content1_missing_content3-tracked
removing content1_missing_content3-untracked
removing content1_missing_missing-tracked
removing content1_missing_missing-untracked
adding missing_content2_content2-tracked
adding missing_content2_content2-untracked
adding missing_content2_content3-tracked
adding missing_content2_content3-untracked
adding missing_content2_missing-tracked
adding missing_content2_missing-untracked
$ hg commit -m second
Working copy
$ python $TESTDIR/generate-working-copy-states.py wc
$ hg addremove --similarity 0
adding content1_missing_content1-tracked
adding content1_missing_content1-untracked
adding content1_missing_content3-tracked
adding content1_missing_content3-untracked
adding content1_missing_missing-tracked
adding content1_missing_missing-untracked
adding missing_missing_content3-tracked
adding missing_missing_content3-untracked
adding missing_missing_missing-tracked
adding missing_missing_missing-untracked
$ hg forget *_*_*-untracked
$ rm *_*_missing-*
Status compared to parent of the working copy, i.e. the dirstate status
$ hg status -A --rev 1 'glob:missing_content2_content3-tracked'
M missing_content2_content3-tracked
$ hg status -A --rev 1 'glob:missing_content2_content2-tracked'
C missing_content2_content2-tracked
$ hg status -A --rev 1 'glob:missing_missing_content3-tracked'
A missing_missing_content3-tracked
$ hg status -A --rev 1 'glob:missing_missing_content3-untracked'
? missing_missing_content3-untracked
$ hg status -A --rev 1 'glob:missing_content2_*-untracked'
R missing_content2_content2-untracked
R missing_content2_content3-untracked
R missing_content2_missing-untracked
$ hg status -A --rev 1 'glob:missing_*_missing-tracked'
! missing_content2_missing-tracked
! missing_missing_missing-tracked
$ hg status -A --rev 1 'glob:missing_missing_missing-untracked'
missing_missing_missing-untracked: No such file or directory
Status between first and second commit. Should ignore dirstate status.
$ hg status -A --rev 0:1 'glob:content1_content2_*'
M content1_content2_content1-tracked
M content1_content2_content1-untracked
M content1_content2_content2-tracked
M content1_content2_content2-untracked
M content1_content2_content3-tracked
M content1_content2_content3-untracked
M content1_content2_missing-tracked
M content1_content2_missing-untracked
$ hg status -A --rev 0:1 'glob:content1_content1_*'
C content1_content1_content1-tracked
C content1_content1_content1-untracked
C content1_content1_content3-tracked
C content1_content1_content3-untracked
C content1_content1_missing-tracked
C content1_content1_missing-untracked
$ hg status -A --rev 0:1 'glob:missing_content2_*'
A missing_content2_content2-tracked
A missing_content2_content2-untracked
A missing_content2_content3-tracked
A missing_content2_content3-untracked
A missing_content2_missing-tracked
A missing_content2_missing-untracked
$ hg status -A --rev 0:1 'glob:content1_missing_*'
R content1_missing_content1-tracked
R content1_missing_content1-untracked
R content1_missing_content3-tracked
R content1_missing_content3-untracked
R content1_missing_missing-tracked
R content1_missing_missing-untracked
$ hg status -A --rev 0:1 'glob:missing_missing_*'
Status compared to one revision back, checking that the dirstate status
is correctly combined with the inter-revision status
$ hg status -A --rev 0 'glob:content1_*_content[23]-tracked'
M content1_content1_content3-tracked
M content1_content2_content2-tracked
M content1_content2_content3-tracked
M content1_missing_content3-tracked
$ hg status -A --rev 0 'glob:content1_*_content1-tracked'
C content1_content1_content1-tracked
C content1_content2_content1-tracked
C content1_missing_content1-tracked
$ hg status -A --rev 0 'glob:missing_*_content?-tracked'
A missing_content2_content2-tracked
A missing_content2_content3-tracked
A missing_missing_content3-tracked
BROKEN: missing_content2_content[23]-untracked exist, so should be listed
$ hg status -A --rev 0 'glob:missing_*_content?-untracked'
? missing_missing_content3-untracked
$ hg status -A --rev 0 'glob:content1_*_*-untracked'
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 content1_missing_content1-untracked
R content1_missing_content3-untracked
R content1_missing_missing-untracked
BROKEN: content1_*_missing-tracked appear twice; should just be '!'
$ hg status -A --rev 0 'glob:*_*_missing-tracked'
R content1_missing_missing-tracked
! content1_content1_missing-tracked
! content1_content2_missing-tracked
! content1_missing_missing-tracked
! missing_content2_missing-tracked
! missing_missing_missing-tracked
C content1_content1_missing-tracked
C content1_content2_missing-tracked
$ hg status -A --rev 0 'glob:missing_*_missing-untracked'