Fix some issues in add-reviewers
* Deal with utf-8 in human names. To avoid requiring six, just check the python version. * Allow the review identifier to be a commit hash instead just a review int as there can be conflicts: https://code.google.com/p/gerrit/issues/detail?id=1707 Change-Id: Ie89dfd7212f72355ab00c0c8dc9edf07f686488b
This commit is contained in:
parent
9aa075a2e3
commit
7b4c8ddaf5
|
@ -4,6 +4,7 @@ import argparse
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,7 +15,7 @@ def parse_args():
|
||||||
parser.add_argument('--debug', help="Print debugging information",
|
parser.add_argument('--debug', help="Print debugging information",
|
||||||
action='store_true')
|
action='store_true')
|
||||||
parser.add_argument("username", help="Your Gerrit username", type=str)
|
parser.add_argument("username", help="Your Gerrit username", type=str)
|
||||||
parser.add_argument("review", help="An API WG Gerrit review", type=int)
|
parser.add_argument("review", help="An API WG Gerrit review", type=str)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
return (args.debug, args.username, args.review)
|
return (args.debug, args.username, args.review)
|
||||||
|
@ -38,6 +39,9 @@ def add_reviewers(debug, username, liaisons, review):
|
||||||
]
|
]
|
||||||
|
|
||||||
for liaison in liaisons:
|
for liaison in liaisons:
|
||||||
|
# Hack to avoid six
|
||||||
|
if sys.version_info.major < 3:
|
||||||
|
liaison = liaison.encode('utf-8')
|
||||||
gerrit.append('--add "{}"'.format(liaison))
|
gerrit.append('--add "{}"'.format(liaison))
|
||||||
|
|
||||||
gerrit.append('{}'.format(review))
|
gerrit.append('{}'.format(review))
|
||||||
|
|
Loading…
Reference in New Issue