match: introduce explicitdir and traversedir
authorSiddharth Agarwal <sid0@fb.com>
Sun, 28 Apr 2013 21:24:09 -0700
changeset 19136 e073ac988b51
parent 19135 1c2dd751c12d
child 19137 1835de2d9c4b
match: introduce explicitdir and traversedir match.dir is currently called in two different places: (1) noting when a directory specified explicitly is visited. (2) noting when a directory is visited during a recursive walk. purge cares about both, but commit only cares about the first. Upcoming patches will split the two cases into two different callbacks. Why bother? Consider a hypothetical extension that can provide more efficient walk results, via e.g. watching the filesystem. That extension will need to fall back to a full recursive walk if a callback is set for (2), but not if a callback is only set for (1).
mercurial/match.py
--- a/mercurial/match.py	Sat May 04 14:52:51 2013 -0500
+++ b/mercurial/match.py	Sun Apr 28 21:24:09 2013 -0700
@@ -121,6 +121,10 @@
         pass
     def dir(self, f):
         pass
+    def explicitdir(self, f):
+        self.dir(f)
+    def traversedir(self, f):
+        self.dir(f)
     def missing(self, f):
         pass
     def exact(self, f):