Commit Graph

39 Commits

Author SHA1 Message Date
Augie Fackler
acff2f02d0 merge with stable 2014-01-01 18:28:40 -05:00
Yuya Nishihara
cb7a1dd14c fileset, revset: do not use global parser object for thread safety
parse() cannot be called at the same time because a parser object keeps its
states.  This is no problem for command-line hg client, but it would cause
strange errors in multi-threaded hgweb.

Creating parser object is not too expensive.

original:
% python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")'
100000 loops, best of 3: 11.3 usec per loop

thread-safe:
% python -m timeit -s 'from mercurial import revset' 'revset.parse("0::tip")'
100000 loops, best of 3: 13.1 usec per loop
2013-12-21 12:44:19 +09:00
Augie Fackler
9f876f6c89 cleanup: move stdlib imports to their own import statement
There are a few warnings still produced by my import checker, but
those are false positives produced by modules that share a name with
stdlib modules.
2013-11-06 16:48:06 -05:00
Matt Mackall
704604439e fileset: handle underbar in symbols
This was documented, but not implemented.
2013-07-23 14:18:56 -05:00
Bryan O'Sullivan
502e5bc1d1 util: migrate fileset._sizetoint to util.sizetoint
The size counting code introduced in 233431858f4c duplicated existing
(but unknown-to-me) code in fileset, so prepare to eliminate the
duplication.
2013-05-14 15:16:43 -07:00
Matt Mackall
2ad3a48eb3 filesets: add eol predicate 2013-03-29 16:48:32 -07:00
Mads Kiilerich
2d6545f8b6 subrepos: process subrepos in sorted order
Add sorted() in places found by testing with PYTHONHASHSEED=random and code
inspection.

An alternative to sprinkling sorted() all over would be to change substate to a
custom dict with sorted iterators...
2012-12-12 02:38:14 +01:00
Patrick Mezard
57f8b328dc fileset: fix generator vs list bug in fast path
$ hg debugfileset 'a or b'

would only return a or b but not both because the base file list was a
generator instead of a replayable sequence.
2012-08-15 22:50:23 +02:00
Patrick Mezard
afc53271b1 fileset: do not traceback on invalid grep pattern 2012-08-15 19:25:45 +02:00
Patrick Mezard
5874c142ff fileset: matchctx.existing() must consider ignored files
When running:

  $ hg debugfileset 'binary() and ignored()'

getfileset() was correctly retrieving ignored files but
matchctx.existing() was not taking them in account. Just add them along
with unknown files.
2012-08-15 22:29:32 +02:00
Patrick Mezard
faab1846cc fileset: matchctx.existing() must consider unknown files
By default, unknown files are ignored. If the 'unknown()' predicate
appears in the syntax tree, then they are taken in account.
Unfortunately, matchctx.existing() was filtering against non-deleted
context files, which does not include unknown files. So:

  $ hg debugfileset 'binary() and unknown()'

would not return existing binary unknown files.
2012-08-15 22:29:09 +02:00
Patrick Mezard
663673858e fileset: exclude deleted files from matchctx.existing()
Running:

  $ hg debugfileset 'binary()'

would traceback if there were one deleted file in the working directory.
It happened because matchctx.existing() was filtering files against the
ctx.__contains__() but deleted files are still considered part of
workingctx.
2012-08-15 21:44:00 +02:00
Patrick Mezard
95df23a5ab fileset: actually implement 'minusset'
$ hg debugfileset 'a* - a1'

was tracing back because 'minus' symbol was not supported.
2012-08-15 19:02:04 +02:00
Angel Ezquerra
5aafeb5916 fileset: add "subrepo" fileset symbol
This new fileset symbol returns a list of subrepos whose paths match a given
pattern. If the argument has no pattern type set, an exact
match is performed.

If no argument is passed, return a list of all subrepos.
2012-03-22 21:12:15 +01:00
Matt Mackall
da19c55d26 fileset: don't attempt to check data predicates against removed files 2012-01-20 22:19:40 -06:00
Idan Kamara
9401c4603c fileset: fix typo in binary() doc 2011-07-04 14:36:16 +03:00
Wagner Bruna
6e3f89657d fileset: add i18n hints for keywords 2011-06-27 13:48:25 -03:00
Mads Kiilerich
1794513e71 fileset: copied takes no arguments 2011-06-24 01:10:35 +02:00
Mads Kiilerich
7cf147b1a4 revset and fileset: fix typos in parser error messages 2011-06-22 01:55:00 +02:00
Mads Kiilerich
9f3fc0b58e fileset: use ParseError pos field correctly
The pos field is intended to describe the position of the error - it should not
be used for other potentially interesting information.
2011-06-24 00:18:41 +02:00
Mads Kiilerich
473bcd3ed1 parsers: fix localization markup of parser errors 2011-06-21 00:17:52 +02:00
Ollie Rutherfurd
593b23dd2b fileset: use correct function name for hgignore in docstring
docstring refereed to "resolved" instead of "hgignore"
2011-06-19 22:33:25 -04:00
Thomas Arendsen Hein
99f096ba63 fileset: add missing whitespace around operator 2011-06-19 11:43:40 +02:00
Matt Mackall
c4d41451a4 fileset: drop backwards SI size units
- the power of 2 ones should be kiB, MiB, etc.
- the power of 10 ones (SI standard) should be kB, MB, but we're currently
  using the industry traditional units elsewhere
2011-06-18 20:49:07 -05:00
Matt Mackall
f0947299d9 fileset: add copied predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
d2639d0874 fileset: add encoding() predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
dea358aea5 fileset: add size() predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
097fbc7efc fileset: add grep predicate 2011-06-18 16:53:49 -05:00
Matt Mackall
424cb390f7 fileset: add some function help text 2011-06-18 16:53:49 -05:00
Matt Mackall
cd8a73fe93 fileset: add hgignore 2011-06-18 16:53:49 -05:00
Matt Mackall
4ce9da8ec0 fileset: add resolved and unresolved predicates 2011-06-18 16:53:49 -05:00
Matt Mackall
5b901d4a0d fileset: prescan parse tree to optimize status usage
We only call status if needed to avoid walking the working directory
or comparing manifests.

Similarly, we scan for whether unknown or ignored files are mentioned
so we can include them.
2011-06-18 16:53:49 -05:00
Matt Mackall
5761c899b5 fileset: add support for file status predicates
This forcibly walks the tree looking for unknown and ignored files,
which is suboptimal. A better approach would scan the tree first to
find required status components and skip the status check entirely if
it's unused.
2011-06-18 16:53:49 -05:00
Matt Mackall
12efed7dfc fileset: add some basic predicates 2011-06-18 16:53:49 -05:00
Matt Mackall
3c219ce0dc fileset: drop matchfn
This is now built into contexts
2011-06-18 16:52:51 -05:00
Matt Mackall
5f2e38a0df hg: add peer method 2011-06-10 11:43:38 -05:00
Matt Mackall
5f5a2076a9 fileset: basic pattern and boolean support
debugfileset can now generate file lists for things like:

"* and not hg*"
2011-06-08 13:44:41 -05:00
Matt Mackall
6bf6135996 fileset: fix long line 2011-06-02 11:27:40 -05:00
Matt Mackall
fd0ca6b6e5 filesets: introduce basic fileset expression parser 2011-06-01 19:12:18 -05:00