mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
convert a path to valid glob syntax when prefetching
Summary: Paths are not necessarily legal glob syntax. In particular, backslash is used for escaping. This caused problems on Windows, where we tried to pass a backslash-delimited path into `eden prefetch --no-prefetch`. Reviewed By: xavierd Differential Revision: D25072784 fbshipit-source-id: 9ce8e5ccc8f28581512c39d04922889da0bc1bf6
This commit is contained in:
parent
dc6b1a368e
commit
ac8d6441f9
@ -59,11 +59,9 @@ def prefetch_dir_if_eden(dirpath):
|
||||
root = find_eden_root(dirpath)
|
||||
if root is None:
|
||||
return
|
||||
rel = os.path.relpath(dirpath, root)
|
||||
print("Prefetching %s..." % rel)
|
||||
subprocess.call(
|
||||
["edenfsctl", "prefetch", "--repo", root, "--silent", "%s/**" % rel]
|
||||
)
|
||||
glob = f"{os.path.relpath(dirpath, root).replace(os.sep, '/')}/**"
|
||||
print(f"Prefetching {glob}")
|
||||
subprocess.call(["edenfsctl", "prefetch", "--repo", root, "--silent", glob])
|
||||
PREFETCHED_DIRS.add(dirpath)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user