Add flag to push to refs/for/* for compatibilty.
Fixes bug #1005101 Versions of Gerrit < 2.3 do not support pushing to the refs/publish/* ref. Add a flag to allow users of older version of Gerrit to push to the deprecated refs/for/* ref. Change-Id: Iff268c594b9e6d9b7c81b86b91f74f47395ee3b1
This commit is contained in:
@@ -731,6 +731,11 @@ def main():
|
|||||||
help="Topic to submit branch to")
|
help="Topic to submit branch to")
|
||||||
parser.add_argument("-D", "--draft", dest="draft", action="store_true",
|
parser.add_argument("-D", "--draft", dest="draft", action="store_true",
|
||||||
help="Submit review as a draft")
|
help="Submit review as a draft")
|
||||||
|
parser.add_argument("-c", "--compatible", dest="compatible",
|
||||||
|
action="store_true",
|
||||||
|
help="Push change to refs/for/* for compatibility "
|
||||||
|
"with Gerrit versions < 2.3. Ignored if "
|
||||||
|
"-D/--draft is used.")
|
||||||
parser.add_argument("-n", "--dry-run", dest="dry", action="store_true",
|
parser.add_argument("-n", "--dry-run", dest="dry", action="store_true",
|
||||||
help="Don't actually submit the branch for review")
|
help="Don't actually submit the branch for review")
|
||||||
parser.add_argument("-r", "--remote", dest="remote",
|
parser.add_argument("-r", "--remote", dest="remote",
|
||||||
@@ -821,6 +826,8 @@ def main():
|
|||||||
|
|
||||||
if options.draft:
|
if options.draft:
|
||||||
ref = "drafts"
|
ref = "drafts"
|
||||||
|
elif options.compatible:
|
||||||
|
ref = "for"
|
||||||
|
|
||||||
cmd = "git push %s HEAD:refs/%s/%s/%s" % (remote, ref, branch,
|
cmd = "git push %s HEAD:refs/%s/%s/%s" % (remote, ref, branch,
|
||||||
topic)
|
topic)
|
||||||
|
Reference in New Issue
Block a user