Concept of the day: filesets?

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Nov 16 13:38:39 CST 2010


On Nov 16, 2010, at 1:15 PM, Matt Mackall wrote:

> What if we applied the revset query language concept to file patterns?
> 
> We have long had the ability to do:
> 
>  hg ci "re:(foo|bar).*"
> 
> We can specify re/glob/path just about wherever filenames are taken. If
> we add a new set type, we can now do:
> 
>  hg ci "set: modified() and contains('mpm') and exec() and not glob('**.py')" 

I love this idea.

> Want to check in only files not in a subrepo?
> 
>  hg ci "set: not subrepo()"

The subrepo() predicate would presumably match .hgsub and .hgsubstate as well?

Brainstorming predicates/functions:

Basic status: added(), modified(), deleted(), removed(), ignored(), unknown(), clean()
Extended status: copied(), renamed()
Merge status: unresolved(), resolved()
Paths: glob(str), re(str)
Contents: contains(str/regex?)
Metadata: user(str) [modified by user]

What about making at least some predicates take revsets too? So you could do:

 hg log 'added(date(2010-01-01 to 2010-02-01))'

First commands I would expect to take these filesets: st, log, ci, and anything that takes -X and -I... I'm sure there's others to add to that list.

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock



More information about the Mercurial-devel mailing list