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:
Clark Boylan
2012-06-22 15:05:34 -07:00
parent 9e65cb14f3
commit 8dbea246b3

View File

@@ -731,6 +731,11 @@ def main():
help="Topic to submit branch to")
parser.add_argument("-D", "--draft", dest="draft", action="store_true",
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",
help="Don't actually submit the branch for review")
parser.add_argument("-r", "--remote", dest="remote",
@@ -821,6 +826,8 @@ def main():
if options.draft:
ref = "drafts"
elif options.compatible:
ref = "for"
cmd = "git push %s HEAD:refs/%s/%s/%s" % (remote, ref, branch,
topic)