##// END OF EJS Templates
inotify: inotify.server.walkrepodirs() simplify walking...
Nicolas Dumazet -
r8322:3c6c21eb default
parent child Browse files
Show More
@@ -32,6 +32,7 b' def walkrepodirs(repo):'
32 '''Iterate over all subdirectories of this repo.
32 '''Iterate over all subdirectories of this repo.
33 Exclude the .hg directory, any nested repos, and ignored dirs.'''
33 Exclude the .hg directory, any nested repos, and ignored dirs.'''
34 rootslash = repo.root + os.sep
34 rootslash = repo.root + os.sep
35
35 def walkit(dirname, top):
36 def walkit(dirname, top):
36 fullpath = rootslash + dirname
37 fullpath = rootslash + dirname
37 hginside = False
38 hginside = False
@@ -45,15 +46,15 b' def walkrepodirs(repo):'
45 d = join(dirname, name)
46 d = join(dirname, name)
46 if repo.dirstate._ignore(d):
47 if repo.dirstate._ignore(d):
47 continue
48 continue
48 for subdir, hginsub in walkit(d, False):
49 for subdir in walkit(d, False):
49 if not hginsub:
50 yield subdir
50 yield subdir, False
51 except OSError, err:
51 except OSError, err:
52 if err.errno not in walk_ignored_errors:
52 if err.errno not in walk_ignored_errors:
53 raise
53 raise
54 yield fullpath, hginside
54 if top or not hginside:
55 for dirname, hginside in walkit('', True):
55 yield fullpath
56 yield dirname
56
57 return walkit('', True)
57
58
58 def walk(repo, root):
59 def walk(repo, root):
59 '''Like os.walk, but only yields regular files.'''
60 '''Like os.walk, but only yields regular files.'''
General Comments 0
You need to be logged in to leave comments. Login now