+ changeid = self.regex_changeid.search(pfile)
+ if changeid and changeid.group(2):
+ logger.info("trying Change-Id from git.properties as merged in %s: %s", project, changeid.group(2))
+
+ gerrits = self.gerritquery.get_gerrits(project, changeid.group(2), 1, None, status="merged")
+ if gerrits:
+ logger.info("found Change-Id from git.properties as merged in %s", project)
+ return ChangeId(changeid.group(2), True)
+
+ # Maybe this is a patch that has not merged yet
+ logger.info("did not find Change-Id from git.properties as merged in %s, trying as unmerged: %s",
+ project, changeid.group(2))
+
+ gerrits = self.gerritquery.get_gerrits(project, changeid.group(2), 1, None, status=None, comments=True)
+ if gerrits:
+ logger.info("found Change-Id from git.properties as unmerged in %s", project)
+ return ChangeId(gerrits[0]["id"], False)
+
+ logger.info("did not find Change-Id from git.properties in %s, trying commitid", project)
+
+ # match a git commit id
+ commitid = self.regex_commitid.search(pfile)
+ if commitid and commitid.group(2):
+ logger.info("trying commitid from git.properties in %s: %s", project, commitid.group(2))
+
+ gerrits = self.gerritquery.get_gerrits(project, commitid=commitid.group(2))
+ if gerrits:
+ logger.info("found Change-Id from git.properties as unmerged in %s", project)
+ return ChangeId(gerrits[0]["id"], True)