Commit Graph

64 Commits

Author SHA1 Message Date
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
Durham Goode
038a9f064c bundle: move file chunk generation to it's own function
Moves the file chunk generation part of bundle creation to it's own function.
This allows extensions to customize the filelog part of bundle generation.
2013-06-25 13:23:12 -07:00
Matt Mackall
ddb6d6bea9 changegroup: fix fastpath during commit
Change 1f567a607f1f dropped the 'revset' variable which kept track of
which changesets were being bundled. Instead, it used "not in
commonset" to decide which changesets were outgoing.. which ran into
trouble when a commit was in progress.
2013-06-19 14:17:03 -05:00
Durham Goode
1142072e5b filelog: switch 'not len(filerevlog)' to 'not filerevlog'
A few places in the code use 'if not len(revlog)' to check if the revlog
exists. Replacing this with 'not filerevlog' allows alternative revlog
implementations to override __nonzero__ to handle this case without
implementing __len__.
2013-05-30 18:47:16 -07:00
Durham Goode
045d614415 bundle: refactor changegroup prune to be its own function
Moving the prune function to be a non-nested function allows extensions to
control which revisions are allowed in the changegroup. For example, in my
shallow repo extension I want to prevent filelogs from being added to the
bundle.

This also allows an extension to use a filelog implementation that doesn't
have revlog.linkrev implemented.
2013-05-30 17:51:13 -07:00
Benoit Boissinot
af4c732d36 bundle-ng: move progress handling out of the linkrev callback 2013-05-10 23:48:03 +02:00
Benoit Boissinot
cbb658ed5c bundle-ng: simplify lookup and state handling
Use simpler callbacks to collect linkrev nodes.
2013-05-10 23:14:54 +02:00
Sune Foldager
6475a6763a bundle-ng: simplify bundle10.generate
Remove complex local sub-functions mutating function-global variables. Simplify
counting used for progress output.
2013-05-10 22:57:54 +02:00
Benoit Boissinot
035e39f987 bundle-ng: move bundle generation to changegroup.py 2013-02-10 16:03:20 +01:00
Sune Foldager
e548f184d2 bundle-ng: move gengroup into bundler, pass repo object to bundler
No semantic changes made.
2013-05-10 21:35:49 +02:00
Benoit Boissinot
a898b587b8 bundle-ng: add bundlecaps argument to getbundle() command 2013-02-09 23:42:03 +01:00
Sune Foldager
6bd4fdfe9d bundle-ng: move group into the bundler
No additional semantic changes made.
2013-05-10 21:03:01 +02:00
Benoit Boissinot
3329216677 bundle-ng: move bundler creation up in the stack
Create a simple start() method to pass the lookup function until bundler
becomes smarter and gets a repo object.

Since we now create the bundler for the whole lifetime, we need to pass it
down to revlog methods.
2013-05-10 20:37:41 +02:00
Michael Tjørnemark
e68243ee04 changegroup: decompress GZ algorithm in larger chunks for better performance 2012-04-29 20:58:50 +02:00
Martin Geisler
af8a35e078 check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
Benoit Boissinot
b805aced54 unbundler: separate delta and header parsing
Add header parsing for changelog and manifest (currently no headers might
change for next-gen bundle).
2011-04-30 19:01:24 +02:00
Benoit Boissinot
e3152ec807 changegroup: new bundler API 2011-04-30 11:03:28 +02:00
Benoit Boissinot
c5f5260aea bundler: make parsechunk return the base revision of the delta 2011-04-30 10:00:41 +02:00
Benoit Boissinot
a8923ec73f bundle: more comments about the different header types, remove useless if 2011-04-30 14:22:03 +02:00
Matt Mackall
1fb0b59ceb changegroup: introduce bundler objects
This makes the bundler pluggable at lower levels.
2011-03-31 15:24:06 -05:00
Matt Mackall
7dc3f0f9f2 changegroup: roll changegroup.collector into lookup functions 2011-03-28 11:18:56 -05:00
Jim Hague
e9a32b9ee1 changegroup: fix typo introduced in a6fa507d66ad 2011-02-22 16:31:01 +01:00
Mads Kiilerich
1203c4eaa3 changegroup: don't accept odd chunk headers 2011-02-22 03:10:37 +01:00
Mads Kiilerich
33712b2012 changegroup: verify all stream reads
Mercurial often failed with struct.error or mpatch.mpatchError if incomplete
data was received from a server.

