Commit Graph

10 Commits

Author SHA1 Message Date
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Greg Ward
cf0ea44613 rollback: only restore dirstate and branch when appropriate.
If the working dir parent was destroyed by rollback, then the old
behaviour is perfectly reasonable: restore dirstate, branch, and
bookmarks. That way the working dir moves back to an existing
changeset rather than becoming an orphan.

But if the working dir parent was unaffected -- say, you updated to an
older changeset and then did rollback -- then it's silly to restore
dirstate and branch. So don't do that. Leave the status of the working
dir alone. (But always restore bookmarks, because that file refers to
changeset IDs that may have been destroyed.)
2011-09-18 19:59:33 -04:00
Patrick Mezard
99858baa84 eol: improve hook failure output
Before, only the first failure was reported:

  abort: b.txt should not have CRLF line endings

while now all of them are listed:

  abort: end-of-line check failed:
    d.txt in a7040e68714f should not have CRLF line endings
    b.txt in fbcf9b1025f5 should not have CRLF line endings

As first suggested by Antoine Pitrou <solipsis@pitrou.net>
2011-03-14 21:08:18 +01:00
Patrick Mezard
d52fb5d6ab eol: rename hook into checkheadshook, add checkallhook (issue2665)
"hook" is still an alias for "checkheadshook".
2011-03-13 15:07:44 +01:00
Patrick Mezard
25db85f436 eol: make the hook check all new heads, not only tip (issue2666)
Report and test by Antoine Pitrou <solipsis@pitrou.net>
2011-03-13 15:07:44 +01:00
Patrick Mezard
31042d7b6f eol: the hook no longer requires the extension to be loaded
Reading rules in the hook means we no longer need ui to be filled and do not
need reposetup() to be run anymore.
2011-03-13 15:07:44 +01:00
Martin Geisler
27c7ce1873 test-eol-*: remove unused config settings 2011-03-02 14:16:11 +01:00
Martin Geisler
83c27fb95f tests: don't overwrite HGRCPATH
Overwriting instead of appending to the file removes the [defaults]
section put into the file by run-tests.py.

It also defeats the --inotify option to run-tests.py.

(Nothing was broken yet, but the lack of -d "0 0" cause changeset
hashes to change unexpectedly in a test case I was editing.)
2011-03-01 17:01:17 +01:00
Antoine Pitrou
a5201c7f89 eol: stop after first matched rule in hook (issue2660)
When matching a file against the rules in .hgeol, the eol extension's
hook should stop after the first matching rule is encountered.
Otherwise, if this rule is contradicted by other more general rule
(for example a catch-all at the end of .hgeol), some files are simply
impossible to push. Trivial example:

  **.bat = CRLF
  **     = LF

If all matching rules were applied, a .bat file would be rejected
either because it has LFs (first rule) or because it has CRLFs (second
rule).
2011-02-27 19:50:28 +01:00
Matt Mackall
7b5f9a10ba tests: unify test-eol-hook 2010-09-26 13:41:32 -05:00