Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F49506614
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
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
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Sep 14, 16:01 (6 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4085820
Default Alt Text
(1 KB)
Attached To
Mode
rRESOLVEHASH Resolve hash
Attached
Detach File
Event Timeline
Log In to Comment