Commit Graph

358 Commits

Author SHA1 Message Date
Sune Foldager
9b847e3562 revlog: introduce _chunkbase to allow filelog to override
Used by revlog.revision to retrieve the base-chunk in a delta chain.
2011-04-30 16:33:47 +02:00
Alexander Solovyov
0eb3836642 remove unused imports and variables 2011-04-30 13:59:14 +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
c9e7d5507f changegroup: add revlog to the group callback 2011-03-28 11:18:56 -05:00
Matt Mackall
d9e86660be changegroup: move sorting down into group 2011-03-28 11:18:56 -05:00
Matt Mackall
f94b6206a0 changegroup: combine infocollect and lookup callbacks 2011-03-28 11:18:56 -05:00
Matt Mackall
af08071ace changegroup: drop unused fullrev
This is unfinished and unused and complicates expanding the wire protocol.
2011-03-24 17:16:30 -05:00
Matt Mackall
f689cccd2c revlog: change variable name to avoid reuse 2011-03-26 17:12:02 -05:00
Peter Arrenbrecht
6646f48826 wireproto: add getbundle() function
getbundle(common, heads) -> bundle

Returns the changegroup for all ancestors of heads which are not ancestors of common. For both
sets, the heads are included in the set.

Intended to eventually supercede changegroupsubset and changegroup. Uses heads of common region
to exclude unwanted changesets instead of bases of desired region, which is more useful and
easier to implement.

Designed to be extensible with new optional arguments (which will have to be guarded by
corresponding capabilities).
2011-03-23 16:02:11 +01:00
Dan Villiom Podlaski Christiansen
ec590d5cd4 explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
2010-12-24 15:23:01 +01:00
Matt Mackall
f549de8060 revlog: remove stray test in rev() 2011-01-21 16:26:01 -06:00
Matt Mackall
856c224de7 revlog: pass rev to _checkhash 2011-01-18 15:55:48 -06:00
Matt Mackall
275d2d9cb0 revlog: incrementally build node cache with linear searches
This avoids needing to prime the cache for operations like verify
which visit most or all of the index.
2011-01-18 15:55:46 -06:00
Benoit Boissinot
8acffa3308 revlog: explicit test and explicit variable names 2011-01-16 12:25:46 +01:00
Benoit Boissinot
3ada8fe22e revlog: if the nodemap is set, use the fast version of revlog.rev() 2011-01-16 12:24:48 +01:00
Benoit Boissinot
383d62511b revlog/parseindex: construct the nodemap if it is empty 2011-01-15 15:06:53 +01:00
Benoit Boissinot
4072e97b7c revlog: always add the magic nullid/nullrev entry in parseindex 2011-01-15 13:02:19 +01:00
Benoit Boissinot
b75c111431 revlog/parseindex: no need to pass the file around 2011-01-15 15:04:58 +01:00
Matt Mackall
1e3dbac7f5 revlog: do revlog node->rev mapping by scanning
Now that the nodemap is lazily created, we use linear scanning back
from tip for typical node to rev mapping. Given that nodemap creation
is O(n log n) and revisions searched for are usually very close to
tip, this is often a significant performance win for a small number of
searches.

When we do end up building a nodemap for bulk lookups, the scanning
function is replaced with a hash lookup.
2011-01-11 21:52:03 -06:00
Matt Mackall
a1c37f5749 revlog: introduce a cache for partial lookups
Partial lookups are always O(n), and often we look up the same
one multiple times.
2011-01-11 17:12:32 -06:00
Matt Mackall
846d35e24f revlog: only build the nodemap on demand 2011-01-11 17:01:04 -06:00
Matt Mackall
efaaee2894 revlog: remove lazy index 2011-01-04 14:12:52 -06:00
Matt Mackall
a399da7502 revlog: break hash checking into subfunction 2011-01-06 17:04:41 -06:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Nicolas Dumazet
f48c256c16 revlog: fix descendants() if nullrev is in revs
We were not returning the correct result if nullrev was in revs, as we
are checking parent(currentrev) != nullrev before yielding currentrev

