Commit Graph

16475 Commits

Author SHA1 Message Date
Matt Mackall
e80599976d changegroupsubset: optimize function lookup in prune 2012-04-13 22:55:46 -05:00
Matt Mackall
736fde9c03 changegroup: optimize gennodelist 2012-04-13 22:55:46 -05:00
Matt Mackall
a6546db90e revlog: drop some unneeded rev.node calls in revdiff 2012-04-13 22:55:46 -05:00
Bryan O'Sullivan
62554752c6 revlog: avoid an expensive string copy
This showed up in a statprof profile of "hg svn rebuildmeta", which
is read-intensive on the changelog.  This two-line patch improved
the performance of that command by 10%.
2012-04-12 20:26:33 -07:00
Matt Mackall
2bbef572af changegroupsubset: avoid setdefault in inner loop 2012-04-13 22:55:46 -05:00
Matt Mackall
03f2c727d0 changegroupsubset: drop repeated len() calls 2012-04-13 22:55:40 -05:00
Matt Mackall
5f0c1a6b8d changegroup: reduce progress overhead 2012-04-13 22:27:29 -05:00
Matt Mackall
4a60e2504d changegroupsubset: renest inner loop
The mdata list should generally be shorter than changedfiles
2012-04-13 22:23:45 -05:00
Matt Mackall
4e0b41f193 revlog: increase readahead size 2012-04-13 21:35:48 -05:00
Matt Mackall
265f182101 revset: avoid demandimport bug
Apparently the "import x as xy" doesn't manage to update xy in the
current scope's dictionary after load, which causes nodemod.nullrev to do a huge amount of demandload magic in the inner loop.
2012-04-13 15:32:49 -05:00
Matt Mackall
af300e88ec merge with stable 2012-04-12 20:52:39 -05:00
Bryan O'Sullivan
dc46676e81 parsers: use base-16 trie for faster node->rev mapping
This greatly speeds up node->rev lookups, with results that are
often user-perceptible: for instance, "hg --time log" of the node
associated with rev 1000 on a linux-2.6 repo improves from 0.3
seconds to 0.03.  I have not found any instances of slowdowns.

The new perfnodelookup command in contrib/perf.py demonstrates the
speedup more dramatically, since it performs no I/O.  For a single
lookup, the new code is about 40x faster.

These changes also prepare the ground for the possibility of further
improving the performance of prefix-based node lookups.
2012-04-12 14:05:59 -07:00
Matt Mackall
05bbeed32b check-code: avoid false-positive on ++ 2012-04-12 20:22:18 -05:00
Patrick Mezard
38b5c1448f graphlog: cleanup before code move
- Avoid revset module aliasing
- Mark makefilematcher() private
2012-04-11 11:37:13 +02:00
Patrick Mezard
00224d1ac6 graphlog: correctly handle calls in subdirectories 2012-04-11 11:32:00 +02:00
Patrick Mezard
82044cab98 context: revert workingctx.ancestors() followfirst option
It was introduced by mistake in df40a7c0d6aa.
2012-04-11 11:29:12 +02:00
Patrick Mezard
a07861a2e3 graphlog: fix --follow-first --rev combinations
This solves a similar problem than the previous --follow/--rev patch. This time
we need changelog.ancestors()/descendants() filtering on first parent.
Duplicating the code looked better than introducing keyword arguments. Besides,
the ancestors() version was already implemented in follow() revset.
2012-04-11 11:25:34 +02:00
Patrick Mezard
50ca715022 graphlog: fix --follow --rev combinations
The previous behaviour of --follow was really a subset of what is really
happening in log command:
- If --rev is not passed, default to '.:0'
- Resolve --rev into a revision list "revs"
- Set the starting revision to revs[0]
- If revs[1] > revs[0] keep descendants(revs[0]) in revs, otherwise keep
  ancestors.
2012-04-11 11:22:40 +02:00
Patrick Mezard
d269778e3e graphlog: support changeset identifiers in --branch 2012-04-11 11:17:26 +02:00
Patrick Mezard
a87c281f59 graphlog: pass changesets to revset.match() in changelog order
Running:

  $ time hg debugrevspec 'user(mpm)' | wc

on Mercurial repository takes 1.0s with a regular version and 1.8s if
commands.debugrevspec() is patched to pass revisions to revset.match() from tip
to 0.

Depending on what we expect from the revset API and caller wisdom, we might
want to push this change in revset.match() later.
2012-04-11 11:14:07 +02:00
Patrick Mezard
d282c91c89 graphlog: refactor revset() to return revisions
When --follow and --rev are passed, --follow actual behaviour depends on the
input revision sequence defined by --rev. If --rev is not passed, the default
revision sequence depends on the presence of --follow. It means the revision
sequence generation is part of log logic and must be wrapped. The issue
described above is fixed in following patches.
2012-04-11 11:07:30 +02:00
Bryan O'Sullivan
1672ae6377 store: speed up read and write of large fncache files
In my tests of an fncache containing 300,000 entries, this improves
read time from 567ms to 307, and write time from 1328ms to 533.

