equal
deleted
inserted
replaced
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
8 from i18n import _ |
8 from i18n import _ |
9 from mercurial.node import nullrev |
9 from mercurial.node import nullrev |
10 import util, error, osutil, revset, similar, encoding, phases |
10 import util, error, osutil, revset, similar, encoding, phases, parsers |
11 import match as matchmod |
11 import match as matchmod |
12 import os, errno, re, stat, glob |
12 import os, errno, re, stat, glob |
13 |
13 |
14 if os.name == 'nt': |
14 if os.name == 'nt': |
15 import scmwindows as scmplatform |
15 import scmwindows as scmplatform |
925 return self._dirs.iterkeys() |
925 return self._dirs.iterkeys() |
926 |
926 |
927 def __contains__(self, d): |
927 def __contains__(self, d): |
928 return d in self._dirs |
928 return d in self._dirs |
929 |
929 |
|
930 if util.safehasattr(parsers, 'dirs'): |
|
931 dirs = parsers.dirs |
|
932 |
930 def finddirs(path): |
933 def finddirs(path): |
931 pos = path.rfind('/') |
934 pos = path.rfind('/') |
932 while pos != -1: |
935 while pos != -1: |
933 yield path[:pos] |
936 yield path[:pos] |
934 pos = path.rfind('/', 0, pos) |
937 pos = path.rfind('/', 0, pos) |