summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2016-11-14 10:30:59 -0300
committerThibault Saunier <thibault.saunier@osg.samsung.com>2016-11-14 13:07:17 -0300
commit733f0bba2197ba3e500a31c28de41716fb88c88f (patch)
tree7bdb19dbcdf3868a0f847b4a95e6a85fc90ac726
parentdf7afa8b6a31faf5a8ef45deca3ac9eef81418e3 (diff)
Never add dependency on already closed revisions
Fixes T7574 Reviewed-by: Daniel Stone <daniels@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D1480
-rwxr-xr-xgit-phab13
1 files changed, 9 insertions, 4 deletions
diff --git a/git-phab b/git-phab
index 7c62245..11054ee 100755
--- a/git-phab
+++ b/git-phab
@@ -1008,7 +1008,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
1008 name="local:commits", 1008 name="local:commits",
1009 data=json.dumps(commit_infos)) 1009 data=json.dumps(commit_infos))
1010 1010
1011 def attach_commit(self, commit): 1011 def attach_commit(self, commit, proposed_commits):
1012 linter_message = None 1012 linter_message = None
1013 print(" * Running linters...", end="") 1013 print(" * Running linters...", end="")
1014 linter_status = "none" 1014 linter_status = "none"
@@ -1041,9 +1041,13 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
1041 except IndexError: 1041 except IndexError:
1042 last_revision_id = None 1042 last_revision_id = None
1043 1043
1044 if last_revision_id: 1044 # Make sure that we do no add dependency on already closed revision
1045 # (avoiding making query on the server when not needed)
1046 if last_revision_id and \
1047 self.repo.head.commit.parents[0] not in proposed_commits and \
1048 not self.phabricator.differential.query(ids=[last_revision_id],
1049 status="status-closed"):
1045 body.append("Depends on D%s" % last_revision_id) 1050 body.append("Depends on D%s" % last_revision_id)
1046
1047 phab_fields.append("Projects: %s" % ','.join(self.project_phids)) 1051 phab_fields.append("Projects: %s" % ','.join(self.project_phids))
1048 1052
1049 summary = ('\n'.join(body) + '\n' + 1053 summary = ('\n'.join(body) + '\n' +
@@ -1205,7 +1209,8 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri)
1205 if not patch_attachement_failure and commit in commits: 1209 if not patch_attachement_failure and commit in commits:
1206 print("-> Attaching %s:" % self.format_commit(commit)) 1210 print("-> Attaching %s:" % self.format_commit(commit))
1207 try: 1211 try:
1208 new, revision, diff = self.attach_commit(commit) 1212 new, revision, diff = self.attach_commit(
1213 commit, all_commits)
1209 except Exception as e: 1214 except Exception as e:
1210 logging.exception("Failed proposing patch. " 1215 logging.exception("Failed proposing patch. "
1211 "Finnish rebuilding branch " 1216 "Finnish rebuilding branch "