Commit Graph

343 Commits

Author SHA1 Message Date
Wagner Bruna
a056b85166 revset: fix outgoing argument handling 2010-08-12 20:54:34 -03:00
Matt Mackall
4e44d8a129 revset: fix ancestor subset handling (issue2298) 2010-07-22 08:17:38 -05:00
Nicolas Dumazet
5ab42d56dc revset: add min function 2010-07-30 10:07:46 +09:00
Matt Mackall
63b3d97fcf revset: make negate work for sort specs 2010-06-30 17:44:36 -05:00
Matt Mackall
d4380e872d revset: deal with empty sets in range endpoints
(spotted by Julian Cowley <julian@lava.net>)
2010-06-28 11:07:27 -05:00
Julian Cowley
dde4582c77 revset: remove debugging leftover 2010-06-25 01:27:25 -10:00
Matt Mackall
ca34f1b48d revset: fix up contains/getstring when no args passed 2010-06-19 13:00:08 -05:00
Matt Mackall
e5e3827657 revset: allow extended characters in symbols 2010-06-19 12:22:35 -05:00
Matt Mackall
188c0aac63 revset: nicer exception for empty queries 2010-06-18 17:34:13 -05:00
Martin Geisler
cebeb8aea1 revset: all your error messages are belong to _ 2010-06-18 21:31:19 +02:00
Georg Brandl
072ab526a7 revset: fix call to ctx.extra() in closed() 2010-06-13 23:25:27 +02:00
Matt Mackall
ef2640cd30 revset: improve filter argument handling 2010-06-11 15:30:12 -05:00
Dirkjan Ochtman
cb25b6f79d cleanups: unused variables 2010-06-08 09:30:33 +02:00
Dirkjan Ochtman
cf1de649bd move discovery methods from localrepo into new discovery module 2010-06-07 18:35:54 +02:00
Matt Mackall
420e7ec722 revset: delay import of hg to avoid start-up import loops 2010-06-05 09:58:02 -05:00
Matt Mackall
a963622643 revset: raise ParseError exceptions 2010-06-04 20:57:52 -05:00
Matt Mackall
fd94af4829 revset: sort the predicate list 2010-06-04 10:27:23 -05:00
Matt Mackall
4fb1269ccb revset: fix - handling in the optimizer 2010-06-04 10:26:55 -05:00
Matt Mackall
db01b4c21d revset: fix up tests 2010-06-03 20:32:41 -05:00
Matt Mackall
8b6cd36757 revset: add tagged predicate 2010-06-03 17:39:40 -05:00
Matt Mackall
485a62ae68 revset: optimize the parse tree directly
Rather than dynamically optimize in methods, we pre-optimize the parse tree
directly. This also lets us do some substitution on some of the
symbols like - and ::.
2010-06-03 17:39:34 -05:00
Matt Mackall
96ee2ad35a revset: add support for prefix and suffix versions of : and :: 2010-06-02 14:07:46 -05:00
Matt Mackall
c3f24aa62b revset: introduce revset core 2010-06-01 11:18:57 -05:00
Peter Arrenbrecht
d4abc4d642 discovery: resurrect findoutgoing as findcommonoutgoing for extension hooks
discovery.findoutgoing used to be a useful hook for extensions like
hgsubversion. This patch reintroduces this version of findcommonincoming
which is meant to be used when computing outgoing changesets.
2011-05-06 14:44:18 +02:00
Mads Kiilerich
6cadc46456 revset: avoid over-aggresive optimizations of non-filtering functions (issue2549)
When limit, last, min and max were evaluated they worked on a reduced set in the
wrong way. Now they work on an unrestricted set (the whole repo) and get
limited later on.
2011-05-01 17:35:05 +02:00
Alexander Solovyov
2f6ab6bf04 revset aliases 2011-04-30 18:30:14 +02:00
Peter Arrenbrecht
b867e650e6 discovery: drop findoutgoing and simplify findcommonincoming's api
This is a long desired cleanup and paves the way for new discovery.
To specify subsets for bundling changes, all code should use the heads
of the desired subset ("heads") and the heads of the common subset
("common") to be excluded from the bundled set. These can be used
revlog.findmissing instead of revlog.nodesbetween.

This fixes an actual bug exposed by the change in test-bundle-r.t
where we try to bundle a changeset while specifying that said changeset
is to be assumed already present in the target. This used to still
bundle the changeset. It no longer does. This is similar to the bugs
fixed by the recent switch to heads/common for incoming/pull.
2011-04-30 17:21:37 +02:00
Kevin Gessner
ee9623e8dc revset: add missing whitespace 2011-04-30 18:25:45 +02:00
Kevin Gessner
c6374d2d98 revset: add ^ and ~ operators from parentrevspec extension
^ (Nth parent) and ~ (Nth first ancestor) are infix operators that match
certain ancestors of the set:

  set^0
  the set

  set^1 (also available as set^)
  the first parent of every changeset in set

  set^2
  the second parent of every changeset in set

  set~0
  the set

  set~1
  the first ancestor (i.e. the first parent) of every changeset in set

  set~2
  the second ancestor (i.e. first parent of first parent) of every changeset
  in set

  set~N
  the Nth ancestor (following first parents only) of every changeset in set;
  set~N is equivalent to set^1^1..., with ^1 repeated N times.
2011-04-30 17:43:04 +02:00
Matt Mackall
d1ce6e070f revsets: add a last function
last(set, n) = reverser(limit(reverse(set), n))
2011-04-30 10:56:43 -05:00
Brodie Rao
9c3a456083 revset: fix undefined name ParseError 2011-04-30 06:58:22 -07:00
Idan Kamara
cb694c6958 revset: optimize stringset when subset == entire repo
if range(len(repo)) is passed to stringset and x is a valid rev
(checked before) then x is guaranteed to be in subset, we can check
for that by comparing the lengths of the sets
2011-04-15 20:07:44 +03:00
Augie Fackler
52f8941398 revsets: preserve ordering with the or operator
This is valuable because now revsets like 'bookmarks() or tip' will
always show tip after bookmarks unless tip was itself a bookmark. This
is a somewhat contrived example, but this behavior is useful for
"where am I" type aliases that use log and revsets.
2011-04-13 12:30:41 -05:00
Idan Kamara
05b035daf6 revset: rearrange code so functions are sorted alphabetically 2011-04-08 17:47:58 +03:00
Idan Kamara
32b6eeef14 revset: abort when tag or bookmark doesn't exist 2011-04-07 19:24:16 +03:00
Idan Kamara
35ad577c17 revset: replace for-loop with list comprehension 2011-04-07 16:20:40 +03:00
Matt Mackall
a8dd64dcb0 misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
Matt Mackall
8bd04923bb revset: teach optimizer that closed is slowish 2011-04-04 14:21:54 -05:00
Matt Mackall
49184b9450 # User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
# Date 1289564504 -3600
# Node ID b75264c15cc888cf38c3c7b8f619801e3c2589c7
# Parent  89b2e5d940f669e590096c6be70eee61c9172fff
revsets: overload the branch() revset to also take a branch name.

This should only change semantics in the specific case of a tag/branch
conflict where the tag wasn't done on the branch with the same
name. Previously, branch(whatever) would resolve to the branch of the
tag in that case, whereas now it will resolve to the branch of the
name. The previous behaviour, while documented, seemed very
counter-intuitive to me.

An alternate approach would be to introduce a new revset such as
branchname() or namedbranch(). While this would retain backwards
compatibility, the distinction between it and branch() would not be
readily apparent to users. The most intuitive behaviour would be to
have branch(x) require 'x' to be a branch name, and something like
branchof(x) or samebranch(x) do what branch(x) currently
does. Unfortunately, our backwards compatibility guarantees prevent us
from doing that.

Please note that while 'hg tag' guards against shadowing a branch, 'hg
branch' does not. Besides, even if it did, that wouldn't solve the
issue of conversions with such tags and branches...
2011-03-23 19:28:16 -05:00
Markus F.X.J. Oberhumer
489871ea69 revset: fix a number of highly dubious continue statements
This patch definitely needs a review and would also benefit from
some new testsuite entries.
2011-03-16 23:54:55 +01:00
Bernhard Leiner
baf797018e revset: report a parse error if a revset is not parsed completely (issue2654) 2011-03-16 23:09:14 +01:00
Benoit Boissinot
544721ef7a revset: add a revset command to get bisect state. 2011-03-12 18:48:30 +01:00
Patrick Mezard
d297dd65c7 help: extract items doc generation function 2011-03-12 12:46:31 +01:00