Commit Graph

16274 Commits

Author SHA1 Message Date
Matt Mackall
cd32848f59 log: bypass file scan part of fastpath when no files
This avoids loading dirstate parents, looking up p1 rev, and loading
p1 manifest to match against an empty matcher.
2012-04-08 12:38:26 -05:00
Matt Mackall
9b81a301c9 cmdutil: use context instead of lookup 2012-04-08 12:38:24 -05:00
Matt Mackall
8dac6af07e scmutil: use context instead of lookup 2012-04-08 12:38:23 -05:00
Matt Mackall
53ccbcba3d localrepo: lookup now goes through context 2012-04-08 12:38:10 -05:00
Matt Mackall
35b009e3d3 context: use rev for changelog lookup
Faster when we're doing numeric scanning
2012-04-08 12:38:08 -05:00
Matt Mackall
3a03c51f0d context: internalize lookup logic
This allows us to avoid doing rev->node->rev lookups on silly
instances like "0", which end up caching the whole nodemap.
2012-04-08 12:38:07 -05:00
Matt Mackall
055cba03a8 revlog: allow retrieving contents by revision number 2012-04-08 12:38:02 -05:00
Matt Mackall
30645d82e7 revlog: add hasnode helper method 2012-04-07 15:43:18 -05:00
Matt Mackall
560dd93d34 merge with stable 2012-04-06 15:18:14 -05:00
Matt Mackall
c2b48cba25 merge with crew 2012-04-06 15:17:50 -05:00
Matt Mackall
567d3a0049 tags: defer tag validation until repo.tags() is called
Before, we were validating all tags for any tag operation, which meant
building a (nearly) full node->tag lookup tree for most operations.
2012-04-06 15:16:30 -05:00
Bryan O'Sullivan
774e52cd41 parsers: fix a memleak, and add a clearcaches method to the index
This change also fixes a nasty memory leak: previously, self->caches
was not being freed.

The new clearcaches method lets us benchmark with finer granularity,
as it lets us separate the cost of loading a revlog index from those
of populating and accessing the cache data structures.
2012-04-06 00:28:36 -07:00
FUJIWARA Katsunori
8ef345c7b4 mq: use list of already known target files instead of matching object for diff
'hg qnew' passes matching object to 'patch.diff()' to specify target
filenames, and it causes 'dirstate.walk()' via 'repo.status()' in
'patch.diff()'.

but target files are already known before 'patch.diff()' invocation.

to avoid useless 'dirstate.walk()' invocation, this patch uses
'changes' argument to pass already known target files to
'patch.diff()' instead of 'match' argument.

'changes' argument of 'patch.diff()' should have lists for modified,
added and removed files separately, so this patch saves status of
'.hgsubstate' before commit, and put it into appropriate list in
'changes'.
2012-04-05 23:52:55 +09:00
FUJIWARA Katsunori
7902b7f157 mq: use exact matching in the second dirstate walking for efficiency of 'qnew'
'hg qnew' with pattern/-I/-X creates matching object with them, and
uses it twice for 'dirstate.walk()': via 'repo.status()' and
'repo.commit()'.

this may cause full manifest scan in the second 'dirstate.walk()',
even though mq already knows complete target filenames at the first
'dirstate.walk()'.

this patch creates exact matching object also in this case, and use it
at 'repo.commit()' invocation to avoid full manifest scan in the
second 'dirstate.walk()'.

even though 'inclsubs' is added to 'pats' for original matching
object, it is also passed to exact matching object, because
subrepositories are deleted from result of 'dirstate.walk()' at the
end of it.
2012-04-05 23:52:06 +09:00
Bryan O'Sullivan
849e7f15fd parsers: incrementally parse the revlog index in C
We only parse entries in a revlog index file when they are actually
needed, and cache them when first requested.

This makes a huge difference to performance on large revlogs when
accessing the tip revision or performing a handful of numeric lookups
(very common cases).  For instance, "hg --time tip --template {node}"
on a tree with 300,000 revs takes 0.15 before, 0.02 after.

Even for revlog-intensive operations (e.g. running "hg log" to
completion), the lazy approach is about 1% faster than the eager
parse_index2.
2012-04-05 13:00:35 -07:00
Patrick Mezard
20f55f2de4 hghave: remove symlink test made useless by f9442b2a2789 2012-04-04 15:59:56 +02:00
Julien Cristau
a473958b12 tests: disable progress estimate in test-debugbuilddag.t
If the command takes long enough, including 'estimate' in the format
will add some more data to the progress bar output, and make the test
fail.  See e.g.
https://buildd.debian.org/status/fetch.php?pkg=mercurial&arch=kfreebsd-amd64&ver=2.1.2-2&stamp=1333493711
2012-04-04 13:55:11 +02:00
Kevin Bullock
cb270596b4 ui: swallow EBADF on stderr
ui.write_err already swallows EPIPE and EIO if a write to stderr fails.
On Mac OS X at least, a write to a closed file descriptor results in
EBADF. Before this patch, hg would exit with status 1 if a write to
stderr failed during startup (e.g. while trying to print a warning about
not finding an extension):

  $ ./hg --config extensions.foo= version 2>&-; echo $?
  1

