Commit 5c9e8b47 authored by Michael Moss's avatar Michael Moss Committed by LUCI CQ

Don't escape "commit" value for Gerrit branch/tag creation.

This value is passed in the JSON body, not in the URL, so does not need
to be escaped, otherwise trying to make a branch/tag from another
branch/tag leads to errors like:

  gerrit_util.GerritError: (400) Bad Request: invalid revision "refs%2Fheads%2Fchromium%2F4665"

BUG=1052179
R=linxinan@chromium.org, sokcevic@google.com

Change-Id: I80d709370165fcb84a3375e18b67d4a921be9a8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3243724
Auto-Submit: Michael Moss <mmoss@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: 's avatarXinan Lin <linxinan@chromium.org>
Reviewed-by: 's avatarJosip Sokcevic <sokcevic@google.com>
Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
parent 56313826
......@@ -121,8 +121,7 @@ def CMDbranch(parser, args):
project = quote_plus(opt.project)
host = urlparse.urlparse(opt.host).netloc
branch = quote_plus(opt.branch)
commit = quote_plus(opt.commit)
result = gerrit_util.CreateGerritBranch(host, project, branch, commit)
result = gerrit_util.CreateGerritBranch(host, project, branch, opt.commit)
logging.info(result)
write_result(result, opt)
......@@ -141,8 +140,7 @@ def CMDtag(parser, args):
project = quote_plus(opt.project)
host = urlparse.urlparse(opt.host).netloc
tag = quote_plus(opt.tag)
commit = quote_plus(opt.commit)
result = gerrit_util.CreateGerritTag(host, project, tag, commit)
result = gerrit_util.CreateGerritTag(host, project, tag, opt.commit)
logging.info(result)
write_result(result, opt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment