monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Extended selectors


From: Timothy Brownawell
Subject: [Monotone-devel] Extended selectors
Date: Thu, 03 Jun 2010 21:17:00 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100515 Icedove/3.0.4

I have a branch net.venge.monotone.extended-selectors that allows selectors to use graph operations, and be combined with 'or' as well as 'and'.

It allows things like for example
mtn diff -r 'lca(h:*extended-selectors;h:net.venge.monotone)' -r h:*extended-selectors

The additional things you can do with selectors are:
   foo|bar|baz
      'or' (to go with the foo/bar/baz 'and' we already have)
   (foo|bar)/(baz|qux)
      grouping parentheses, directly mixing '/' and '|' is actually
      forbidden so you can't get confused about what it will do
   function(foo) or function(foo;bar)
      functions that do something with the results of one or more
      other selectors. I have ';' as the argument separator, because
      if/when date selectors are extended to accept things besides
      YYYY-MM-DDTHH:MI:SS we'll probably want to allow full date
      formatting which often includes commas.

The functions I currently have are lca (least common ancestors, using non-strict ancestors), max (erase-ancestors), difference (set difference, revisions selected by the first argument but not the second), ancestors (strict ancestors), descendants (strict again), parents ('parents(i:...)' is the same as 'p:...'), and children. I think there should probably also be a 'single' or 'pick' function, that just picks a single revision from its input (so for example "up -r h:some-branch" will fail on multiple heads, but "up -r 'pick(h:some-branch)'" will just not-really-randomly pick a head to update to). Is there anything else we should have?

This does have some string changes, so it's probably a bit late for the upcoming release.

--
Timothy

Free public monotone hosting: http://mtn-host.prjek.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]