sapling/hgext/p4fastimport/util.py
Alexandre Marin 218aab4168 Cleanup p4fastimport
Summary:
p4fastimport has been replaced by p4seqimport months ago, on top of that previous assumptions have changed that might make p4fastimport not work (e.g. allowing import to connect to LFS).

This change cleans up a lot of unused code and a bunch of tests that no longer make sense.

Reviewed By: zhh95

Differential Revision: D8525286

fbshipit-source-id: 91d33e7530bf6df1e1ec92fae3acde0345230247
2018-06-26 13:35:45 -07:00

26 lines
563 B
Python

# (c) 2017-present Facebook Inc.
from __future__ import absolute_import
def localpath(p):
return p.lstrip("/")
def getcl(node):
if node:
assert node.extra().get("p4changelist") or node.extra().get(
"p4fullimportbasechangelist"
)
if node.extra().get("p4changelist"):
return int(node.extra()["p4changelist"])
else:
return int(node.extra()["p4fullimportbasechangelist"])
return None
def lastcl(node):
clnum = getcl(node)
if clnum:
return clnum + 1
return None