Commit 2c41d995 authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

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
parent 9ba2c4c6
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment