Patchwork [3,of,5] manifest: add manifestdict.hasdir() method

login
register
mail settings
Submitter Drew Gottlieb
Date March 13, 2015, 11:35 p.m.
Message ID <ef68db445223246132b8.1426289735@waste.org>
Download mbox | patch
Permalink /patch/8074/
State Accepted
Commit 149cc171e4a0621183cf72c1fa16b1ecf64ff48d
Headers show

Comments

Drew Gottlieb - March 13, 2015, 11:35 p.m.
# HG changeset patch
# User Drew Gottlieb <drgott@google.com>
# Date 1426285501 25200
#      Fri Mar 13 15:25:01 2015 -0700
# Node ID ef68db445223246132b8d0b8609e131b1ee2065d
# Parent  d1f4b4b9cc4e63ea7fd68f23a3214f11b64df845
manifest: add manifestdict.hasdir() method

Allows for alternative implementations of manifestdict to decide if a directory
exists in whatever way is most optimal.

Patch

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -155,6 +155,9 @@ 
     def dirs(self):
         return self._dirs
 
+    def hasdir(self, dir):
+        return dir in self._dirs
+
     def matches(self, match):
         '''generate a new manifest filtered by the match argument'''
         if match.always():