These numbers aren't so great, since the fncache file is only 17MB
in size, but they're an improvement.
2012-04-12 15:21:54 -07:00
Bryan O'Sullivan
22e70490ba perf: time fncache read and write performance 2012-04-12 15:21:52 -07:00
Angel Ezquerra
bfc07420f3 revset: add "matching" keyword
This keyword can be used to find revisions that "match" one or more fields of a
given set of revisions.

A revision matches another if all the selected fields (description, author,
branch, date, files, phase, parents, substate, user, summary and/or metadata)
match the corresponding values of those fields on the source revision.

By default this keyword looks for revisions that whose metadata match
(description, author and date) making it ideal to look for duplicate revisions.

matching takes 2 arguments (the second being optional):

1.- rev: a revset represeting a _single_ revision (e.g. tip, ., p1(.), etc)
2.- [field(s) to match]: an optional string containing the field or fields
(separated by spaces) to match.
    Valid fields are most regular context fields and some special fields:
    * regular fields:
      - description, author, branch, date, files, phase, parents,
      substate, user.
      Note that author and user are synonyms.
    * special fields: summary, metadata.
      - summary: matches the first line of the description.
      - metatadata: It is equivalent to matching 'description user date'
        (i.e. it matches the main metadata fields).

Examples:

1.- Look for revisions with the same metadata (author, description and date)
as the 11th revision:

hg log -r "matching(11)"

2.- Look for revisions with the same description as the 11th revision:

hg log -r "matching(11, description)"

3.- Look for revisions with the same 'summary' (i.e. same first line on their
description) as the 11th revision:

hg log -r "matching(11, summary)"

4.- Look for revisions with the same author as the current revision:

hg log -r "matching(., author)"

You could use 'user' rather than 'author' to get the same result.

5.- Look for revisions with the same description _AND_ author as the tip of the
repository:

hg log -r "matching(tip, 'author description')"

6.- Look for revisions touching the same files as the parent of the tip of the
repository

hg log -r "matching(p1(tip), files)"

7.- Look for revisions whose subrepos are on the same state as the tip of the
repository or its parent

hg log -r "matching(p1(tip):tip, substate)"

8.- Look for revisions whose author and subrepo states both match those of any
of the revisions on the stable branch:

hg log -r "matching(branch(stable), 'author substate')"
2012-04-01 14:12:14 +02:00
Steven Stallion
8076654c92 plan9: add execute permissions to 9diff 2012-04-10 23:40:20 -07:00
Steven Stallion
4915686ba1 transplant: permit merge changesets via --parent
This change permits the transplant extension to operate on merge
changesets by way of --parent.  This is particularly useful for
workflows which cherrypick branch merges rather than each commit
within a branch.
2012-04-10 23:24:12 -07:00
Matt Mackall
6b8dd49a2a help: fix indentation on cacert (issue3350)
The parser doesn't really handle nesting, so reorder so the nested bit
is last.
2012-04-12 20:22:18 -05:00
Matt Mackall
dec2ae41f4 stream_in: avoid debug calls when debug is disabled 2012-04-12 20:22:18 -05:00
Matt Mackall
d38924097e util: create bytecount array just once
This avoids tons of gettext calls on workloads that call bytecount a lot.
2012-04-12 20:22:18 -05:00
Matt Mackall
0ba5fb4cce util.h: more Python 2.4 fixes 2012-04-10 16:53:29 -05:00
Bryan O'Sullivan
af2413c514 dispatch: add support for statprof as a profiler
This can be selected using the config variable profiling.type or
the environment variable HGPROF ("ls" for the default, "stat" for
statprof).  The only tuneable is the frequency, profiling.freq,
which defaults to 1000 Hz.

If statprof is not available, a warning is printed.
2012-04-09 13:48:45 -07:00
Steven Stallion
af163e9811 ui: optionally quiesce ssl verification warnings on python 2.5
Some platforms, notably Plan 9 from Bell Labs are stuck on older
releases of Python. Due to restrictions in the platform, it is not
possible to backport the SSL library to the existing Python port.
This patch permits the UI to quiesce SSL verification warnings by
adding a configuration entry named reportoldssl to ui.
2012-04-09 14:36:16 -07:00
Bryan O'Sullivan
ba47c1b0e5 scmutil: speed up revrange
This improves the performance of "hg log -l1" from 0.21 seconds to
0.07 on a Linux kernel tree.

Ideally we could use xrange instead of range on the most common
path, and thus avoid a ton of allocation, but xrange doesn't support
slice-based indexing.
2012-04-09 22:16:26 -07:00
Matt Mackall
424daf7479 graft: add --dry-run support (issue3362) 2012-04-10 12:49:12 -05:00
Idan Kamara
6a237ec01a repair: allow giving strip backup a different name
So the user can differentiate amend backups from the rest.
2012-04-06 16:18:33 +03:00
Matt Mackall
b7245bb05e encoding: add fast-path for ASCII lowercase 2012-04-10 12:07:18 -05:00
Matt Mackall
ebe322955c perf: add case collision auditor perf 2012-04-10 12:07:16 -05:00
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