Changeset View
Changeset View
Standalone View
Standalone View
contrib/buildbot/phabricator_wrapper.py
Show First 20 Lines • Show All 362 Lines • ▼ Show 20 Lines | def get_latest_master_commit_hash(self): | ||||
if not commit_data: | if not commit_data: | ||||
raise AssertionError( | raise AssertionError( | ||||
"Failed to get last master commit for repository {}".format(BITCOIN_ABC_REPO)) | "Failed to get last master commit for repository {}".format(BITCOIN_ABC_REPO)) | ||||
return commit_data[0]["fields"]["identifier"] | return commit_data[0]["fields"]["identifier"] | ||||
def get_revision_changed_files(self, revision_id): | def get_revision_changed_files(self, revision_id): | ||||
return list(self.differential.getcommitpaths( | return list(self.differential.getcommitpaths( | ||||
revision_id=int(revision_id)).values()) | revision_id=int(revision_id))) | ||||
def get_file_content_from_master(self, path): | def get_file_content_from_master(self, path): | ||||
latest_commit_hash = self.get_latest_master_commit_hash() | latest_commit_hash = self.get_latest_master_commit_hash() | ||||
# Level 1 cache: check if the file is cached from the same commit | # Level 1 cache: check if the file is cached from the same commit | ||||
if path in self.file_cache and self.file_cache[path]['commit'] == latest_commit_hash: | if path in self.file_cache and self.file_cache[path]['commit'] == latest_commit_hash: | ||||
return self.file_cache[path]['content'] | return self.file_cache[path]['content'] | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |