equal
deleted
inserted
replaced
29 def _lowerclean(s): |
29 def _lowerclean(s): |
30 # type: (bytes) -> bytes |
30 # type: (bytes) -> bytes |
31 return encoding.hfsignoreclean(s.lower()) |
31 return encoding.hfsignoreclean(s.lower()) |
32 |
32 |
33 |
33 |
34 class pathauditor(object): |
34 class pathauditor: |
35 """ensure that a filesystem path contains no banned components. |
35 """ensure that a filesystem path contains no banned components. |
36 the following properties of a path are checked: |
36 the following properties of a path are checked: |
37 |
37 |
38 - ends with a directory separator |
38 - ends with a directory separator |
39 - under top-level .hg |
39 - under top-level .hg |
312 yield path[:pos] |
312 yield path[:pos] |
313 pos = path.rfind(b'/', 0, pos) |
313 pos = path.rfind(b'/', 0, pos) |
314 yield b'' |
314 yield b'' |
315 |
315 |
316 |
316 |
317 class dirs(object): |
317 class dirs: |
318 '''a multiset of directory names from a set of file paths''' |
318 '''a multiset of directory names from a set of file paths''' |
319 |
319 |
320 def __init__(self, map, only_tracked=False): |
320 def __init__(self, map, only_tracked=False): |
321 """ |
321 """ |
322 a dict map indicates a dirstate while a list indicates a manifest |
322 a dict map indicates a dirstate while a list indicates a manifest |