[PATCH 6 of 9] bookmarks: use scmutil.checknewlabel
Kevin Bullock
kbullock+mercurial at ringworld.org
Thu Oct 18 09:38:14 CDT 2012
On Oct 18, 2012, at 8:25 AM, dsp at php.net wrote:
> On 10/18/2012 05:31 AM, Kevin Bullock wrote:
>> # HG changeset patch
>> # User Kevin Bullock <kbullock at ringworld.org>
>> # Date 1350512619 18000
>> # Node ID e4083c2811721ad7f408b9540c325e4b97d38ecf
>> # Parent 614653e8d2896effe42c94c196f2de9a1b333a5f
>> bookmarks: use scmutil.checknewlabel
>
>> diff --git a/mercurial/commands.py b/mercurial/commands.py
>> --- a/mercurial/commands.py
>> +++ b/mercurial/commands.py
>> @@ -794,6 +794,11 @@ def bookmark(ui, repo, mark=None, rev=No
>> if not mark:
>> raise util.Abort(_("bookmark names cannot consist entirely of "
>> "whitespace"))
>> + for c in (':', '\0', '\n', '\r'):
>> + if c in mark:
>> + raise util.Abort(_("bookmark '%s' contains illegal "
>> + "character" % mark))
>> + scmutil.checknewlabel(repo, mark)Just as a remark:
>
> moving this check to the bookmark command will allow users to push
> invalid bookmarks to a remote repository. I am not sure if we really
> want that. But then, the same goes for tags already, you can create a
> tag manually in the .hgtags file and happily push (afaik).
>
> ps.: resend as the first mail went just to kevin
(re-replying, to whole list this time. need moar coffee.)
We can probably fix that up later by calling scmutil.checknewlabel from the appropriate place in the repo code.
pacem in terris / мир / शान्ति / سَلاَم / 平和
Kevin R. Bullock
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121018/6c27bf57/attachment.html>
More information about the Mercurial-devel
mailing list