Commit Graph

16253 Commits

Author SHA1 Message Date
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
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
Matteo Capobianco
8305e8d305 templates/filters: extracting the user portion of an email address
Currently, the 'user' filter is using util.shortuser(text) (which clearly
doesn't extract only the user portion of an email address, even though the
help text says it does).

The new 'emailuser' filter uses the new util.emailuser(text) function which,
instead, does exactly that.

The help text on the 'user' filter has been modified accordingly.
2012-03-28 16:06:20 +02:00
Patrick Mezard
83515678f4 patch: remove useless variable assignment 2012-04-05 19:23:04 +02:00
Thomas Arendsen Hein
dd805a8d81 merge with stable 2012-04-04 11:19:09 +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
Thomas Arendsen Hein
222d56e619 merge with stable 2012-04-03 22:02:04 +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
a076708e7b merge with stable 2012-04-03 21:02:00 +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
Matt Mackall
0dce04d2d0 config: discard UTF-8 BOM if found 2012-04-03 11:35:04 -05: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
Matt Mackall
90a622f2a7 merge with stable 2012-04-02 17:02:50 -05:00
Matt Mackall
8bb041e398 tests: shorten post-test sleeps
This helps expose races
2012-04-02 17:02:03 -05: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
c6477b03be merge with stable 2012-04-02 16:09:29 -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
441e9eee4e merge with stable 2012-04-01 15:57:04 -05:00
Matt Mackall
b9f3cf4eb3 tests: really add blacklist for vfat on Linux 2012-04-01 15:54:29 -05:00
Matt Mackall
7f19fb4f8f tests: fix one more sed -i 2012-04-01 15:35:12 -05:00
Matt Mackall
309ca70823 merge stable 2012-04-01 15:34:22 -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
Matt Mackall
4325ad525f tests: remove sed -i from test-record 2012-04-01 13:59:11 -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
Augie Fackler
dfc3978483 zsh completion: fix error in qfinish completions from 584f7a076523
The actual flag is --applied, not --all.
2012-03-31 15:39:44 -05:00
Matt Mackall
73319d495a merge with stable 2012-03-31 14:05:10 -05:00
Matt Mackall
58dccf8b84 record: fix up test issues
sed on BSD requires an arg to -i
sed failing exposed an uninitialized variable issue
2012-03-31 14:04:39 -05:00
Matt Mackall
bd79d24af7 tests: fix portability of sed expression in test-mq 2012-03-31 13:46:46 -05:00
Matt Mackall
36e8e28670 merge with stable 2012-03-31 11:19:09 -05:00
A. S. Budden
285680e0f0 record: allow splitting of hunks by manually editing patches
It is possible that unrelated changes in a file are on sequential lines.  The
current record extension does not allow these to be committed independently.

An example use case for this is in software development for deeply embedded
real-time systems.  In these environments, it is not always possible to use a
debugger (due to time-constraints) and hence inline UART-based printing is
often used.  When fixing a bug in a module, it is often convenient to add a
large number of 'printf's (linked to the UART via a custom fputc) to the module
in order to work out what is going wrong.  printf is a very slow function (and
also variadic so somewhat frowned upon by the MISRA standard) and hence it is
highly undesirable to commit these lines to the repository.  If only a partial
fix is implemented, however, it is desirable to commit the fix without deleting
all of the printf lines.  This is also simplifies removal of the printf lines
as once the final fix is committed, 'hg revert' does the rest.  It is likely
that the printf lines will be very near the actual fix, so being able to split
the hunk is very useful in this case.

There were two alternatives I considered for the user interface.  One was to
manually edit the patch, the other to allow a hunk to be split into individual
lines for consideration.  The latter option would require a significant
refactor of the record module and is less flexible.  While the former is
potentially more complicated to use, this is a feature that is likely to only
be used in certain exceptional cases (such as the use case proposed above) and
hence I felt that the complexity would not be a considerable issue.

I've also written a follow-up patch that refactors the 'prompt' code to base
everything on the choices variable.  This tidies up and clarifies the code a
bit (removes constructs like 'if ret == 7' and removes the 'e' option from the
file scope options as it's not relevant there.  It's not really a necessity, so
I've excluded it from this submission for now, but I can send it separately if
there's a desire and it's on bitbucket (see below) in the meantime.

Possible future improvements include:

* Tidying up the 'prompt' code to base everything on the choices variable.
  This would allow entries to be removed from the prompt as currently 'e' is
  offered even for entire file patches, which is currently unsupported.
* Allowing the entire file (or even multi-file) patch to be edited manually:
  this would require quite a large refactor without much benefit, so I decided
  to exclude it from the initial submission.
* Allow the option to retry if a patch fails to apply (this is what Git does).
  This would require quite a bit of refactoring given the current 'hg record'
  implementation, so it's debatable whether it's worth it.

Output is similar to existing record user interface except that an additional
option ('e') exists to allow manual editing of the patch.  This opens the
user's configured editor with the patch.  A comment is added to the bottom of
the patch explaining what to do (based on Git's one).

A large proportion of the changeset is test-case changes to update the options
reported by record (Ynesfdaq? instead of Ynsfdaq?).  Functional changes are in
record.py and there are some new test cases in test-record.t.
2012-03-30 22:08:46 +01:00
Matt Mackall
5a705b3a5d merge with stable 2012-03-30 14:35:06 -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
Patrick Mezard
c3cb584665 graphlog: handle old-style --rev values
--rev options cannot be merged into a single revset because we do not know if
they are valid revset or old-style revision specifications, like 'foo-bar'
tags. Instead, a base revision set is generated with scmutil.revrange() then
filtered with the revset built from log options. It also fixes incorrect or
hostile expressions passed in --rev.
2012-03-29 22:42:03 +02:00
Patrick Mezard
ac1ed61cb2 test-glog: pretty print revset expressions 2012-03-29 17:13:23 +02:00
Patrick Mezard
4b4652fe4f graphlog: improve --only-branch handling
The previous code was correct for command line as opts always contains the
default empty lists for --branch and --only-branch options. But calling
graphlog.revset() directly with only --only-branch set would leave it
unprocessed.
2012-03-29 16:55:08 +02: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
Takumi IINO
3b2329f4cd 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
Matt Mackall
98ed4dc5e9 perf: node lookup 2012-03-30 14:16:06 -05: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