Commit Graph

117 Commits

Author SHA1 Message Date
Matt Mackall
d2ef9d821b revset: roots needs to be computed on full set 2012-01-17 17:48:59 -06:00
Matt Mackall
f3e58790bb revset: optimize roots and children 2012-01-16 01:21:30 -06:00
Matt Mackall
0c33089f33 revset: optimize building large lists in formatrevspec
The large or-expressions we used to build required a substantial
amount of subset filtering in orset() which was inefficient. Instead we build a
single string which we process in one go with a special internal predicate.
2012-01-16 01:21:22 -06:00
Pierre-Yves David
e929cd5e49 discovery: introduce outgoing object for result of findcommonoutgoing
Simplifies client logic in multiple places since it encapsulates the
computation of the common and, more importantly, the missing node lists.

This also allows an upcomping patch to communicate precomputed versions of
these lists to clients.
2012-01-09 03:47:16 +01:00
Pierre-Yves David
b6988087ea phases: implements simple revset symbol
This changeset adds ``public()``, ``draft()`` and ``secret`` symbol for
revset.
2012-01-06 10:04:20 +01:00
Martin Geisler
ba8731035e Use explicit integer division
Found by running the test suite with the -3 flag to show places where
we have int / int division that can be replaced with int // int.
2012-01-08 18:15:54 +01:00
FUJIWARA Katsunori
09db6940ae i18n: use "encoding.lower()" to normalize specified string for revset
some problematic encoding (e.g.: cp932) uses ASCII alphabet characters
in byte sequence of multi byte characters.

"str.lower()" on such byte sequence may treat distinct characters as
same one, and cause unexpected log matching.

this patch uses "encoding.lower()" instead of "str.lower()" to
normalize strings for compare.
2011-12-25 20:35:16 +09:00
Matt Mackall
a224af5d42 merge with stable 2011-12-01 01:42:03 -06:00
Matt Mackall
a837de171f revset: balance %l or-expressions (issue3129) 2011-11-30 22:43:24 -06:00
Matt Mackall
8de0c77dee revset: follow(nosuchfile) should give an empty set (issue3114) 2011-11-20 15:29:55 -06:00
Pierre-Yves David
4d3328f835 revset: disambiguous the node variable
The module could be confused with the function.
2011-10-21 14:15:58 +02:00
Matt Mackall
01c8789013 revset: deal with empty lists in formatspec 2011-10-21 12:12:21 -05:00
Matt Mackall
2ba9ce4879 revset: fix %r handling in formatspec 2011-10-15 12:52:43 -05:00
Matt Mackall
275981abb2 revset: add %r for embedded revset support to formatspec
This allows folding external revsets or lists of revsets into a revset
expression. Revsets are pre-parsed for validity so that syntax errors
don't escape.
2011-10-15 10:20:08 -05:00
Yann E. MORIN
c5cb886778 hbisect: add two new revset descriptions: 'goods' and 'bads'
This patch adds two new revset descriptions:
 - 'goods': the list of topologicaly-good csets:
   - if good csets are topologically before bad csets, yields '::good'
   - else, yields 'good::'
 - and conversely for 'bads'

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-24 01:32:50 +02:00
Yann E. MORIN
bd0d47a8d1 revset.bisect: add 'ignored' set to the bisect keyword
The 'ignored' changesets are outside the bisection range, but are
changesets that may have an impact on the outcome of the bisection.

For example, in case there's a merge between the good and bad csets,
but the branch-point is out of the bisection range, and the issue
originates from this branch, the branch will not be visited by bisect
and bisect will find that the culprit cset is the merge.

So, the 'ignored' set is equivalent to:
    (   ( ::bisect(bad) - ::bisect(good) )
      | ( ::bisect(good) - ::bisect(bad) ) )
    - bisect(range)

 - all ancestors of bad csets that are not ancestors of good csets, or
 - all ancestors of good csets that are not ancestors of bad csets
 - but that are not in the bisection range.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-20 20:21:04 +02:00
Yann E. MORIN
67456b9f23 hbisect.get: use simpler code with repo.set(), fix 'pruned' set
Use repo.set() wherever possible, instead of locally trying to
reproduce complex graph computations.

'pruned' now means 'all csets that will no longer be visited by the
bisection'. The change is done is this very patch instead of its own
dedicated one becasue the code changes all over the place, and the
previous 'pruned' code was totally rewritten by the cleanup, so it
was easier to just change the behavior at the same time.

