Mercurial > hg
comparison tests/test-hgignore.t @ 27671:067d87feeb11
debugignore: find out if a file is being ignored
Before this patch debugignore was just displaying the list of ignore patterns.
This patch makes it support a list of filename as argument and tells the user
if those given files are ignored or not.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Tue, 05 Jan 2016 07:47:08 -0800 |
parents | 988367ac2a2a |
children | f2da9bb87ae0 |
comparison
equal
deleted
inserted
replaced
27670:4374f039d269 | 27671:067d87feeb11 |
---|---|
164 A b.o | 164 A b.o |
165 | 165 |
166 $ hg debugignore | 166 $ hg debugignore |
167 (?:(?:|.*/)[^/]*(?:/|$)) | 167 (?:(?:|.*/)[^/]*(?:/|$)) |
168 | 168 |
169 $ hg debugignore b.o | |
170 b.o is ignored | |
171 | |
169 $ cd .. | 172 $ cd .. |
170 | 173 |
171 Check patterns that match only the directory | 174 Check patterns that match only the directory |
172 | 175 |
173 $ echo "^dir\$" > .hgignore | 176 $ echo "^dir\$" > .hgignore |
189 A dir/b.o | 192 A dir/b.o |
190 ? .hgignore | 193 ? .hgignore |
191 ? a.c | 194 ? a.c |
192 ? a.o | 195 ? a.o |
193 ? syntax | 196 ? syntax |
197 $ hg debugignore a.c | |
198 a.c is not ignored | |
199 $ hg debugignore dir/c.o | |
200 dir/c.o is ignored | |
194 | 201 |
195 Check using 'include:' in ignore file | 202 Check using 'include:' in ignore file |
196 | 203 |
197 $ hg purge --all --config extensions.purge= | 204 $ hg purge --all --config extensions.purge= |
198 $ touch foo.included | 205 $ touch foo.included |
272 $ echo "subinclude:.hgignoretwo" >> dir1/.hgignore | 279 $ echo "subinclude:.hgignoretwo" >> dir1/.hgignore |
273 $ echo "glob:file*2" > dir1/.hgignoretwo | 280 $ echo "glob:file*2" > dir1/.hgignoretwo |
274 | 281 |
275 $ hg status | grep file2 | 282 $ hg status | grep file2 |
276 [1] | 283 [1] |
284 $ hg debugignore dir1/file2 | |
285 dir1/file2 is ignored |