Commit Graph

81 Commits

Author SHA1 Message Date
Matt Mackall
efecb99535 hg: change various repository() users to use peer() where appropriate
This gets all the easy cases (peers that aren't also used as repositories).
2011-06-10 11:43:38 -05:00
Martin Geisler
9bc622d2ad merge with stable 2011-05-18 09:56:27 +02:00
Martin Geisler
9ea41d9e6c revset: the name is optional for the tag predicate 2011-05-18 09:31:19 +02:00
Martin Geisler
c9db075708 revset: note case-sensitive match in grep 2011-05-18 09:28:11 +02:00
Martin Geisler
009dc5d112 revset: note case-insensitive matches in keyword and user 2011-05-18 09:20:52 +02:00
Martin Geisler
e7ee99da82 revset: expand help for contains predicate 2011-05-18 09:15:18 +02:00
Matt Mackall
3974d4288a revset: add follow(filename) to follow a filename's history across copies 2011-05-16 17:02:35 -05:00
Matt Mackall
01a4d248e5 revset: introduce filelog() to emulate log's fast path
filelog() only reports revisions present in the matching filelogs.
2011-05-16 17:02:35 -05:00
Matt Mackall
1d5abac148 help: consolidate topic hooks in help.py
This removes loops like cmdutil->revset->help->extensions->cmdutil and
simplifies the code.
2011-05-13 12:57:27 -05:00
Mads Kiilerich
25da754c3d revset: fix typo when assigning weight to reverse and limit 2011-02-24 00:47:49 +01:00
Matt Mackall
018d171646 bookmarks: move revset support to core 2011-02-10 13:46:28 -06:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Patrick Mezard
43a1583455 revset: remove unnecessary debug statement 2010-11-07 18:15:17 +01:00
Patrick Mezard
a6f7f2ff05 revset: fix p1, p2 and parents in dirstate case (60aa454e7734)
- Handle 'subset' argument
- Stop returning the null rev from p1 and parents, as in the non-dirstate case
- Order parents as in the non-dirstate case (ascending revs)
2010-11-07 18:14:42 +01:00
Kevin Bullock
e238d72ecb revsets: let parents() return parents of working dir
This patch makes the 'set' argument to revset function parents() optional.
Like p1() and p2(), if no argument is given, returns the parent(s) of the
working directory.

Morally equivalent to 'p1()+p2()', as expected.
2010-11-04 17:09:00 -05:00
Kevin Bullock
63e0b7b699 revsets: let p1() and p2() return parents of working dir
This patch makes the 'set' argument to revset functions p1() and p2()
optional. If no argument is given, p1() and p2() return the first or second
parent of the working directory.

If the working directory is not an in-progress merge (no 2nd parent), p2()
returns the empty set. For a checkout of the null changeset, both p1() and
p2() return the empty set.
2010-11-04 16:59:03 -05:00
Wagner Bruna
1981a0d6f6 revset: fix missing dot in docstring 2010-10-27 12:12:51 -02:00
Wagner Bruna
2bff625586 i18n: translate revset predicate docstrings 2010-10-26 23:51:01 -02:00
Patrick Mezard
3fd83b5b68 hggettext: handle i18nfunctions declaration for docstrings translations 2010-10-24 12:52:37 +02:00
Patrick Mezard
c832c42c0c revsets: generate predicate help dynamically 2010-10-23 19:21:51 +02:00
Martin Geisler
3ef0b64b6f revset: add translator comments to i18n strings 2010-10-23 14:59:19 +02:00
Wagner Bruna
d4398837df revset: disable subset optimization for parents() and children() (issue2437)
For the boolean operators, the subset optimization works by calculating
the cheaper argument first, and passing the subset to the second
argument to restrict the revision domain. This works well for filtering
predicates.

But parents() don't work like a filter: it may return revisions outside the
specified set. So, combining it with boolean operators may easily yield
incorrect results. For instance, for the following revision graph:

0 -- 1

the expression '0 and parents(1)' should evaluate as follows:

0 and parents(1) ->
0 and 0 ->
0

But since [0] is passed to parents() as a subset, we get instead:

0 and parents(1 and 0) ->
0 and parents([]) ->
0 and [] ->
[]

This also affects children(), p1() and p2(), for the same reasons.
Predicates that call these (like heads()) are also affected.

We work around this issue by ignoring the subset when propagating
the call inside those predicates.
2010-10-15 03:30:38 -03:00
Benoit Boissinot
d7dc2daaa0 revset: use 'requires' instead of 'wants' in error message 2010-10-16 18:50:53 +02:00
Augie Fackler
0e09df5a9e revset id(): fix error text to say "id wants..." instead of "rev wants..." 2010-10-12 23:33:43 -05:00
Augie Fackler
5fe5470142 revset: add id() and rev() to allow explicitly referring to changes by hash or rev 2010-10-11 09:44:19 -05:00
Augie Fackler
4a386faa07 revset: rename tagged() to tag() and allow it to take an optional tag name 2010-10-10 12:41:36 -05:00
Matt Mackall
67a62aa820 revset: lower precedence of minus infix (issue2361) 2010-10-07 11:45:17 -05:00
Henrik Stuart
e96bfa211b merge with stable 2010-10-05 20:25:51 +02:00
Adrian Buehlmann
5fa66b2722 revset: fix #branch in urls for outgoing()
hg log -r 'outgoing(..)' ignored #branch in some cases.
This patch fixes it.

The cases where it misbehaved are now covered by the added
test-revset-outgoing.t
2010-10-05 11:34:13 +02:00
Brodie Rao
04db466f58 revset: handle re.compile() errors in grep()
Raise error.ParseError instead of allowing re.error to bubble up.
2010-09-17 10:21:02 -05:00
Brodie Rao
2104af5ee2 revset: support raw string literals
This adds support for r'...' and r"..." as string literals. Strings
with the "r" prefix will not have their escape characters interpreted.

This is especially useful for grep(), where, with regular string
literals, \number is interpreted as an octal escape code, and \b is
interpreted as the backspace character (\x08).
2010-09-24 15:36:53 -05:00
Matt Mackall
51b3b09c8f backout most of 26e0b9a8ce0d 2010-09-24 12:46:54 -05:00
Brodie Rao
7362459729 cleanup: use x in (a, b) instead of x == a or x == b 2010-09-23 00:02:31 -05:00
Matt Mackall
fc9b3fe966 revsets: reduce cost of outgoing in the optimizer 2010-09-20 16:40:36 -05:00
Martin Geisler
989dda555a merge with stable 2010-09-20 15:42:58 +02:00
Martin Geisler
80db87965d Consistently import foo as foomod when foo to avoid shadowing
This is in the style of 1aaceccaf1dc.
2010-08-30 14:38:24 +02:00
Wagner Bruna
64365a9e84 revset: predicate to avoid lookup errors
A query like

head() and (descendants("bad") and not descendants("fix"))

(testing if repo heads are affected by a bug) will abort with a
RepoLookupError if either badrev or fixrev aren't found inside
the repository, which is not very informative.

The new predicate returns an empty set for lookup errors, so

head() and (descendants(present("bad")) and not descendants(present("fix")))

will behave as wanted even if those revisions are not found.
2010-08-13 13:11:41 -03:00
Martin Geisler
ec0bf03276 Merge with stable 2010-08-15 18:13:46 +02:00
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