comparison tests/test-narrow-expanddirstate.t @ 38837:fa64a229f24b

tests: avoid unnecessarily looking inside .hg/ in test-narrow* Many of the narrow tests were looking at .hg/narrowspec. I think most of them were written before we added `hg tracked`, but now that we have that command, we should fix the tests. There were also a few instances of tests looking at .hg/dirstate. I fixed those to use `hg files` instead. Differential Revision: https://phab.mercurial-scm.org/D4093
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 03 Aug 2018 13:00:14 -0700
parents 1cba497491be
children 92fde28860bb
comparison
equal deleted inserted replaced
38836:fed6fe856333 38837:fa64a229f24b
25 25
26 $ cd narrow 26 $ cd narrow
27 27
28 $ mkdir outside 28 $ mkdir outside
29 $ echo other_contents > outside/f2 29 $ echo other_contents > outside/f2
30 $ grep outside .hg/narrowspec 30 $ hg tracked | grep outside
31 [1] 31 [1]
32 $ grep outside .hg/dirstate 32 $ hg files | grep outside
33 [1] 33 [1]
34 $ hg status 34 $ hg status
35 35
36 `hg status` did not add outside. 36 `hg status` did not add outside.
37 $ grep outside .hg/narrowspec 37 $ hg tracked | grep outside
38 [1] 38 [1]
39 $ grep outside .hg/dirstate 39 $ hg files | grep outside
40 [1] 40 [1]
41 41
42 Unfortunately this is not really a candidate for adding to narrowhg proper, 42 Unfortunately this is not really a candidate for adding to narrowhg proper,
43 since it depends on some other source for providing the manifests (when using 43 since it depends on some other source for providing the manifests (when using
44 treemanifests) and file contents. Something like a virtual filesystem and/or 44 treemanifests) and file contents. Something like a virtual filesystem and/or
113 $ cp -a ../master/patchdir . 113 $ cp -a ../master/patchdir .
114 114
115 `hg status` will now add outside, but not patchdir. 115 `hg status` will now add outside, but not patchdir.
116 $ DIRSTATEINCLUDES=path:outside hg status 116 $ DIRSTATEINCLUDES=path:outside hg status
117 M outside/f2 117 M outside/f2
118 $ grep outside .hg/narrowspec 118 $ hg tracked | grep outside
119 path:outside 119 I path:outside
120 $ grep outside .hg/dirstate > /dev/null 120 $ hg files | grep outside > /dev/null
121 $ grep patchdir .hg/narrowspec 121 $ hg tracked | grep patchdir
122 [1] 122 [1]
123 $ grep patchdir .hg/dirstate 123 $ hg files | grep patchdir
124 [1] 124 [1]
125 125
126 Get rid of the modification to outside/f2. 126 Get rid of the modification to outside/f2.
127 $ hg update -C . 127 $ hg update -C .
128 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 128 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 patching file patchdir/f3 140 patching file patchdir/f3
141 Hunk #1 FAILED at 0 141 Hunk #1 FAILED at 0
142 1 out of 1 hunks FAILED -- saving rejects to file patchdir/f3.rej 142 1 out of 1 hunks FAILED -- saving rejects to file patchdir/f3.rej
143 abort: patch failed to apply 143 abort: patch failed to apply
144 [255] 144 [255]
145 $ grep patchdir .hg/narrowspec 145 $ hg tracked | grep patchdir
146 [1] 146 [1]
147 $ grep patchdir .hg/dirstate > /dev/null 147 $ hg files | grep patchdir > /dev/null
148 [1] 148 [1]
149 149
150 Let's make it apply cleanly and see that it *did* expand properly 150 Let's make it apply cleanly and see that it *did* expand properly
151 $ cat > "$TESTTMP/foo.patch" <<EOF 151 $ cat > "$TESTTMP/foo.patch" <<EOF
152 > --- patchdir/f3 152 > --- patchdir/f3
157 > EOF 157 > EOF
158 $ PATCHINCLUDES=path:patchdir hg import -p0 -e "$TESTTMP/foo.patch" -m message 158 $ PATCHINCLUDES=path:patchdir hg import -p0 -e "$TESTTMP/foo.patch" -m message
159 applying $TESTTMP/foo.patch 159 applying $TESTTMP/foo.patch
160 $ cat patchdir/f3 160 $ cat patchdir/f3
161 patched_this 161 patched_this
162 $ grep patchdir .hg/narrowspec 162 $ hg tracked | grep patchdir
163 path:patchdir 163 I path:patchdir
164 $ grep patchdir .hg/dirstate > /dev/null 164 $ hg files | grep patchdir > /dev/null