mirror of
https://github.com/facebook/sapling.git
synced 2025-01-01 09:37:56 +03:00
fa1c4e5ebe
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.
70 lines
1.4 KiB
Perl
70 lines
1.4 KiB
Perl
$ cat <<EOF >> $HGRCPATH
|
|
> [extensions]
|
|
> purge =
|
|
> EOF
|
|
|
|
$ hg init test
|
|
$ cd test
|
|
$ echo a > changed
|
|
$ echo a > removed
|
|
$ echo a > source
|
|
$ hg ci -Am addfiles
|
|
adding changed
|
|
adding removed
|
|
adding source
|
|
$ echo a >> changed
|
|
$ echo a > added
|
|
$ hg add added
|
|
$ hg rm removed
|
|
$ hg cp source copied
|
|
$ hg diff --git > ../unknown.diff
|
|
|
|
Test adding on top of an unknown file
|
|
|
|
$ hg up -qC 0
|
|
$ hg purge
|
|
$ echo a > added
|
|
$ hg import --no-commit ../unknown.diff
|
|
applying ../unknown.diff
|
|
file added already exists
|
|
1 out of 1 hunks FAILED -- saving rejects to file added.rej
|
|
abort: patch failed to apply
|
|
[255]
|
|
|
|
Test modifying an unknown file
|
|
|
|
$ hg revert -aq
|
|
$ hg purge
|
|
$ hg rm changed
|
|
$ hg ci -m removechanged
|
|
$ echo a > changed
|
|
$ hg import --no-commit ../unknown.diff
|
|
applying ../unknown.diff
|
|
abort: cannot patch changed: file is not tracked
|
|
[255]
|
|
|
|
Test removing an unknown file
|
|
|
|
$ hg up -qC 0
|
|
$ hg purge
|
|
$ hg rm removed
|
|
$ hg ci -m removeremoved
|
|
created new head
|
|
$ echo a > removed
|
|
$ hg import --no-commit ../unknown.diff
|
|
applying ../unknown.diff
|
|
abort: cannot patch removed: file is not tracked
|
|
[255]
|
|
|
|
Test copying onto an unknown file
|
|
|
|
$ hg up -qC 0
|
|
$ hg purge
|
|
$ echo a > copied
|
|
$ hg import --no-commit ../unknown.diff
|
|
applying ../unknown.diff
|
|
abort: cannot create copied: destination already exists
|
|
[255]
|
|
|
|
$ cd ..
|