mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 22:47:26 +03:00
phabdiff: allow reviewers to be used as a string
Summary: It was a list. Make it possible to use it as a string. Reviewed By: xavierd Differential Revision: D20144811 fbshipit-source-id: b280c0344215a4c23ab9c63d89f47adf34fb06f3
This commit is contained in:
parent
d21bdf7e1b
commit
b1f8456309
@ -59,5 +59,7 @@ def showreviewers(repo, ctx, templ, **args):
|
||||
descr = ctx.description()
|
||||
match = re.search("Reviewers:(.*)", descr)
|
||||
if match:
|
||||
reviewers = filter(None, re.split(r"[\s,]", match.group(1)))
|
||||
reviewers = list(filter(None, re.split(r"[\s,]", match.group(1))))
|
||||
args = args.copy()
|
||||
args["templ"] = " ".join(reviewers)
|
||||
return templatekw.showlist("reviewer", reviewers, args)
|
||||
|
@ -48,6 +48,8 @@ Test reviewers label
|
||||
$ echo f > f
|
||||
$ hg commit -Aqm "Differential Revision: http://phabricator.intern.facebook.com/D9876
|
||||
> Reviewers: xlwang, quark durham, rmcelroy"
|
||||
$ hg log -r . --template '{reviewers}\n'
|
||||
xlwang quark durham rmcelroy
|
||||
$ hg log -r . --template '{reviewers % "- {reviewer}\n"}\n'
|
||||
- xlwang
|
||||
- quark
|
||||
|
Loading…
Reference in New Issue
Block a user