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>
import shutil
import sys
+from urllib.parse import quote_plus
+
def clone_fork(args):
ref = None
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',\
parser.print_help()
exit(1)
+
if __name__ == "__main__":
main()