##// END OF EJS Templates
debugignore: eliminate inconsistencies with `hg status` (issue5222)...
Matt Harbison -
r33507:e9672de5 default
parent child Browse files
Show More
@@ -866,7 +866,8 b' def debugignore(ui, repo, *files, **opts'
866 866 # Show all the patterns
867 867 ui.write("%s\n" % repr(ignore))
868 868 else:
869 for f in files:
869 m = scmutil.match(repo[None], pats=files)
870 for f in m.files():
870 871 nf = util.normpath(f)
871 872 ignored = None
872 873 ignoredata = None
@@ -882,16 +883,16 b' def debugignore(ui, repo, *files, **opts'
882 883 break
883 884 if ignored:
884 885 if ignored == nf:
885 ui.write(_("%s is ignored\n") % f)
886 ui.write(_("%s is ignored\n") % m.uipath(f))
886 887 else:
887 888 ui.write(_("%s is ignored because of "
888 889 "containing folder %s\n")
889 % (f, ignored))
890 % (m.uipath(f), ignored))
890 891 ignorefile, lineno, line = ignoredata
891 892 ui.write(_("(ignore rule in %s, line %d: '%s')\n")
892 893 % (ignorefile, lineno, line))
893 894 else:
894 ui.write(_("%s is not ignored\n") % f)
895 ui.write(_("%s is not ignored\n") % m.uipath(f))
895 896
896 897 @command('debugindex', cmdutil.debugrevlogopts +
897 898 [('f', 'format', 0, _('revlog format'), _('FORMAT'))],
@@ -52,6 +52,35 b' Should display baz only:'
52 52 abort: $TESTTMP/ignorerepo/.hgignore: invalid pattern (relre): *.o (glob)
53 53 [255]
54 54
55 Ensure given files are relative to cwd
56
57 $ echo "dir/.*\.o" > .hgignore
58 $ hg status -i
59 I dir/c.o
60
61 $ hg debugignore dir/c.o dir/missing.o
62 dir/c.o is ignored (glob)
63 (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
64 dir/missing.o is ignored (glob)
65 (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
66 $ cd dir
67 $ hg debugignore c.o missing.o
68 c.o is ignored
69 (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
70 missing.o is ignored
71 (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
72
73 For icasefs, inexact matches also work, except for missing files
74
75 #if icasefs
76 $ hg debugignore c.O missing.O
77 c.o is ignored
78 (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 1: 'dir/.*\.o') (glob)
79 missing.O is not ignored
80 #endif
81
82 $ cd ..
83
55 84 $ echo ".*\.o" > .hgignore
56 85 $ hg status
57 86 A dir/b.o
@@ -207,7 +236,7 b' Check recursive glob pattern matches no '
207 236 $ hg debugignore a.c
208 237 a.c is not ignored
209 238 $ hg debugignore dir/c.o
210 dir/c.o is ignored
239 dir/c.o is ignored (glob)
211 240 (ignore rule in $TESTTMP/ignorerepo/.hgignore, line 2: 'dir/**/c.o') (glob)
212 241
213 242 Check using 'include:' in ignore file
@@ -293,7 +322,7 b' Check include subignore at the same leve'
293 322 $ hg status | grep file2
294 323 [1]
295 324 $ hg debugignore dir1/file2
296 dir1/file2 is ignored
325 dir1/file2 is ignored (glob)
297 326 (ignore rule in dir2/.hgignore, line 1: 'file*2')
298 327
299 328 #if windows
General Comments 0
You need to be logged in to leave comments. Login now