Skip to content

Commit 88e7f76

Browse files
zzl0facebook-github-bot
authored andcommitted
subtree: clear "source" for cross-repo grafts
Summary: This diff clears the source field for cross-repo grafts. Without the external repo's URL, the source commit hash isn't meaningful, so we clear it to avoid confusion. Reviewed By: muirdm Differential Revision: D75418283 fbshipit-source-id: 4318235dc89805f60d2022166ea923980b60f2aa
1 parent bf95383 commit 88e7f76

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

eden/scm/sapling/commands/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2694,11 +2694,13 @@ def _dograft(ui, to_repo, *revs, from_repo=None, **opts):
26942694

26952695
source = ctx.extra().get("source")
26962696
extra = {}
2697-
if source:
2698-
extra["source"] = source
2699-
extra["intermediate-source"] = ctx.hex()
2700-
else:
2701-
extra["source"] = ctx.hex()
2697+
# TODO: add cross-repo graft source to subtree metadata
2698+
if not is_crossrepo:
2699+
if source:
2700+
extra["source"] = source
2701+
extra["intermediate-source"] = ctx.hex()
2702+
else:
2703+
extra["source"] = ctx.hex()
27022704
user = ctx.user()
27032705
if opts.get("user"):
27042706
user = opts["user"]

0 commit comments

Comments
 (0)