Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When submitting multiple revisions, chain them together #388

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apis/phabricator.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ def submit_to_phabricator(rev_id):
if result['error']:
raise Exception("Got an error from phabricator when trying to set the bugzilla id for %s" % (p))


# Chain revisions together if needed
parent_rev = phab_revisions[0]
for child_rev in phab_revisions[1:]:
cmd = "echo " + quote_echo_string("""{"transactions": [{"type":"parents.add", "value":"%s"}], "objectIdentifier": "%s"}""" % (child_rev, parent_rev))
cmd += " | %s call-conduit --conduit-uri=%s differential.revision.edit --""" % (_arc(), self.url)
ret = self.run(cmd, shell=True)
result = json.loads(ret.stdout.decode())
if result['error']:
raise Exception("Got an error from phabricator when trying chain revisions, parent: %s, child %s" % (parent_rev, child_rev))
parent_rev = child_rev


for p in phab_revisions:
self.logger.log("Submitted phabricator patch at {0}".format(self.url + p), level=LogLevel.Info)
return phab_revisions
Expand Down
Loading