Commit Graph

49 Commits

Author SHA1 Message Date
mason@suse.com
66f2574257 Add optional stop revision to revlog.heads 2005-08-14 20:09:09 -08:00
Tristan Wibberley
34dcd4a098 Fixed revlog.children.
It was comparing a node to a rev, then appending a rev onto the list
of children being constructed instead of a node.
2005-08-06 21:58:28 +01:00
Matt Mackall
bc0449b7fa Fix out of range regression
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fix out of range regression

From: Filip Brcic <brcha@users.sourceforge.net>

The old revlog.py issued "index out of range" error when cloning the repository
Now I have reverted the parts of revlog.py to the old state when prev was
initialized as -1 and later assigned self.tip() only if that is possible.
Previously prev was always initialized as self.tip() and that is where the
out of range error was.

manifest hash: c94c9aee8b6d382ef52c3981f306a6e7e5f4c4d1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCzzIxywK+sNU5EO8RAtlcAJ0TX9FXuC2c3YHuYXNwqZhdzPWUlgCggq+a
yJzUKDKH/gvnD3Tx3jcmCn8=
=euPi
-----END PGP SIGNATURE-----
2005-07-08 18:10:57 -08:00
Matt Mackall
7ad3935fdb Fix corruption resulting from skipping parts of a revision group
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fix corruption resulting from skipping parts of a revision group

We were occassionally losing track of what revision a delta applied to
when we skipped over deltas we already had and applying the delta
against the wrong base. This could result in coredumps from mpatch,
consistency errors, or failed verify.

manifest hash: fcf20a8abfd81f08fae2398136b2ed66216b2083
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCzu5SywK+sNU5EO8RAi10AJ9cqIfQzOzbcdH36t1LR/rY+UMtHwCeM79p
Dtv+Jh0McLZr6nf4iJyhDgI=
=5o6U
-----END PGP SIGNATURE-----
2005-07-08 13:21:22 -08:00
Matt Mackall
ccd4188077 Fix an odd revlog bug
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Fix an odd revlog bug

If revlog had a cached -empty- revision, as opposed to no cached
version, it could get confused. This cropped up in verify on a
particular repo.

manifest hash: 90ccf122087f6bbcb4322cb9d9bb8124610ba886
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCzjRaywK+sNU5EO8RAgVEAKCv3WBJt1rBOX0UlTDXFPygPIru+gCfTZxJ
CEz1lYny1gkQ+haGY26QdBs=
=C/K5
-----END PGP SIGNATURE-----
2005-07-08 00:07:54 -08:00
mason@suse.com
5cc69df211 Performance enhancements for manifest.add()
# HG changeset patch
# User mason@suse.com

Performance enhancements for manifest.add()

Improve manifest.add performance by using bisect to insert/remove
changed items into the manifest list.  This also generates the
manifest delta directly based on the changes being made.
2005-07-06 22:28:35 -08:00
mpm@selenic.com
c6e600652f Hashing speed-up
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hashing speed-up

- From Chris Mason

manifest hash: c10091676647015b907a3ddce4dc629cb485de36
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCxCFmywK+sNU5EO8RAjiEAJ98eBaomWIUtT7DAm5dCbcAOe1I7gCdFl/E
AvepXnn+tLC2Grk9et2sL3M=
=spZz
-----END PGP SIGNATURE-----
2005-06-30 08:44:22 -08:00
mpm@selenic.com
0fb5db6915 Whitespace cleanups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Whitespace cleanups

manifest hash: ac954bc3a4f034c12638a259ecd65841f5b63c5c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwuubywK+sNU5EO8RAluIAJ98XQpNdZUpSmYKgDmrMRlbL76ZzQCfes0t
rknNUN/PhtyA4bzL646dOz4=
=UyCE
-----END PGP SIGNATURE-----
2005-06-29 10:42:35 -08:00
Thomas Arendsen Hein
fbe157b4b5 Really _call_ method revlog.count in revlog.lookup()
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Really _call_ method revlog.count in revlog.lookup()
This fixes e.g. 'hg export 398737777' (exists in the mercurial repo).

manifest hash: 9de9ad4c40d0746cb3db346a01c373e3b4aba54a
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCvovbW7P1GVgWeRoRAiyEAJ9gVZZiMGA3YItcWRHeai/9C+dMTgCbBiii
QoFaXQ9wZDds8fVVsvENAYw=
=msWK
-----END PGP SIGNATURE-----
2005-06-26 12:04:59 +01:00
mpm@selenic.com
5ff41c691c Various node id lookup tweaks
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Various node id lookup tweaks

