Commit Graph

19596 Commits

Author SHA1 Message Date
Matt Mackall
c1fcd00695 check-code: add bracket style check 2013-09-18 14:36:19 -05:00
Wei, Elson
f78ba81b28 util.h: getbe32() and putbe32() use intrinsic function to improve performance
Refer to https://bugzilla.mozilla.org/show_bug.cgi?id=351557. It can improve
byte-swapping performance by intrinsic function.
2013-09-14 11:22:34 +08:00
Alexander Plavin
e340f5be55 hgweb: add appendFormatHTML javascript function
This is a convenient helper function to append some formatted HTML markup to a
DOM element.
2013-09-06 13:30:58 +04:00
Alexander Plavin
3b1957de7e hgweb: add removeByClassName javascript function
It removes all elements with specified class name from the document.
2013-09-06 13:30:58 +04:00
Alexander Plavin
48ee1c4c4f hgweb: add docFromHTML javascript function
It takes a string with HTML markup and creates DOM document from it.
The implementation is a part of code from
https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#DOMParser_HTML_extension_for_other_browsers
2013-09-06 13:30:57 +04:00
Alexander Plavin
6bdbb6b69d hgweb: add makeRequest javascript function
This function performs an asynchronous HTTP request and calls provided
callbacks:
- onstart: request is sent
- onsuccess: response is received
- onerror: some error occured
- oncomplete: response is fully processed and all other callbacks finished
2013-09-06 13:30:57 +04:00
Alexander Plavin
1dc1ac5d6a hgweb: add format javascript function
It replaces placeholders like '%key%' with replacement values given.
2013-09-06 13:30:57 +04:00
Alexander Plavin
eee67f7bda hgweb: add nextentry variable for easy pagination in changelog
nextentry always contains the first entry not shown on current page (if there is
such entry)
2013-09-06 13:30:57 +04:00
Alexander Plavin
be32ad07fd hgweb: always compute all entries and latestentry in changelog
Get the whole list of entries before rendering instead of using lazy evaluation.
This doesn't affect the performance for usual case when the entries are shown
anyway. When both entries and latestentry are used, this performs unnoticeably
faster, and for pages which use only latestentry (quite uncommon case) it
would be a bit slower.
This change will make it possible to get the first entry of the next page easily
without computing the list twice.
2013-09-06 13:30:57 +04:00
David Soria Parra
bd9e14bcec templatefilters: add short format for age formatting
Implements a short output format for ages e.g. "1 second ago" is
abbrevated as "1s ago".
2013-09-17 17:42:13 +02:00
Alexander Plavin
3f021369d6 hgweb: remove unused argument of changelist function in changelog
This doesn't change the behavior as the argument isn't used anyway, and
it's a preparation to the next patches,
2013-09-06 13:30:57 +04:00
Sean Farley
89ec93306f context: move evolution functions from changectx to basectx
This is just a code move and corrects an overlook from my previous patch series
that assumed only a changectx would want this functionality.
2013-09-17 23:34:57 -05:00
Sean Farley
58d5c3fd06 context: use correct spelling of committable 2013-09-17 18:34:45 -05:00
Matt Mackall
b8ff933b09 check-code: check C patterns against .h files 2013-09-17 18:19:04 -05:00
Matt Mackall
5f16d1c838 check-code: make casting style check more precise 2013-09-17 18:13:54 -05:00
Durham Goode
87385443b0 log: make file log slow path usable on large repos
Running "hg log <pattern or directory>" on large repos took a very, very long
time because it first read ctx.files() for every commit before even starting to
process the results.

This change makes the ctx.files() check lazy, which makes the command start
producing results immediately.
2013-09-10 19:49:34 -07:00
Jeff Sickel
c1824b83d9 plan9: update util.py for cpython 2.7 build 2013-09-13 15:40:04 -05:00
Siddharth Agarwal
f64894b936 parse_manifest: rewrite to use memchr
memchr is usually smarter than a simple for loop. With gcc 4.4.6 and glibc 2.12
on x86-64, for a 20 MB, 200,000 file manifest, parse_manifest goes from 0.116
seconds to 0.095 seconds.
2013-09-06 23:47:59 -07:00
Bryan O'Sullivan
87700a719c parsers: correctly handle a failed allocation 2013-09-16 12:17:55 -07:00
Bryan O'Sullivan
fb0fb16051 parsers: use Py_INCREF safely 2013-09-16 12:12:37 -07:00
Bryan O'Sullivan
3cfc802f1f parsers: state is a char, not an int 2013-09-16 12:10:28 -07:00
Wei, Elson
2a24db69d7 setup: check if mercurial/util.h has been modified
Before, if mercurial/util.h was modified but *.c wasn't, no extension
was rebuilt.
2013-09-13 10:00:57 +08:00
Wei, Elson
2400e9cc93 util.h: add stdint basic type definitions
MS C compiler v15 doesn't have stdint.h. Add basic int types those are defined
in stdint.h.
2013-09-13 09:54:43 +08:00
Alexander Plavin
e1392e4ce2 hgweb: add revset syntax support to search
This mode is used when all the conditions are met:
- 'reverse(%s)' % query string can be parsed to a revset tree
- this tree has depth more than two, i.e. the query has some part of
revset syntax used
- the repo can be actually matched against this tree, i.e. it has only existent
function/operators and revisions/tags/bookmarks specified are correct
- no revset regexes are used in the query (strings which start with 're:')
- only functions explicitly marked as safe in revset.py are used in the query

