mirror of
https://github.com/facebook/sapling.git
synced 2025-01-06 04:43:19 +03:00
port D16833526 to gitrevset
Summary: See https://fb.workplace.com/groups/corehg/permalink/448152285780007/ for context. D16833526 was to add extras lookup for translating hg hash to git hash. However we also have gitrevset extension which still does mapfile lookup. THis diff should port the same improvement for it. Reviewed By: DurhamG Differential Revision: D17070479 fbshipit-source-id: e469707b0b21541aa2c3b90d1480b04afc4f1485
This commit is contained in:
parent
66cef07cf9
commit
439e4c6825
@ -110,6 +110,17 @@ def _dolookup(repo, key):
|
||||
sha = key[14:]
|
||||
else:
|
||||
return None
|
||||
if direction == "togit":
|
||||
# we've started recording the hg hash in extras.
|
||||
try:
|
||||
ctx = repo[sha]
|
||||
except error.RepoLookupError as e:
|
||||
if "unknown revision" in str(e):
|
||||
return None
|
||||
raise e
|
||||
fromextra = ctx.extra().get("convert_revision", "")
|
||||
if fromextra:
|
||||
return fromextra
|
||||
hggitmap = open(mapfile, "rb")
|
||||
for line in hggitmap:
|
||||
gitsha, hgsha = line.strip().split(" ", 1)
|
||||
|
Loading…
Reference in New Issue
Block a user