Now we validate all changegroup reads and aborts with
  abort: stream ended unexpectedly (got %d bytes, expected %d)
if less than requested was read.
2011-02-22 03:03:39 +01:00
Mads Kiilerich
ff6d185655 changegroup: don't accept streams without proper termination
Streams should be terminated with a zero size changegroup, and read should
never be permitted to return less than requested.
2011-02-22 03:02:50 +01:00
Matt Mackall
cdb9f7c881 bundlerepo: restore close() method 2010-09-20 16:14:05 -05:00
Matt Mackall
aa7fff48c0 bundle: move chunk parsing into unbundle class 2010-09-19 13:12:45 -05:00
Matt Mackall
4b4d939b00 bundle: get rid of chunkiter 2010-09-19 12:51:54 -05:00
Matt Mackall
1118760c78 bundle: refactor progress callback
This lets us eliminate the chunk iterator so we can have the bundle class
parse headers.
2010-09-19 12:38:44 -05:00
Matt Mackall
43940bec52 bundle: make getchunk() a method 2010-09-18 18:20:34 -05:00
Matt Mackall
10fc9a1867 bundlerepo: use bundle objects everywhere 2010-09-17 19:24:29 -05:00
Matt Mackall
02677f1fa3 bundle: make unbundle object seekable
This is only for uncompressed bundles used by bundlerepo.
2010-09-17 19:02:32 -05:00
Matt Mackall
44ccb450e4 bundle: push chunkbuffer down into decompress
We replace the fixup iterator with a file-like object so that
uncompressed file streams can be passed end to end through the stack.
2010-09-17 19:02:26 -05:00
Matt Mackall
60627b799a bundlerepo: remove duplication of bundle decompressors 2010-08-25 16:55:54 -05:00
Matt Mackall
6b94ff7674 bundle: introduce bundle class 2010-08-25 16:53:06 -05:00
Matt Mackall
ee35426eda bundle: unify/refactor unbundle/readbundle 2010-08-25 15:33:06 -05:00
Matt Mackall
35ddd7d020 bundle: factor out decompressor 2010-08-25 15:33:05 -05:00
Benoit Boissinot
27026ab37f changegroup*(): use set instead of dict 2010-07-22 14:34:37 +02:00
Augie Fackler
47c5689cb6 localrepo: show indeterminate progress for incoming data
This has some quirks, like showing progress bars for importing
bundles, including during rebase.
2010-02-07 12:00:40 -06:00
Dirkjan Ochtman
a1424fe8be localrepo: unify changegroup and changegroupsubset code paths a bit 2010-02-07 09:58:41 +01:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Greg Ward
d0559b076a Improve some docstrings relating to changegroups and prepush(). 2009-09-08 17:58:59 -04:00
Martin Geisler
0d6a5ead82 typos: "it's" -> "its" 2009-07-08 23:17:10 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
8e4bc1e9ad put license and copyright info into comment blocks 2009-04-26 01:13:08 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Dirkjan Ochtman
44000fbf43 improve changegroup.readbundle(), use it in hgweb 2008-02-21 17:02:28 +01:00
Dirkjan Ochtman
cdb32d9cc8 hgweb: use bundletypes from mercurial.changegroup 2008-02-21 15:00:25 +01:00
Alexis S. L. Carvalho
a0dd47463e allow the creation of bundles with empty changelog/manifest chunks 2008-01-19 18:01:16 -02:00
Matt Mackall
305c1ae64c changegroup: avoid large copies
- handle chunk headers separately rather than prepending them to
  (potentially large) chunks
- break large chunks into 1M pieces for compression
- don't prepend file metadata onto (potentially large) file data
2007-10-03 17:17:28 -05:00