With this patch, it correctly swallows stderr and continues to run the
command:

  $ ./hg --config extensions.foo= version 2>&-
  Mercurial Distributed SCM (version 2.1)
  ...
2012-04-04 12:46:54 -05:00
Jim Hague
77587a4c7a tests: avoid test-hup hanging on AIX
test-hup hangs on AIX. Under ksh89 on AIX (the default shell),

echo Hello; while [ ! -s not-there ]; do true; done

produces no output while the loop executes. Replacing 'true' with 'sleep 0'
fixes, as does using a less broken shell. ksh93 is fine.

Update check-code.py to look for this, and make same change in test-serve.t.
In fact test-serve works fine, probably because of additional commands between
echo and the loop, but that's a subtlety not easy to test for.
2012-04-05 12:31:21 +01:00
Patrick Mezard
1e2e55778b mdiff: fix diff header generation for files with spaces (issue3357)
diff ---/+++ should end filenames with a TAB when they contain spaces. Current
code failed to do so when only the +++ file had spaces. This only happened with
git renames from a name without space to one with space.
2012-04-05 15:39:07 +02:00
Patrick Mezard
f535cae825 context: make changectx.mutable() benefit from .phase() logic
This fixes "hg qimport -r null". Previous versions used to:
- Traceback because null revision mutability was not defined
- Add an empty -1.diff patch to the series

The error message:

  abort: revision -1 is not mutable

is symptomatic of a deeper problem in phase command revision handling. It could
be fixed easily in the command itself but I feel a better fix must be done in
phase API which raises the issue of phase updates atomicity: aborting in
phases.advanceboundary/retractboundary requires a better rollback behaviour to
avoid partial changes.
2012-04-05 19:15:23 +02:00
Thomas Arendsen Hein
7c3a892f08 export: catch exporting empty revsets (issue3353)
Additionally add tests for empty revsets and unknown revisions.
2012-04-04 12:31:31 +02:00
Thomas Arendsen Hein
a93a526aeb test-merge-types: allow different output with existing hgmerge (issue3346)
Because hgmerge was meant to be adjusted to personal needs, there may be
many remaining copies in people's $PATH.
2012-04-04 11:18:42 +02:00
Thomas Arendsen Hein
567734318a inotify: catch SignalInterrupt during shutdown (issue3351)
When inotify.repowatcher.shutdown() is called, mercurial.error.SignalInterrupt
exception is thrown by mercurial.dispatch._runcatch.catchterm(), therefore
socketlistener.shutdown() is not called.

