Commit Graph

8538 Commits

Author SHA1 Message Date
Matt Mackall
fd4256c9b1 util.h: unify some common platform tweaks 2012-04-10 12:07:14 -05:00
Matt Mackall
935d420846 util.h: move Py_ssize_t bits from mpatch.c 2012-04-10 12:07:09 -05:00
Steven Stallion
d79ff306e5 plan9: initial support for plan 9 from bell labs
This patch contains support for Plan 9 from Bell Labs. A README is
provided in contrib/plan9 which describes the port in greater detail.
A new extension is also provided named factotum which permits the
factotum(4) authentication agent to provide credentials for HTTP
repositories. This extension is also applicable to other POSIX
platforms which make use of Plan 9 from User Space (aka plan9ports).
2012-04-08 12:43:41 -07:00
Matt Mackall
afeb0ce18a util.h: add a typedef for Py_ssize_t with Python 2.4 2012-04-08 22:17:51 -05:00
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
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
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
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
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
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
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
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
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
222d56e619 merge with stable 2012-04-03 22:02:04 +02:00
Matt Mackall
0dce04d2d0 config: discard UTF-8 BOM if found 2012-04-03 11:35:04 -05:00
Matt Mackall
36e8e28670 merge with stable 2012-03-31 11:19:09 -05:00
Matt Mackall
5a705b3a5d merge with stable 2012-03-30 14:35:06 -05:00
Matt Mackall
3eb6e77c5e alias: abort on missing positional args (issue3331) 2012-03-27 16:13:59 -05:00
Paul Boddie
0e0c036052 hgweb: add block numbers to diff regions and related links
The changeset view may show several diff regions, one per file, and this patch
numbers each of them so that links produced by the filenodelink fragment can
reference each diff region produced by the diffblock fragment through the use
of the blockno variable made available to both of them. This permits
navigation to diff regions on the changeset page from the file list, and
where the :target pseudo-class is supported in browsers, permits selective
presentation of diffs, showing one at a time instead of potentially many in
what would otherwise be a very long page that is difficult to navigate.
2012-03-23 01:31:31 +01:00
Angel Ezquerra
a67f0ff376 revert: move bulk of revert command from commands to cmdutil
This revision has no functionality change. The code on the original
commands.revert() function has been split. The first part of the
original code, which checks that the command inputs are correct
remains in commands.revert(). The rest of the function, which performs
the actual revert operation has been moved into cmdutil.revert().

The purpose of this change is to make it easier to perform a revert
operation, from other parts of the code. This may be used to implement
reverting of subrepos.
2012-03-28 11:42:17 +02:00
Matt Mackall
2cf26ea8f0 merge with stable 2012-03-27 16:17:46 -05:00
Matt Mackall
9b533bc599 merge with stable 2012-03-26 16:42:53 -05:00
Matt Mackall
6d3a783a57 merge: fix unknown file merge detection for case-folding systems
This was triggering some test failures on Mac.
2012-03-26 16:41:54 -05:00
Matt Mackall
6c58e9cb98 rename: handle case-changing (issue1717) 2012-03-23 11:47:27 -05:00
Matt Mackall
39c1d7334a merge with stable 2012-03-22 17:08:05 -05:00
Matt Mackall
8fac36f6df aliases: use empty string for missing position parameters (issue3331) 2012-03-22 17:07:39 -05:00
Matt Mackall
369755dc10 encoding: tune fast-path of tolocal a bit 2012-03-22 16:54:46 -05:00
Kevin Bullock
2e6b4bf150 bookmarks: clone non-divergent bookmarks with @ in them 2012-03-21 16:39:38 -05:00
Matt Mackall
59bf512648 changelog: micro-optimizations to changelog.read() 2012-03-18 18:19:16 -05:00
Matt Mackall
000c79b7ce profile: add undocumented config options for profiler output 2012-03-15 15:59:26 -05:00
Matt Mackall
61779234ab merge with stable 2012-03-15 13:11:42 -05:00
FUJIWARA Katsunori
71230ee2e8 icasefs: use case preserved root for 'util.fspath()' invocation (issue3302)
path to repo root may contains case sensitive part, even though repo
is located in case insensitive filesystem: e.g. repo in FAT32 device
mounted on Unix.

so, case normalized root causes failure of stat(2).

this patch uses case preserved root for 'util.fspath()' invocation to
avoid this problem.

case preserved root for 'util.fspath()' may decrease efficiency of
fspath cache, but 'util.fspath()' is currently called only from
dirstate, so this fix has less impact.
2012-03-15 00:46:37 +09:00
Matt Mackall
89d8d8b996 merge: accept missing revisions in symlink flag merge (issue3316) 2012-03-14 14:45:41 -05:00
Matt Mackall
2a84e7e364 merge with stable 2012-03-13 16:29:13 -05:00
Matt Mackall
5eda7202ad merge: handle linear update to symlink correctly (issue3316)
This fixes a regression introduced by df049e784ab6. If no file-level
merge is needed, we can update flags directly, otherwise we have a
conflict to resolve in filemerge.
2012-03-13 16:28:08 -05:00