[PATCH 5 of 5] revset: remove unused lookup argument from _tokenizealias()

Yuya Nishihara yuya at tcha.org
Thu Apr 7 08:02:15 EDT 2016


On Wed, 06 Apr 2016 15:10:13 -0500, Matt Mackall wrote:
> On Wed, 2016-04-06 at 21:19 +0900, Yuya Nishihara wrote:
> > On Tue, 05 Apr 2016 13:51:51 -0500, Matt Mackall wrote:  
> > > On Wed, 2016-03-30 at 00:27 +0900, Yuya Nishihara wrote:  
> > > > # HG changeset patch
> > > > # User Yuya Nishihara <yuya at tcha.org>
> > > > # Date 1456728392 -32400
> > > > #      Mon Feb 29 15:46:32 2016 +0900
> > > > # Node ID cf9abced341da9a63ad5daf49a908d39795aafb5
> > > > # Parent  092c90f4dad4e4e5870499819d4c0a2f4646e8fd
> > > > revset: remove unused lookup argument from _tokenizealias()
> > > > 
> > > > Since aliases are defined in configuration file, they should never have
> > > > tokens
> > > > that require a repository-dependent lookup function.  
> > > 
> > > That's not obvious to me.
> > > 
> > > It seems that if I have a branch named i-love-hyphens, and I can do:
> > > 
> > > $ hg log -r "i-love-hyphens% and author(mpm)"
> > > 
> > > ..then I should be able to turn that into a revset alias without having to
> > > change the quoting, right?  
> > 
> > Yeah, that should be possible. _tokenizealias() is the tokenizer for alias
> > definition,  
> 
> And I'm suggesting that the problematic branch name is -in- the alias. We can't
> tokenize the alias correctly without knowing that "i-love-hyphens" is a valid
> token.. and that requires a repo containing that token.

That means aliases are parsed differently across repositories, which is IMHO
troublesome rather than useful. You'll no longer be able to write a reliable
alias without quotes, e.g. "i"-"love"-"hyphens" since some repo might have
"i-love-hyphens" symbol.


More information about the Mercurial-devel mailing list