sapling/hgext/p4fastimport/lfs.py
Jun Wu a487dacc4b codemod: reformat rest of the code
Summary:
Previous code format attempt (D8173629) didn't cover all files due to `**/*.py`
was not expanded recursively by bash. That makes certain changes larger than
they should be (ex. D8675439). Now use zsh's `**/*.py` to format them.

Also fix Python syntax so black can run on more files, and all lint issues.

Reviewed By: phillco

Differential Revision: D8696912

fbshipit-source-id: 95f07aa0c5eb1b63947b0f77f534957f4ab65364
2018-07-05 17:52:43 -07:00

23 lines
491 B
Python

# (c) 2017-present Facebook Inc.
from __future__ import absolute_import
from mercurial import extensions
lfsext = None
try:
lfsext = extensions.find("lfs")
except KeyError:
pass
def getlfsinfo(hgfilelog, node):
if lfsext is None:
return False, None
islfs = lfsext.wrapper._islfs(hgfilelog, node)
oid = None
if islfs:
lfspointer = lfsext.pointer.deserialize(hgfilelog.revision(node, raw=True))
oid = lfspointer.oid()
return islfs, oid