[PATCH 4 of 9] bookmarks: disallow bookmarks named 'tip', '.', or 'null'

Idan Kamara idankk86 at gmail.com
Thu Oct 18 06:13:59 CDT 2012


On Thu, Oct 18, 2012 at 5:31 AM, Kevin Bullock <
kbullock+mercurial at ringworld.org> wrote:
>
> # HG changeset patch
> # User Kevin Bullock <kbullock at ringworld.org>
> # Date 1350509563 18000
> # Node ID 2a50542fd0a2626b1e7bdab5b35d32220f4bbb7f
> # Parent  de8aa47d28efd29ecdeaeb03f8cc49dc15650fb9
> bookmarks: disallow bookmarks named 'tip', '.', or 'null'
>
> This makes bookmarks reject the same reserved names as tags and branches.
>
> diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
> --- a/mercurial/bookmarks.py
> +++ b/mercurial/bookmarks.py
> @@ -15,6 +15,8 @@ def checkvalid(mark):
>          if c in mark:
>              raise util.Abort(_("bookmark '%s' contains illegal "
>                  "character" % mark))
> +    if mark in ['tip', '.', 'null']:
> +        raise util.Abort(_('the name \'%s\' is reserved') % mark)

FYI, you can use %r instead of '%s'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121018/7216f346/attachment.html>


More information about the Mercurial-devel mailing list