Add several new tests for different parsing conditions and exception handling.
2013-09-06 13:30:56 +04:00
Alexander Plavin
d519eef8ec revset: add a whitelist of DoS-safe symbols
'Safe' here means that they can't be used for a DoS attack for any given input.
2013-09-06 13:30:56 +04:00
Alexander Plavin
75dc3d55d6 revset: add helper function to get functions used in a revset parse tree
Will be used to determine whether all functions used in a hgweb search query
are allowed there.
2013-08-07 01:21:31 +04:00
Alexander Plavin
573b3e69b6 revset: add helper function to get revset parse tree depth
Will be used to determine if a hgweb search query actually uses
any revset syntax.
2013-08-09 22:52:58 +04:00
Siddharth Agarwal
b2531e9232 parsers: use a lookup table to convert hex to binary
This is a hotspot for parse_manifest. With this patch, for a 20 MB, 200,000
file manifest, parse_manifest goes down from 0.153 seconds to 0.116.
2013-09-07 00:59:24 -07:00
Siddharth Agarwal
64c41699fa revlog: remove _chunkbase since it is no longer used
This was introduced in 2011 for the lwcopy feature but never actually got used.
A similar hook can easily be reintroduced if needed in the future.
2013-09-06 23:05:33 -07:00
Siddharth Agarwal
bcd16c3892 revlog: move chunk cache preload from revision to _chunks
In case we don't have a cached text already, add the base rev to the list
passed to _chunks. In the cached case this also avoids unnecessarily preloading
the chunk for the cached rev.
2013-09-06 23:05:11 -07:00
Siddharth Agarwal
61f0e46895 revlog._chunks: inline getchunk
We do this in a somewhat hacky way, relying on the fact that our sole caller
preloads the cache right before calling us. An upcoming patch will make this
more sensible.

For a 20 MB manifest with a delta chain of > 40k, perfmanifest goes from 0.49
seconds to 0.46.
2013-09-06 22:57:51 -07:00
Siddharth Agarwal
b7abdca3c1 revlog.revision: fix cache preload for inline revlogs
Previously the length of data preloaded did not account for the interleaved io
contents. This meant that we'd sometimes have cache misses in _chunks despite
the preloading.

Having a correctly filled out cache will become essential in an upcoming patch.
2013-09-07 12:42:46 -07:00
Siddharth Agarwal
d24e970042 revlog: add a fast method for getting a list of chunks
This moves _chunkraw into the loop. Doing that improves revlog decompression --
in particular, manifest decompression -- significantly. For a 20 MB manifest
which is the result of a > 40k delta chain, hg perfmanifest improves from 0.55
seconds to 0.49 seconds.
2013-09-06 16:31:35 -07:00
Siddharth Agarwal
10bb361ad4 perfmanifest: allow and require passing in a rev
Previously perfmanifest would only test tip.
2013-09-06 13:35:29 -07:00
Siddharth Agarwal
79b9a1c4e5 perfmanifest: fix cache invalidation
The manifest cache is now stored in _mancache. The revlog cache is still stored
in _cache.
2013-09-06 13:20:07 -07:00
Siddharth Agarwal
26051a2eee lrucachedict: implement clear() 2013-09-06 13:16:21 -07:00
Kevin Bullock
6e9f30dc4d merge with stable 2013-09-07 16:08:11 -05:00
Antoine Pitrou
ecc34bd7c0 bundle: fix performance regression when bundling file changes (issue4031)
Somewhere before 2.7, a change [82beb9b16505] was committed that
entailed a large performance regression when bundling (and therefore
remote cloning) repositories. For each file in the repository, it would
recompute the set of needed changesets even though it is the same for
all files. This computation would dominate bundle runtimes according to
profiler output (by 10x or more).
2013-09-07 21:20:00 +02:00
Kevin Bullock
0903f71c12 merge with stable 2013-09-07 00:08:36 -05:00
Sean Farley
f65ef721e4 commitablefilectx: move children from workingfilectx 2013-08-15 13:42:56 -05:00
Sean Farley
f415142833 commitablefilectx: move parents from workingfilectx 2013-08-15 13:42:33 -05:00
Sean Farley
f31ebd758d commitablefilectx: move __nonzero__ from workingfilectx 2013-08-15 13:23:06 -05:00
Sean Farley
f38f187cbc commitablefilectx: move __init__ from workingfilectx 2013-08-15 13:12:50 -05:00
Sean Farley
608e9a1f09 commitablefilectx: add a class that will be used for mutable file contexts
Just like commitablectx, this will serve as a common place for code that will
be shared between workingfilectx and memfilectx.
2013-08-15 13:11:51 -05:00
Sean Farley
be4c3801e7 commitablectx: move dirs from workingctx 2013-08-14 16:40:34 -05:00
Sean Farley
e88dd1aaed commitablectx: move markcommitted from workingctx 2013-08-14 16:40:27 -05:00
Sean Farley
63bb66d577 commitablectx: move ancestors from workingctx 2013-08-14 16:37:59 -05:00
Sean Farley
402e7ea991 commitablectx: move walk from workingctx 2013-08-14 16:37:11 -05:00
Sean Farley
a895d35a4d commitablectx: move ancestor from workingctx 2013-08-14 16:37:01 -05:00
Sean Farley
72513aefb7 commitablectx: move flags from workingctx 2013-08-14 16:25:43 -05:00