Skip to content

Commit

Permalink
When submitting multiple revisions, chain them together
Browse files Browse the repository at this point in the history
This fixes #387.
  • Loading branch information
padenot committed Jan 8, 2025
1 parent 9da81a8 commit bfbf896
Showing 1 changed file with 13 additions and 0 deletions.
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

0 comments on commit bfbf896

Please sign in to comment.