diff mercurial/commands.py @ 13396:3e66eec9a814

add debugignore which yields the combined ignore patten of the .hgignore files For GUI clients its sometimes important to know which files will be ignored and which files will be important. This allows the GUI client to skipping redoing a 'hg status' when the files are ignored but have changed. (For instance, a typical case is that the "build" directory inside some project is ignored but files in it frequently change.)
author jfh <jason@jasonfharris.com>
date Sat, 15 Jan 2011 16:02:03 +0100
parents a184dbd9b2c5
children 14f3795a5ed7
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Feb 04 16:32:14 2011 -0300
+++ b/mercurial/commands.py	Sat Jan 15 16:02:03 2011 +0100
@@ -1351,6 +1351,11 @@
         m = util.matchdate(range)
         ui.write("match: %s\n" % m(d[0]))
 
+def debugignore(ui, repo, *values, **opts):
+    """display the combined ignore pattern"""
+    ignore = repo.dirstate._ignore
+    ui.write("%s\n" % ignore.includepat)
+
 def debugindex(ui, repo, file_, **opts):
     """dump the contents of an index file"""
     r = None
@@ -4347,6 +4352,7 @@
          _('[-e] DATE [RANGE]')),
     "debugdata": (debugdata, [], _('FILE REV')),
     "debugfsinfo": (debugfsinfo, [], _('[PATH]')),
+    "debugignore": (debugignore, [], ''),
     "debugindex": (debugindex,
                    [('f', 'format', 0, _('revlog format'), _('FORMAT'))],
                    _('FILE')),