Page MenuHomeDevCentral

No OneTemporary

diff --git a/src/resolvehash/vcs/gerrit.py b/src/resolvehash/vcs/gerrit.py
index 0fe7a6b..f4f1a5d 100644
--- a/src/resolvehash/vcs/gerrit.py
+++ b/src/resolvehash/vcs/gerrit.py
@@ -1,38 +1,38 @@
# -------------------------------------------------------------
# Resolve hash :: VCS :: Gerrit
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Description: Search hash on Gerrit
# License: BSD-2-Clause
# -------------------------------------------------------------
import json
import requests
def query_gerrit_instance(instance, commit_hash):
- url = instance + "changes/?q=" + commit_hash
+ url = instance + "changes/?q=commit:" + commit_hash
r = requests.get(url)
if r.status_code != 200:
print(r.status_code)
return None
# We can't use r.json() as currently the API starts responses
# by an extra line ")]}'"
payload = r.text.strip().split("\n")[-1]
result = json.loads(payload)
if not result:
return None
change = result[0]
return f"{instance}c/{change['project']}/+/{change['_number']}"
def query_gerrit_instances(instances, commit_hash):
for instance in instances:
url = query_gerrit_instance(instance, commit_hash)
if url is not None:
return url

File Metadata

Mime Type
text/x-diff
Expires
Mon, Sep 14, 16:02 (6 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4085820
Default Alt Text
(1 KB)

Event Timeline