equal
deleted
inserted
replaced
12 from mercurial import ( |
12 from mercurial import ( |
13 encoding, |
13 encoding, |
14 error, |
14 error, |
15 pycompat, |
15 pycompat, |
16 scmutil, |
16 scmutil, |
17 strutil, |
|
18 util, |
17 util, |
19 ) |
18 ) |
20 |
19 |
21 from . import common |
20 from . import common |
22 |
21 |
1237 def dirs_of(self, files): |
1236 def dirs_of(self, files): |
1238 dirs = set() |
1237 dirs = set() |
1239 for f in files: |
1238 for f in files: |
1240 if os.path.isdir(self.wjoin(f)): |
1239 if os.path.isdir(self.wjoin(f)): |
1241 dirs.add(f) |
1240 dirs.add(f) |
1242 for i in strutil.rfindall(f, '/'): |
1241 i = len(f) |
|
1242 for i in iter(lambda: f.rfind('/', 0, i), -1): |
1243 dirs.add(f[:i]) |
1243 dirs.add(f[:i]) |
1244 return dirs |
1244 return dirs |
1245 |
1245 |
1246 def add_dirs(self, files): |
1246 def add_dirs(self, files): |
1247 add_dirs = [d for d in sorted(self.dirs_of(files)) |
1247 add_dirs = [d for d in sorted(self.dirs_of(files)) |