- - lookup of nullid with lazymap fixed
- - do the Pythonic thing with negative rev numbers (-1 == tip)
- - bound ranges on rev numbers
- - catch exceptions more correctly
- - restrict node id matching to beginning of string on

manifest hash: 15918cb74f41ac4bbf8bf02bc3bb599f24f0b5b8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCvQzDywK+sNU5EO8RAnKfAJ4vzXnrGmRwOlPqNQFxxrUKchzAzQCcDkbi
g3T3KiiVUckrWpziGq67YUE=
=vrSU
-----END PGP SIGNATURE-----
2005-06-24 23:50:27 -08:00
mpm@selenic.com
ce2783cea1 Make lookup a bit smarter
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Make lookup a bit smarter

Handle overflow error
Handle "0000" -> nullid, not 0

manifest hash: f3af0c171216687c621fd0214efe45775e5a1d34
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCu2PrywK+sNU5EO8RArqWAJ9hafXgnHjCDE/Sxtvyo+e+qmPaGgCfR8AV
DCG3i0NasG3ItbPvux2Dm5Q=
=zjqN
-----END PGP SIGNATURE-----
2005-06-23 17:37:47 -08:00
mpm@selenic.com
39bfce9301 Ancestor algorithm fix
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ancestor algorithm fix

The ancestor algorithm was a bit too optimistic about node ordering
still. Add revision numbers to the comparison to sort things out.

manifest hash: f4eaf95057b5623e864359706dcaee820b10fd20
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCsTrCywK+sNU5EO8RAtqMAJ9fEJEesPn+0SMg/i/g5vZYmX/pBgCfVnhl
+s88q/Wilw27MVWP6J6oqX8=
=k9AU
-----END PGP SIGNATURE-----
2005-06-16 00:39:30 -08:00
mpm@selenic.com
3a091e0210 Change the size of the short hash representation
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Change the size of the short hash representation

First note that this number doesn't really matter, as we always check
for ambiguous short hash ids.

Here's the math on collision probability:

>>> import math
>>> def p(f, n): return 1 - (1 / math.exp(n**2/(2*f)))
...
>>> p(2**32, 30000.0)
0.09947179164613551   # with 30000 changesets (BKCVS), we have a 9% chance
>>> p(2**32, 65000.0)
0.38850881217977273   # and with a full import from BK, we'd have a 39% chance
>>> p(2**40, 1e6)
0.36539171908447321   # we'd like to be "safe" for 1M csets, so 40 isn't enough
>>> p(2**48, 1e6)
0.001774780051374103  # But 48 looks good
>>> p(2**48, 1e7)
0.16275260939624481
>>> p(2**48, 5e6)
0.043437281083569146
>>> p(2**48, 2e6)
0.0070802434913129764
>>> p(2**48, 3e6)
0.01586009440574343

manifest hash: 24d9f928a463f46708b0e11fb781d5a241851424
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCsQoMywK+sNU5EO8RAoBBAJwII9GV6dT9QUOYAk3gZGw9z0JvjACfSI4q
IFnTu1F7P5OuLelO1GsM8Bs=
=CNWk
-----END PGP SIGNATURE-----
2005-06-15 21:11:40 -08:00
mpm@selenic.com
6f13d3e93a revlog: add a children function
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

revlog: add a children function

manifest hash: eda39cb99d0df5b3262d97a9e161a8acceb1da3d
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCsPZ0ywK+sNU5EO8RAiAcAJ9D+y8zQ/Gai7CpTkfTamPFxmvVRACcDRv9
5HkupYyrxslGnGJpELaF1is=
=zf1d
-----END PGP SIGNATURE-----
2005-06-15 19:48:04 -08:00
mpm@selenic.com
9e5dff9854 lazyparser speed ups
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

lazyparser speed ups

When we do __contains__ on a map, we might as well load the whole
index. Not doing this was slowing down finding new changesets quite by
a factor of 20. When we do a full load, we also attempt to replace the
revlog's index and nodemap with normal Python objects to avoid the
lazymap overhead.

