Commit Graph

43 Commits

Author SHA1 Message Date
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
Matt Mackall
7bd6a2278b writebundle: overwrite existing bundle file 2006-12-19 08:59:41 -06:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Benoit Boissinot
e5024feef0 fix errors spotted by pychecker 2006-12-10 19:41:57 +01:00
Alexis S. L. Carvalho
f52b6657a0 changegroup.py: delay the loading of the bz2 and zlib modules 2006-12-02 16:08:00 -02:00
Thomas Arendsen Hein
873d44b19d Use 'bundletype' instead of 'type' to not shadow built-in function. 2006-11-22 22:33:57 +01:00
Thomas Arendsen Hein
a73c25c144 BZ2Compressor already defaults to compresslevel=9. 2006-11-22 22:32:23 +01:00
Benoit Boissinot
0427029f2e fix writebundle for bz2 bundles 2006-11-22 22:08:00 +01:00
Matt Mackall
312ace343c unduplicate bundle writing code from httprepo 2006-11-15 23:37:45 -06:00
Matt Mackall
14645d0488 create a readbundle function 2006-11-15 15:51:58 -06:00
Matt Mackall
85f6bef03c move write_bundle to changegroup.py 2006-11-15 15:51:58 -06:00
Vadim Gelfer
9a0c813fdc use demandload more. 2006-06-20 23:58:21 -07:00
Thomas Arendsen Hein
bddf3b4cc7 Added missing gettext import to changegroup.py. 2006-03-24 15:19:08 +01:00
Thomas Arendsen Hein
b246223f51 make incoming work via ssh (issue139); move chunk code into separate module.
Incoming ssh needs to detect the end of the changegroup, otherwise it would
block trying to read from the ssh pipe. This is done by parsing the
changegroup chunks.

bundlerepo.getchunk() already is identical to
localrepo.addchangegroup.getchunk(), which is followed by getgroup which
looks much like what you can re-use in bundlerepository.__init__() and in
write_bundle(). bundlerevlog.__init__.genchunk() looks very similar, too,
as do some while loops in localrepo.py.

Applied patch from Benoit Boissinot to move duplicate/related code
to mercurial/changegroup.py and use this to fix incoming ssh.
2006-03-21 11:47:21 +01:00