Commit Graph

59 Commits

Author SHA1 Message Date
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Benoit Boissinot
a98dab4110 manifest/revlog: do not let the revlog cache mutable objects
If a buffer of an mutable object is passed to revlog.addrevision(), the revlog
will happily store it in its cache. Later when the revlog reuses the cached
entry, if the manifest modified the object in-between, all kind of bugs
appears.

We fix it by:
- passing immutable objects to addrevision() if they are already available
- only storing the text in the cache if it's of str type

Then we can remove the conversion of the cache entry to str() during
retrieval. That was probably just there hiding the bug for the common cases
but not really fixing it.
2009-09-04 10:47:55 +02:00
Benoit Boissinot
68e9caf50f manifestdict: remove unnecessary dictionary copy
No need to copy the dict, dict.__init__() will do that for us.
It was responsible for a non-negligeable waste of time during a qpush of an
-mm queue on the kernel repo.
2009-09-03 02:42:56 +02:00
Benoit Boissinot
1b0af4b591 manifest.add(): cleanup worklist construction and iteration 2009-09-02 21:05:43 +02:00
Benoit Boissinot
ef4ae33a57 manifest: simplify cache handling, use a unique cache 2009-09-02 21:05:01 +02:00
Benoit Boissinot
79eb77ecc4 manifest.add(): simplify with iterators and generator expressions 2009-09-02 20:18:35 +02:00
Peter Arrenbrecht
a75765cf7f drop unused imports 2009-05-14 15:35:46 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Greg Ward
fd1580418a manifest: improve error message about newlines in filenames
Include the offending filenames in the error message.  Now this error message
is consistent with the same error issued by dirstate.py (although there is
still duplicate code).
2009-04-18 09:48:59 -04:00
Matt Mackall
b28ccc9a94 revlog: kill from-style imports
They're slow.
2009-01-11 22:55:36 -06:00
Matt Mackall
d15d559b7c errors: move revlog errors
- create error.py for exception classes to reduce demandloading
- move revlog exceptions to it
- change users to import error and drop revlog import if possible
2009-01-11 22:48:28 -06:00
Patrick Mezard
8cb1782f3b manifest: fix _search() corner-case
It failed when searching the empty string in the null revision.
2008-11-25 22:23:17 +01:00
Matt Mackall
0770924171 revlog: remove delta function 2008-11-12 15:32:16 -06:00
Matt Mackall
d8df9690c0 manifest: make checkforbidden take a list 2008-06-27 19:27:00 -05:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Matt Mackall
dcacfb3161 manifest: remove execf/linkf methods 2008-06-26 14:35:50 -05:00
Matt Mackall
d462e1fc26 simplify flag handling
add _checklink var to dirstate
introduce dirstate.flagfunc
switch users of util.execfunc/linkfunc to flagfunc
change manifestdict.set to take a flags string
change ctx.fileflags to ctx.flags
change gitmode func to a dict
remove util.execfunc/linkfunc
2008-06-26 13:46:34 -05:00
Bryan O'Sullivan
8a988e392e manifest: improve parsing performance by 8x via a new C extension 2008-03-26 10:12:10 -07:00
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Matt Mackall
28d6a9f074 manifest: minor performance tweak 2007-09-24 12:42:25 -05:00
Matt Mackall
f7f7d43737 manifest: speed up creation of the manifestdict
- fold iteration and rawset into parse
- avoid creating extra new strings with [:] where possible
- speed up node.bin
2007-07-23 20:44:08 -05:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
Thomas Arendsen Hein
483231d996 Cleanup of whitespace, indentation and line continuation. 2007-06-19 08:06:37 +02:00
Matt Mackall
04561e556e revlog: simplify revlog version handling
- pass the default version as an attribute on the opener
- eliminate config option mess
2007-03-22 19:52:38 -05:00
Matt Mackall
b4f6965b1d revlog: don't pass datafile as an argument 2007-03-22 19:12:03 -05:00
Alexis S. L. Carvalho
b6eb1f041b fix manifest.find 2007-03-07 15:25:58 -03: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
7d00e37112 issue352: disallow '\n' and '\r' in filenames (dirstate and manifest) 2006-11-01 17:56:55 +01:00
Thomas Arendsen Hein
0a7b982aa6 Whitespace/Tab cleanup 2006-10-01 19:26:33 +02:00
Brendan Cully
e54b369ac8 Abstract manifest block parsing. 2006-09-29 13:00:54 -07:00
Benoit Boissinot
f31660ebea fix newline in error message 2006-09-22 18:29:04 +02:00
Benoit Boissinot
663bcd49d0 manifest.py: remove unnecessary method 2006-09-20 22:26:47 +02:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Alexis S. L. Carvalho
219803f060 Fix some bugs introduced during the manifest refactoring 2006-08-12 08:53:23 -03:00
Matt Mackall
5c0d170547 Remove manifest.readflags 2006-08-11 11:00:38 -05:00
Matt Mackall
756da188ad Switch to simpler manifestdict 2006-08-10 22:38:56 -05:00
Matt Mackall
de8f408ebb Combine manifest dict and flags dict into a single object
This gets rid of the need to track two objects and might save memory.

This might be faster implemented as a subclassed dict with auxiliary
functions to access a sparse flags dict.
2006-08-09 14:53:03 -05:00
Matt Mackall
6a4cbda08b manifestflags: eliminate remaining users of direct dict access 2006-07-19 19:11:50 -05:00
Matt Mackall
603ad31fb9 Use strings for manifestflags to allow storing multiple flags 2006-07-16 03:22:05 -05:00
Matt Mackall
4e6cb39019 Start using manifestflags methods 2006-07-16 03:14:17 -05:00
Matt Mackall
49a6e6c51a Add manifestflags class 2006-07-16 02:59:20 -05:00
Vadim Gelfer
9a0c813fdc use demandload more. 2006-06-20 23:58:21 -07:00
Vadim Gelfer
5eb540c338 fix parsing of tags. make parse errors useful. add new tag tests.
old code read every head of .hgtags. delete and recreate of .hgtags gave
new head, but if error in deleted rev, .hgtags had error messages every
time it was parsed. this was very hard to fix, because deleted revs hard
to get back and update, needed merges too.

new code reads .hgtags on every head. advantage is if parse error
happens with new code, is possible to fix them by editing .hgtags on a
head and committing.

NOTE: new code uses binary search of manifest of each head to be fast,
but still much slower than old code. best thing would be to have delete
record stored in filelog so we never touch manifest. could find live
heads directly from filelog. this is more work than i want now.

new tests check for parse of tags on different heads, and inaccessible
heads created by delete and recreate of .hgtags.
2006-05-18 23:31:12 -07:00
Thomas Arendsen Hein
c9a89940a1 Replaced 0 with REVLOGV0 where this meaning is used. 2006-04-27 21:16:46 +02:00
mason@suse.com
ed26ff0cae Implement revlogng.
revlogng results in smaller indexes, can address larger data files, and
supports flags and version numbers.

By default the original revlog format is used.  To use the new format,
use the following .hgrc field:

[revlog]
# format choices are 0 (classic revlog format) and 1 revlogng
format=1
2006-04-04 16:38:43 -04:00