summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-09-23 10:09:18 -0400
committerTim Rozet <trozet@redhat.com>2017-09-23 10:09:18 -0400
commit30a8bb049eaf1e3df040a6cb8052bafbb5dcd131 (patch)
treec5f5491ab1a93c1909753de1686d0c9aa350bc7a
parent533de7d23345f63709d17f0d18ad40923d3c4ef5 (diff)
Fixes clone fork change URL
Downloading the change information was failing for branches other than master. This fixes the URL format to work for branches. Change-Id: I5ec0494aca93437266237ee63b292a6aa5a43f0e Signed-off-by: Tim Rozet <trozet@redhat.com>
-rw-r--r--apex/build/build_utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/apex/build/build_utils.py b/apex/build/build_utils.py
index 14327a90..66a63d37 100644
--- a/apex/build/build_utils.py
+++ b/apex/build/build_utils.py
@@ -16,6 +16,8 @@ import re
import shutil
import sys
+from urllib.parse import quote_plus
+
def clone_fork(args):
ref = None
@@ -35,7 +37,9 @@ def clone_fork(args):
change_id = m.group(1)
logging.info("Using change ID {} from {}".format(change_id, args.repo))
rest = GerritRestAPI(url=args.url)
- change_str = "changes/{}?o=CURRENT_REVISION".format(change_id)
+ change_path = "{}~{}~{}".format(args.repo, quote_plus(args.branch),
+ change_id)
+ change_str = "changes/{}?o=CURRENT_REVISION".format(change_path)
change = rest.get(change_str)
try:
assert change['status'] not in 'ABANDONED' 'CLOSED',\
@@ -104,5 +108,6 @@ def main():
parser.print_help()
exit(1)
+
if __name__ == "__main__":
main()