Catching this allows cleanup action (removing the socket file) to proceed.
2012-04-04 10:57:48 +02:00
Benoit Allard
ed90b14694 protocol: Add the stream-preferred capability
This makes the client use the uncompressed protocol.
2012-04-04 00:00:47 +02:00
Thomas Arendsen Hein
5e3d9e57d7 clone: always close source repository (issue2491)
This is especially needed for cloning from bundles as a temporary
bundlerepository is created which needs to be deleted after clone has
finished.
2012-04-03 22:01:28 +02:00
Thomas Arendsen Hein
21bb7c4cdc tests: make tests work if directory contains special characters
With this quoting tests will work e.g. in "/tmp/foo bar/mercurial/".
2012-04-03 19:06:35 +02:00
Thomas Arendsen Hein
10f14ea780 test-gpg: replace 83b32bd12586 by md5sum check
The call to 'hg identify' would have needed '--cwd "$TESTDIR' to make it work
anyway, but by using a checksum this test can work outside a repository.
2012-04-03 16:36:25 +02:00
Javi Merino
c4e6d14c1e tests: don't run test-gpg if not in a working directory
test-gpg has to be run in a mercurial working directory as it uses
that to verify that it hasn't modified the trustdb.gpg file.  Skip the
test if it is running in an exploded tarball.
2012-04-02 22:25:55 +01:00
Matt Mackall
2be8f7711a tests: avoid zombie lockup with test-hup
The 'while kill -0' recipe can cause a livelock if the process we're waiting
to die is a normal child process. If it becomes a zombie that the shell
doesn't reap (shell bug?), it will continue to be able to accept
signals. So instead, we just wait(1).
2012-04-02 16:46:58 -05:00
Matt Mackall
668dad5779 tests: make test-hup more race-proof
We need to wait until a journal exists AND is non-empty before
aborting a transaction to get stable output. We move the kill wait
outside the fifo block to avoid potential deadlock.
2012-04-02 16:04:07 -05:00
Matt Mackall
462be3c589 tests: re-silence test-bad-pull log messages 2012-04-02 15:06:36 -05:00
Matt Mackall
b9f3cf4eb3 tests: really add blacklist for vfat on Linux 2012-04-01 15:54:29 -05:00
Matt Mackall
b7cc3aeb0b Added signature for changeset bf3e6b163ba4 2012-04-01 15:31:07 -05:00
Matt Mackall
1c2151ba6e tests: fix shutdown race in test-bad-pull 2012-04-01 14:23:55 -05:00
FUJIWARA Katsunori
18786dc9ad tests: fix portability of sed usage in test-mq
on some platform (Mac OS X and Solaris, at least), to insert new text
line, sed function 'i' should be followed by:

  - backslash('\'),
  - new-line,
  - text to be inserted and
  - new-line

GNU sed on Linux can recognize both previous and new ones as same
modification request.

in addition to it, this patch avoids to use '-i' option for sed,
because it is not so portable, as noted in WritingTests wiki page.
2012-04-01 18:18:48 +09:00
Matt Mackall
bd79d24af7 tests: fix portability of sed expression in test-mq 2012-03-31 13:46:46 -05:00
Takumi IINO
5391bc80ef tests: skip test-lfconvert.t if not support symblic link
Windows not support symbolic link. but test-lfconvert.t
execute 'ln -s' command.

@@ -51,8 +51,6 @@
   skipping incorrectly formatted tag IncorrectlyFormattedTag!
   skipping incorrectly formatted id invalidhash
   no mapping for id 0123456789abcdef
-  abort: renamed/copied largefile large3 becomes symlink
-  [255]
   $ cd bigfile-repo
   $ hg strip --no-backup 2
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved

ERROR: test-lfconvert.t output changed
2012-03-29 22:16:56 +09:00
FUJIWARA Katsunori
36e9e8107c dirstate: fix some problems for recursive case normalization (issue3342)
file in nested directory causes unexpected abort.

problems below should be fixed for recursive normalization route in
dirstate._normalize():

    1. rsplit() may cause unpacking into more than 2 elements.
       it should be called with 'maxsplit' argument to unpack
       into 'd, f'

    2. 'd' is replaced by normalized value prefixed with
       'self._root', but this makes 'folded' as absolute path,
       and it is unexpected one for caller of recursive
       normalization
2012-03-31 15:55:03 +09:00
Matt Mackall
9aa1e49c7c tests: make test-walkrepo use hg's symlink test 2012-03-31 10:44:31 -05:00
Matt Mackall
199e84020f tests: make hghave handle exec bit on Linux with vfat 2012-03-31 10:44:31 -05:00
Matt Mackall
0d1f9340f4 tests: teach hghave to actually test for symlink support 2012-03-31 10:44:31 -05:00
Matt Mackall
c9532589d2 merge with i18n 2012-03-30 14:29:50 -05:00
FUJIWARA Katsunori
dba1f40821 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
on icasefs, "hg qnew" fails to import changing letter case of filename
already occurred in working directory, for example:

    $ hg rename a tmp
    $ hg rename tmp A
    $ hg qnew casechange
    $ hg status
    R a
    $

"hg qnew" invokes 'dirstate.walk()' via 'localrepository.commit()'
with 'exact match' matching object having exact filenames of targets
in ones 'files()'.

current implementation of 'dirstate.walk()' always normalizes letter
case of filenames from 'match.files()' on icasefs, even though exact
matching is required.

then, files only different in letter case are treated as one file.

this patch prevents 'dirstate.walk()' from normalizing, if exact
matching is required, even on icasefs.

filenames for 'exact matching' are given not from user command line,
but from dirstate walk result, manifest of changecontext, patch files
or fixed list for specific system files (e.g.: '.hgtags').

in such case, case normalization should not be done, so this patch
works well.
2012-03-31 00:04:08 +09:00
FUJIWARA Katsunori
26cf91b0ae i18n-ja: synchronized with 0a0f0575159c 2012-03-30 21:18:37 +09:00
Wagner Bruna
e64a0c6479 i18n-pt_BR: synchronized with 1b98103e9cde 2012-03-29 18:14:20 -03:00
Mads Kiilerich
08bbe3eb2b mq: fix qpush --move with comments in series file between applied patches
The 'start' variable pointed to qtip in self.series, but it was used for
indexing self.fullseries.

When fullseries had holes and the patch was moved to self.fullseries[start]
it would end up too early in self.series and it could thus not be
found in self.series[start:] and it would crash.

Now the 'fullstart' index in fullseries is found used instead.
2012-03-29 00:35:00 +02:00
Matt Mackall
b7a9e07a8c dirstate: normalize case of directory components
If we have an existing f/a, and rename f to F, adding F/b should be
normalized to f/b.
2012-03-28 19:24:13 -05:00
Matt Mackall
76e8b41818 tests: fix startup race in test-http-proxy 2012-03-28 19:24:11 -05:00
Matt Mackall
18bf05f2aa tests: fix startup/shutdown races in test-https
tinyproxy now writes its own pid when it's ready to accept connections
2012-03-28 19:23:25 -05:00