test-convert-hg-startrev was wrong: if we start converting from rev -1 and
onwards, all the descendants of -1 (full repo) should be converted.
2010-11-07 18:23:48 +09:00
Nicolas Dumazet
31a27ed9b9 revlog: if start is nullrev, end is always a descendant 2010-11-07 18:16:07 +09:00
Matt Mackall
90141f6021 revlog: choose best delta for parentdelta (issue2466)
When parentdelta is enabled, we choose the delta that has the minimum
distance to its base. Otherwise, base may be sufficiently far away to
require a full version, resulting in greatly reduced compression.
2010-10-30 02:47:34 -05:00
Matt Mackall
d0eecfc8e5 revlog: precalculate p1 and p2 revisions 2010-10-30 02:47:34 -05:00
Matt Mackall
9e1ed89cc3 revlog: extract delta building to a subfunction 2010-10-30 02:47:34 -05:00
Matt Mackall
4d0c140fd2 revlog: simplify cachedelta handling 2010-10-30 02:47:34 -05:00
Matt Mackall
a758f18a0a revlog: fix buildtext local scope
buildtext stores its result in _addrevision scope to avoid repeated builds
cachedelta is already visible
2010-10-30 02:47:34 -05:00
Benoit Boissinot
e33ea43988 revlog.addgroup(): always use _addrevision() to add new revlog entries
This makes parentdelta clone support pulling.
2010-10-08 18:00:19 -05:00
Benoit Boissinot
617749c5ab revlog._addrevision(): allow text argument to be None, build it lazily 2010-10-08 18:00:16 -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
Benoit Boissinot
0a73b8e369 mdiff.patch(): add a special case for when the base text is empty
remove the special casing from revlog.addgroup()
2010-08-23 13:28:04 +02:00
Benoit Boissinot
cdd70dbbdc revlog: add rawsize(), identical to size() but not subclassed by filelog 2010-08-23 13:24:19 +02:00
Benoit Boissinot
6b8f2ae045 revlog.addrevision(): move computation of nodeid in addrevision()
The check "if node in nodemap" is already done earlier in addgroup().
2010-08-22 23:17:17 +02:00
Benoit Boissinot
25c2d76480 revlog: fix docstring 2010-08-21 19:31:59 +02:00
Benoit Boissinot
70194e7582 deltaparent(): don't return nullrev for a revision containing a full snapshot
this allows us to simplify manifest.readdelta and revlog.revdiff
2010-08-21 19:30:42 +02:00
Vishakh H
f9137b572d revlog: addgroup re-adds punched revisions for missing parents
While reading changegroup if a node with missing parents is encountered,
we add a punched entry in the index with null parents for the missing
parent node.
2010-08-13 19:42:28 +05:30
Vishakh H
6a818df747 revlog: generate full revisions when parent node is missing
The full revision is sent if the first parent, against which diff is calculated, is
missing at remote. This happens in the case of shallow clones.
2010-08-13 19:41:51 +05:30
Benoit Boissinot
219b0cf9cf revlog.revision(): inline deltachain computation 2010-08-20 00:17:50 +02:00
Benoit Boissinot
8b484e5088 revlog.revision(): remove debug code 2010-08-20 00:17:50 +02:00
Benoit Boissinot
4b8002ed12 revlog.revision(): don't use nullrev as the default value for the cache
I is probably a bug if the deltachain computation think there was a cache hit
at nullrev. Use None instead, this will never trigger a cache hit.
2010-08-20 00:17:50 +02:00
Benoit Boissinot
841f801067 revlog.revision(): minor cleanup
Rename some variables, making the name more obvious (in particular "cache" was
actually two different variable.
Move code around, moving the index preloading before the deltachain computation,
without that index preloading was useless (everything was read in deltachain).
2010-08-20 00:17:50 +02:00
Benoit Boissinot
35b0c5591f parendelta: fix computation of base rev (fixes issue2337)
Refactor revlog._addrevision() and put the correct base rev in the
parent-delta case: base(rev) should always be equal to the first full snapshot
that is needed by the delta chain, in both parent-delta and tip-delta case.

Before this fix, the base rev was in most case wrong (and in the case where
p1 == nullid, this triggered the bug from issue2337). This means that
repositories converted to parent-delta earlier are corrupted and needs to be
reconverted.
2010-08-18 19:37:23 +02:00
Benoit Boissinot
cbd0c9fbc1 revlog._addrevision(): make the parent of the cached delta explicit 2010-08-18 19:45:52 +02:00
Matt Mackall
d6488d66cb revlog: optimize deltachain 2010-08-15 23:13:56 -05:00
Pradeepkumar Gayam
2257cdb06d revlog: append delta against p1 2010-08-10 22:27:41 +05:30