manifest hash: 9b2b20aacc508f9027d115426c63a381d28e5485
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCreYIywK+sNU5EO8RAoNHAJ9+LmXqsTQb9Bh3mZHq0A0VfQOleQCffHmn
jC/O0vnfx5FCRsX2bUFG794=
=BDTz
-----END PGP SIGNATURE-----
2005-06-13 12:01:12 -08:00
mpm@selenic.com
b7514f43bc revlog: allow duplicates
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

revlog: allow duplicates

If two branches make the same change to the same parent, the result
will be an identical hash. Git apparently does this all the time. Deal
with it gracefully.

manifest hash: c6217eab4b310e1ae529dd75ab90e717dbe5d55d
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCqU61ywK+sNU5EO8RAkFqAJ9KhWUQgjZbzzB/+mTkolH0GkT1awCfa+Mj
ulbI4xCRZcvfQE492mcNwQA=
=N6In
-----END PGP SIGNATURE-----
2005-06-10 00:26:29 -08:00
mpm@selenic.com
bc554a1e69 fix heads for rev 0
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

fix heads for rev 0

manifest hash: 7b2f4607f6c54b660d63ac35ba953576464e1511
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCofyyywK+sNU5EO8RAjkeAJ4rfOQ9HV+gpndsTzuoS6R3f+mzEQCfcb0P
IWhTz6XDpTWEkjzcK++mZ4k=
=mINY
-----END PGP SIGNATURE-----
2005-06-04 11:10:42 -08:00
mpm@selenic.com
2a4127e46c fix bad assumption about uniqueness of file versions
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

fix bad assumption about uniqueness of file versions

Mercurial had assumed that a given file hash could show up in only one
changeset, and thus that the mapping from file revision to changeset
was 1-to-1. But if two people perform the same edit with the same
parents, we can get an identical hash in different changesets.

So we've got to loosen up our uniqueness checks in addgroup and in
verify.

manifest hash: 5462003241e7d071ffa1741b87a59f646c9988ed
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCoMDkywK+sNU5EO8RAg9PAJ9YWSknfFBoeYve/+Z5DDGGvytDkwCgoMwj
kT01PcjNzGPr1/Oe5WRvulE=
=HC4t
-----END PGP SIGNATURE-----
2005-06-03 12:43:16 -08:00
mpm@selenic.com
beee203034 Beginning of multi-head support
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Beginning of multi-head support

Add revlog.heads()
Add heads command to list changeset heads

manifest hash: 50df6fffe59a40c19782e2c77c8077db026fde67
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCn7tFywK+sNU5EO8RAusWAJ9EojIxgqEEt8VZd5S+5Laj8tHV+ACfWLb5
TC7AnsoFGg50jAWF0EsofDA=
=nzyH
-----END PGP SIGNATURE-----
2005-06-02 18:07:01 -08:00
mpm@selenic.com
91589c0bf7 revlog: remove some unnecessary imports
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

revlog: remove some unnecessary imports

manifest hash: 63c887eceb54c8bd5a10692a905fb79079057246
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCnXASywK+sNU5EO8RAkxVAJ92do7puoVbgHE2whbow4MGKKv4pQCeMmms
bt2r/9oVoFclTh2dL3SaQ2Q=
=Jeuv
-----END PGP SIGNATURE-----
2005-06-01 00:21:38 -08:00
mpm@selenic.com
55d14e5d8d Changes to network protocol
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Changes to network protocol

Stream changes at the delta level rather than at whole delta groups
 this breaks the protocol - we now send a zero byte delta to indicate
 the end of a group rather than sending the entire group length up front
Fix filename length asymmetry while we're breaking things
Fix hidden O(n^2) bug in calculating changegroup
 list.append(e) is O(n), list + [element] is not
Decompress chunks on read in revlog.group()
Improve status messages
 report bytes transferred
 report nothing to do
Deal with /dev/null path brokenness
Remove untriggered patch assertion

