Skip to content

Commit

Permalink
Bug 1574595 - add hg/git identifier to creation_method; r=zalun
Browse files Browse the repository at this point in the history
Appends 'git', 'git-cinnabar', or 'hg' to the creation_method when
calling the conduit api directly to create diffs.

Differential Revision: https://phabricator.services.mozilla.com/D46113
globau committed Sep 17, 2019
1 parent 25b8e4f commit f24103f
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions moz-phab
Original file line number Diff line number Diff line change
@@ -1081,13 +1081,17 @@ class ConduitAPI:
return repo

def create_diff(self, changes, base_revision):
creation_method = ["moz-phab", conduit.repo.vcs]
if conduit.repo.vcs == "git" and conduit.repo.is_cinnabar_required:
creation_method.append("cinnabar")

api_call_args = dict(
changes=changes,
sourceMachine=self.repo.phab_url,
sourceControlSystem=self.repo.phab_vcs,
sourceControlPath="/",
sourceControlBaseRevision=base_revision,
creationMethod="moz-phab",
creationMethod="-".join(creation_method),
lintStatus="none",
unitStatus="none",
repositoryPHID=self.repo.phid,
@@ -1331,7 +1335,7 @@ class Diff:
for upload in change.uploads:
upload["phid"] = conduit.file_upload(upload["value"])

def submit(self, repo_phid, commit, message):
def submit(self, commit, message):
changes = [
change.to_conduit(conduit.repo.get_public_node(commit["node"]))
for change in self.changes.values()
@@ -3856,7 +3860,7 @@ def submit(repo, args):
diff.upload_files()

with wait_message("Submitting the diff..."):
diff_phid = diff.submit(repo.phid, commit, message)
diff_phid = diff.submit(commit, message)
else:
diff_phid = None

2 changes: 1 addition & 1 deletion tests/test_integration-git.py
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ def test_submit_create(in_process, git_repo_path, init_sha):
"metadata": {},
}
],
"creationMethod": "moz-phab",
"creationMethod": "moz-phab-git",
},
)
in call_conduit.call_args_list

0 comments on commit f24103f

Please sign in to comment.