##// END OF EJS Templates
debugignore: normalize the file before testing dirstate._ignore()...
Matt Harbison -
r28054:8515b813 default
parent child Browse files
Show More
@@ -2457,20 +2457,21 b' def debugignore(ui, repo, *files, **opts'
2457 2457 raise error.Abort(_("no ignore patterns found"))
2458 2458 else:
2459 2459 for f in files:
2460 nf = util.normpath(f)
2460 2461 ignored = None
2461 2462 ignoredata = None
2462 if f != '.':
2463 if ignore(f):
2464 ignored = f
2465 ignoredata = repo.dirstate._ignorefileandline(f)
2466 else:
2467 for p in util.finddirs(f):
2463 if nf != '.':
2464 if ignore(nf):
2465 ignored = nf
2466 ignoredata = repo.dirstate._ignorefileandline(nf)
2467 else:
2468 for p in util.finddirs(nf):
2468 2469 if ignore(p):
2469 2470 ignored = p
2470 2471 ignoredata = repo.dirstate._ignorefileandline(p)
2471 2472 break
2472 2473 if ignored:
2473 if ignored == f:
2474 if ignored == nf:
2474 2475 ui.write("%s is ignored\n" % f)
2475 2476 else:
2476 2477 ui.write("%s is ignored because of containing folder %s\n"
@@ -286,3 +286,16 b' Check include subignore at the same leve'
286 286 $ hg debugignore dir1/file2
287 287 dir1/file2 is ignored
288 288 (ignore rule in dir2/.hgignore, line 1: 'file*2')
289
290 #if windows
291
292 Windows paths are accepted on input
293
294 $ rm dir1/.hgignore
295 $ echo "dir1/file*" >> .hgignore
296 $ hg debugignore "dir1\file2"
297 dir1\file2 is ignored
298 (ignore rule in $TESTTMP\ignorerepo\.hgignore, line 4: 'dir1/file*')
299 $ hg up -qC .
300
301 #endif
General Comments 0
You need to be logged in to leave comments. Login now