[PATCH 5 of 5] bookmark: don't allow revsets as bookmark/branch/tag names

timeless timeless at gmail.com
Fri Jan 15 11:18:51 CST 2016


Sounds good. I won't be able to do that before Wednesday, and it seems like
it's more than a simple one liner, so probably later.

Thanks for the suggestions.
On Jan 15, 2016 8:40 AM, "Yuya Nishihara" <yuya at tcha.org> wrote:

> On Thu, 14 Jan 2016 13:16:33 -0500, timeless wrote:
> > Yuya Nishihara wrote:
> > > On Sun, 10 Jan 2016 12:57:52 -0600, timeless wrote:
> > >> +    except error.ParseError:
> > >> +        pass
> > >> +    except error.RepoLookupError:
> > >> +        pass
> > >
> > > Perhaps LookupError, Abort, etc. can happen.
> >
> > I wish I had some way of knowing if they could.
>
> Oh, exception specifications.
>
> > > Do you really want to check all sort of revset expressions? From the
> test
> > > output, it seems you just wanted to warn about conflicting names.
> >
> > Oh, I didn't include my main case in my tests (added):
> >
> > hg bookmark foo .^
> >
> > specifically, that creates a bookmark named `.^` which conflicts with
> > the revset `.^`.
>
> Then, how about checking if new bookmark name is parsable as a revset?
> revset.parse() won't raise arbitrary exceptions. Also, hg bookmark "not
> all()"
> should match nothing, but it does shadow the expression.
>
>  1. check name conflicts
>     not found -> ok
>     found in other namespace -> warn
>  2. check revset conflicts
>     syntax error -> ok
>     parsed to symbol -> ok
>     parsed to expression -> warn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20160115/0c5c26d1/attachment.html>


More information about the Mercurial-devel mailing list