Commit Graph

15 Commits

Author SHA1 Message Date
Matt Harbison
d2dab77cb0 tests: add a substitution for ENOENT/ERROR_FILE_NOT_FOUND messages
Automatic replacement seems better than trying to figure out a check-code rule.
I didn't bother looking to see why the error message and file name is reversed
in the annotate and histedit tests, based on Windows or not.

I originally had this as a list of tuples, conditional on the platform.  But
there are a couple of 'No such file or directory' messages emitted by Mercurial
itself, so unconditional is required for stability.  There are also several
variants of what I assume is 'connection refused' and 'unknown host' in
test-clone.t and test-clonebundles.t for Docker, FreeBSD jails, etc.  Yes, these
are handled by (re) tags, but maybe it would be better to capture those strings
in order to avoid whack-a-mole in future tests.  All of this points to using a
dictionary containing one or more strings-to-be-replaced values.
2017-12-02 19:33:34 -05:00
Matt Harbison
27bf97fb7e test-status-rev: conditionalize output instead of tests 2017-07-08 18:46:43 -04:00
Augie Fackler
e5d7bd82c5 cleanup: use $PYTHON to run python in many more tests
Spotted one of these, then wrote a check-code rule that caught them
all. It will be the next change.
2017-06-20 09:45:02 -04:00
Martin von Zweigbergk
c8aa337d29 status: don't list files as both clean and deleted
Tracked files that are deleted should always be reported as such, no
matter what their state was in earlier revisions. This is encoded in
in two conditions in the loop in basectx._buildstatus() for modified
and added files, but the check is missing for clean files. We should
check for clean files too, but instead of adding the check in a third
place, move it earlier and skip most of the loop body for deleted
files.
2015-01-05 17:12:04 -08:00
Martin von Zweigbergk
b1f3f94c3b status: don't list files as both removed and deleted
When calculating status involving the working copy and a revision
other than the parent of the working copy, the files that are not in
the working context manifest ('mf2' in the basectx._buildstatus())
will be reported as removed (note that deleted files _are_ in the
working context manifest). However, if the file is reported as deleted
in the dirstate, it will get that status too (as shown by failing
tests).

Fix by removing deleted files from the 'removed' list after the main
loop in _buildstatus().
2015-01-05 16:52:12 -08:00
Martin von Zweigbergk
06a8686a04 generate-working-copy-states: accept depth arguments on command line
Add a parameter to generate-working-copy-states.py that indicates
how many changesets are wanted. This number impacts all the
subcommands. The current 'filelist' subcommand becomes 'filelist 2',
the current 'base' and 'parent' subcommands become 'state 2 1' and
'state 2 2' respectively, while 'wc' becomes 'state 2 wc'.

See earlier patch for motivation.
2014-11-09 00:10:29 -08:00
Matt Harbison
984e26eb0f tests: handle differences between missing file error strings on Windows and Unix 2014-11-18 23:51:58 -05:00
Martin von Zweigbergk
b95220bf3d test-status-rev: add tests for plain dirstate and inter-revision status
We have tests for the status across from '.^' to the working copy. It
makes sense to have the similar tests for the inter-revision status
between '.^' and '.' and for the dirstate status in the same
place.
2014-11-04 21:45:26 -08:00
Martin von Zweigbergk
8a4af4b97e test-status-rev: remove unnecessary initial commit
The initial commit was there when we had a group of tests that
compared against an empty base, but since those tests no longer exist,
we can drop the empty commit.
2014-11-04 21:22:46 -08:00
Martin von Zweigbergk
60f2edad9c test-status-rev: use one glob for each expected status
It's getting a little hard to read the ~30 calls to 'hg status' with
one per file. Instead, let's use one glob for each expected
status. For example, modified files can be listed with
'glob:content1_*_content[23]-tracked'. That also nicely becomes an
explanation for why each status is expected.
2014-11-04 16:10:20 -08:00
Martin von Zweigbergk
4678ef32d6 test-status-rev: remove duplicate tests
The second group of tests in test-status-rev compare to an empty
revision. The first group of tests that compare to the first commit
should be testing all the same states with the missing_* files, so
drop the second group of tests.
2014-11-04 15:36:35 -08:00
Martin von Zweigbergk
37d5c3b57c test-status-rev: document one more broken test
The status for missing_content2_content2-untracked doesn't get
reported at all. Since the file does exist in the working copy, it
should reported as unknown. Document that in the test.
2014-11-04 12:26:06 -08:00
Martin von Zweigbergk
0e40e3de3f test-status-rev: use common script for generating file history
Start using the generate-working-copy-states.py script that's shared
with test-revert.t, instead of creating the states manually in the
test. This adds several states that are currently missing. We will
start checking those states later.
2014-11-04 16:09:52 -08:00
Martin von Zweigbergk
6fbf7f2f5a test-status-rev: use same names as from generate-working-copy-states
To prepare for using generate-working-copy-states.py for generating
the files and their content, let's start by renaming the files
according to the naming scheme used by that script.
2014-10-20 23:56:55 -07:00
Martin von Zweigbergk
7eeee3a877 status: add more complete tests for --rev
The 'status --rev' code is not very well tested, which has bitten us
as recently as in issue4321. Let's add some more tests, some of which
uncover bugs. Remove the few existing tests that are now covered in a
more thorough and consistent way.
2014-10-12 22:23:43 -07:00