manifest hash: 3eedcfe878561f9eb4adedb04f6be618fb8ae8d8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCmzlqywK+sNU5EO8RAn0KAJ4z4toWSSGjLoZO6FKWLx/3QbZufACglQgd
S48bumc++DnuY1iPSNWKGAI=
=lCjx
-----END PGP SIGNATURE-----
2005-05-30 08:03:54 -08:00
mpm@selenic.com
dba1a9fc73 A new ancestor algorithm
The old ancestor algorithm could get fooled into returning ancestors
closer to root than it ought to. Hopefully this one, which strictly
orders its search by distance from room, will be foolproof.
2005-05-24 23:11:44 -08:00
mpm@selenic.com
b4d3ada8cd Remove some debugging code from lazyparser 2005-05-20 17:50:11 -08:00
mpm@selenic.com
ea4eabe690 Add code to retrieve or construct a revlog delta 2005-05-20 17:40:24 -08:00
mpm@selenic.com
a8e8d775f0 Make revision code slightly faster 2005-05-20 17:36:02 -08:00
mpm@selenic.com
a3b0765ce7 Only use lazy indexing for big indices and avoid the overhead of the
lazy index in the small index case.
2005-05-20 17:35:20 -08:00
mpm@selenic.com
06820561ca Make lazyindex load slightly faster 2005-05-20 17:34:04 -08:00
mpm@selenic.com
8b0e7913c6 Make compression more intelligent:
- we don't attempt to compress things under 44 bytes (empirical)
- we check whether larger objects actually compress
- we tag objects to indicate their compression
  NUL means uncompressed and starts with NUL
  x means gzipped and starts with x (handy)
  u means uncompressed, drop the u
2005-05-20 17:31:12 -08:00
mpm@selenic.com
fb1218fe40 Add paranoia to diff code 2005-05-18 16:59:54 -08:00
mpm@selenic.com
21089cd87c Add iterator to the lazymap code 2005-05-18 16:47:49 -08:00
mpm@selenic.com
7e5280f30b Refactor merge code
Delete old code
Fix calculation of newer nodes on server
Fix branch recursion on client
Fix manifest merge problems
Add more debugging and note messages to merge
2005-05-18 16:29:39 -08:00
mpm@selenic.com
f2ebab86cb Friendlier exceptions for unknown node errors 2005-05-17 12:20:29 -08:00
mpm@selenic.com
6795b63eb7 More useful message on broken addgroup chain 2005-05-17 11:40:26 -08:00
mpm@selenic.com
77028dbcc6 Add -q quiet option
Make -d and -v do something
Add a bunch of debug and note messages
2005-05-17 11:06:59 -08:00
mpm@selenic.com
619ec7bc34 Fix bug in lazymap code
Add a sanity check to addgroup
2005-05-17 01:07:01 -08:00
mpm@selenic.com
1bf1e8bf4c Add lazy{parser,index,map} to speed up processing of index files 2005-05-17 00:33:22 -08:00
mpm@selenic.com
00b4996d46 Change revlog to use new patch code 2005-05-16 22:10:02 -08:00
mpm@selenic.com
e56388d1b4 Add mdiff.patches to speed up applying thousands of patches to the manifest 2005-05-14 10:27:14 -08:00
mpm@selenic.com
7c6f4b49c8 Add tag support 2005-05-13 13:12:32 -08:00
mpm@selenic.com
d9094f35ef Fix up a bunch of bugs in the new merge code
Move getchangegroup/addchangegroup to generators
2005-05-13 11:47:16 -08:00
mpm@selenic.com
264f689db9 Diff in subdirectories from Jake Edge
Dates in diff
Fix O(n^2) behaviour of manifest diff
Add a/ and b/ to work with patch -p1
2005-05-12 17:54:55 -08:00
mpm@selenic.com
8bd85e1add Add changegroup support 2005-05-10 00:40:49 -08:00
mpm@selenic.com
22ff07bd9b Fix recursion depth trouble with ancestor algorithm 2005-05-10 00:34:57 -08:00
mpm@selenic.com
9bc9418a12 Fix truncate logic for indices again 2005-05-07 16:33:31 -08:00
mpm@selenic.com
8e1b58ff84 Add smart node lookup by substring or by rev number 2005-05-07 16:11:36 -08:00
mpm@selenic.com
cd521a6348 Simplify integrity checking
More fiddling with transaction truncate points (still untested)
2005-05-04 22:51:25 -08:00
mpm@selenic.com
070c0db3c5 Fix off-by-one truncation in transaction rollback. 2005-05-04 09:33:46 -08:00
mpm@selenic.com
62cccd42a6 Handle nullid better for ancestor 2005-05-03 18:35:03 -08:00
mpm@selenic.com
ca8cb8ba67 Add back links from file revisions to changeset revisions
Add simple transaction support
Add hg verify
Improve caching in revlog
Fix a bunch of bugs
Self-hosting now that the metadata is close to finalized
2005-05-03 13:16:10 -08:00