Details
Details
- Reviewers
spectral martinvonz - Commits
- rNRWHGe2d43877d7e8: tests: appease check-code on `grep -q`
Diff Detail
Diff Detail
- Repository
- rNRWHG narrowhg
- Lint
Lint Skipped - Unit
Unit Tests Skipped
spectral | |
martinvonz |
Lint Skipped |
Unit Tests Skipped |
Do that for patchdir as well. | Do that for patchdir as well. | ||||
$ cp -a ../master/patchdir . | $ cp -a ../master/patchdir . | ||||
`hg status` will now add outside, but not patchdir. | `hg status` will now add outside, but not patchdir. | ||||
$ DIRSTATEINCLUDES=path:outside hg status | $ DIRSTATEINCLUDES=path:outside hg status | ||||
M outside/f2 | M outside/f2 | ||||
$ grep outside .hg/narrowspec | $ grep outside .hg/narrowspec | ||||
path:outside | path:outside | ||||
$ grep -q outside .hg/dirstate | $ grep outside .hg/dirstate > /dev/null | ||||
$ grep patchdir .hg/narrowspec | $ grep patchdir .hg/narrowspec | ||||
[1] | [1] | ||||
$ grep patchdir .hg/dirstate | $ grep patchdir .hg/dirstate | ||||
[1] | [1] | ||||
Get rid of the modification to outside/f2. | Get rid of the modification to outside/f2. | ||||
$ hg update -C . | $ hg update -C . | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
applying $TESTTMP/foo.patch | applying $TESTTMP/foo.patch | ||||
patching file patchdir/f3 | patching file patchdir/f3 | ||||
Hunk #1 FAILED at 0 | Hunk #1 FAILED at 0 | ||||
1 out of 1 hunks FAILED -- saving rejects to file patchdir/f3.rej | 1 out of 1 hunks FAILED -- saving rejects to file patchdir/f3.rej | ||||
abort: patch failed to apply | abort: patch failed to apply | ||||
[255] | [255] | ||||
$ grep patchdir .hg/narrowspec | $ grep patchdir .hg/narrowspec | ||||
[1] | [1] | ||||
$ grep -q patchdir .hg/dirstate | $ grep patchdir .hg/dirstate > /dev/null | ||||
[1] | [1] | ||||
Let's make it apply cleanly and see that it *did* expand properly | Let's make it apply cleanly and see that it *did* expand properly | ||||
$ cat > "$TESTTMP/foo.patch" <<EOF | $ cat > "$TESTTMP/foo.patch" <<EOF | ||||
> --- patchdir/f3 | > --- patchdir/f3 | ||||
> +++ patchdir/f3 | > +++ patchdir/f3 | ||||
> @@ -1,1 +1,1 @@ | > @@ -1,1 +1,1 @@ | ||||
> -patch_this | > -patch_this | ||||
> +patched_this | > +patched_this | ||||
> EOF | > EOF | ||||
$ PATCHINCLUDES=path:patchdir hg import -p0 -e "$TESTTMP/foo.patch" -m message | $ PATCHINCLUDES=path:patchdir hg import -p0 -e "$TESTTMP/foo.patch" -m message | ||||
applying $TESTTMP/foo.patch | applying $TESTTMP/foo.patch | ||||
$ cat patchdir/f3 | $ cat patchdir/f3 | ||||
patched_this | patched_this | ||||
$ grep patchdir .hg/narrowspec | $ grep patchdir .hg/narrowspec | ||||
path:patchdir | path:patchdir | ||||
$ grep -q patchdir .hg/dirstate | $ grep patchdir .hg/dirstate > /dev/null |