mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
fix some type errors in debug.py
Summary: D9389865 changed the rel_path variable from a string to a pathlib.Path object. However it missed a couple places where the path object needed to be converted to bytes. Reviewed By: chadaustin Differential Revision: D9476525 fbshipit-source-id: 2dc69f5a0378ffbc02b2724a097604df288683c9
This commit is contained in:
parent
6e7b264295
commit
9f6f952024
@ -389,7 +389,7 @@ class InodeCmd(Subcmd):
|
|||||||
out = sys.stdout.buffer
|
out = sys.stdout.buffer
|
||||||
instance, checkout, rel_path = cmd_util.require_checkout(args, args.path)
|
instance, checkout, rel_path = cmd_util.require_checkout(args, args.path)
|
||||||
with instance.get_thrift_client() as client:
|
with instance.get_thrift_client() as client:
|
||||||
results = client.debugInodeStatus(bytes(checkout.path), rel_path)
|
results = client.debugInodeStatus(bytes(checkout.path), bytes(rel_path))
|
||||||
|
|
||||||
out.write(b"%d loaded TreeInodes\n" % len(results))
|
out.write(b"%d loaded TreeInodes\n" % len(results))
|
||||||
for inode_info in results:
|
for inode_info in results:
|
||||||
@ -655,7 +655,9 @@ class UnloadInodesCmd(Subcmd):
|
|||||||
age = TimeSpec()
|
age = TimeSpec()
|
||||||
age.seconds = int(args.age)
|
age.seconds = int(args.age)
|
||||||
age.nanoSeconds = int((args.age - age.seconds) * 10 ** 9)
|
age.nanoSeconds = int((args.age - age.seconds) * 10 ** 9)
|
||||||
count = client.unloadInodeForPath(bytes(checkout.path), str(rel_path), age)
|
count = client.unloadInodeForPath(
|
||||||
|
bytes(checkout.path), bytes(rel_path), age
|
||||||
|
)
|
||||||
|
|
||||||
unload_path = checkout.path.joinpath(rel_path)
|
unload_path = checkout.path.joinpath(rel_path)
|
||||||
print(f"Unloaded {count} inodes under {unload_path}")
|
print(f"Unloaded {count} inodes under {unload_path}")
|
||||||
|
Loading…
Reference in New Issue
Block a user