The previous series went in too fast for this cleanup pass to be
included, so here it is. ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-20 20:19:48 +02:00
Matt Mackall
56d176a266 revset: add 'l' flag to formatspec for args
This makes it easy to calculate a revset with lists:

  good = [1, 2, 3]
  bad = [10, 11, 12]
  between = repo.set('%ld::%ld', good, bad)
2011-09-19 16:28:44 -05:00
Yann E. MORIN
bc668406c8 revset.bisect: add new 'untested' set to the bisect keyword
The 'untested' set is made of changesets that are in the bisection range
but for which the status is still unknown, and that can later be used to
further decide on the bisection outcome.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-17 14:33:20 +02:00
Yann E. MORIN
414f1cadec revset.bisect: add new 'pruned' set to the bisect keyword
The 'pruned' set is made of changesets that did participate to
the bisection. They are made of
 - all good changesets
 - all bad changsets
 - all skipped changesets, provided they are in the bisection range

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-17 17:30:35 +02:00
Yann E. MORIN
fdcfe85b83 revset.bisect: add new 'range' set to the bisect keyword
The 'range' set is made of all changesets that make the bisection
range, that is
 - csets that are ancestors of bad csets and descendants of good csets
 or
 - csets that are ancestors of good csets and descendants of bad csets

That is, roughly equivalent of:
  bisect(good)::bisect(bad) | bisect(bad)::bisect(good)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-17 17:33:34 +02:00
Yann E. MORIN
0223cbb500 revset.bisect: move bisect() code to hbisect.py
Computing the ranges of csets in the bisection belongs to the hbisect
code. This allows for reusing the status computation from many places,
not only the revset code, but also to later display the bisection status
of a cset...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-17 00:20:45 +02:00
Yann E. MORIN
0380741552 revset: rename bisected() to bisect()
Rename the 'bisected' keyword to simply 'bisect'.
Still accept the old name, but no longer advertise it.

As discussed with Matt on IRC.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-18 22:54:11 +02:00
Yann E. MORIN
944c91d0c2 revset.bisected: remove 'unknown' state
'unknown' is not a valid bisect state, so causes a traceback.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
2011-09-18 10:07:51 +02:00
Matt Mackall
9af29ec474 revsets: add first alias for last 2011-09-17 12:34:47 -05:00
Matt Mackall
708a429360 revset: add default of 1 to limit and last functions 2011-09-16 22:57:47 -05:00
Matt Mackall
005a60af31 revset: add formatspec convenience query builder 2011-07-21 14:05:45 -05:00
Matt Mackall
870a9eda45 revset: allow bypassing alias expansion
For internal usage of revset queries, we don't want aliases breaking things.
2011-07-21 14:04:57 -05:00
Matt Mackall
47766aa6d3 revsets: actually catch type error on tip^p1(tip) (issue2884)
The previous commit was empty.
2011-07-12 12:35:03 -05:00
Matt Mackall
73b047e45e revsets: do the right thing with x^:y (issue2884)
Given an operator ^ that's either postfix or infix and an operator :
that's either prefix or infix, the parser can't figure out the right
thing to do. So we rewrite the expression to be sensible in the optimizer.
2011-07-06 13:37:50 -05:00
Mads Kiilerich
ed0023acf6 revset: fix aliases with 0 or more than 2 parameters
The existing code seemed to have incorrect assumptions about how parameter
lists are represented by the parser.

Now the match and replace functions have been merged and simplified by using
getlist().
2011-06-22 01:55:00 +02:00
Mads Kiilerich
7cf147b1a4 revset and fileset: fix typos in parser error messages 2011-06-22 01:55:00 +02:00
Mads Kiilerich
8ef684c2fc revset: fix parameter name in implementation of follow() 2011-06-24 00:18:06 +02:00
Mads Kiilerich
473bcd3ed1 parsers: fix localization markup of parser errors 2011-06-21 00:17:52 +02:00
Thomas Arendsen Hein
282b06cd6f revset: add desc(string) to search in commit messages
Like keyword(), but does not search in filenames and users.
No grepdesc() or descgrep() added, because it might be bad to introduce
grepfoo() versions of too many string searches.
2011-06-16 22:47:34 +02:00
Thomas Arendsen Hein
f770eadd10 revset: update sorting of symbols 2011-06-16 22:03:26 +02:00
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