Commit Graph

67 Commits

Author SHA1 Message Date
Martin Geisler
213ba1f97d manifest: use "\0" instead of "\000"
Though both give the same result (a NUL byte), I found that I tend to
read "\000" as "\0" + "00", which is something completely different.

I did not change the occurance of "\000" in archival.py since there
are other octal constants in that file.
2011-06-16 08:49:26 +02:00
Sune Foldager
750dcd7b48 revlog: compute correct deltaparent in the deltaparent function
It now returns nullrev for chain base revisions, since they are conceptually
deltas against nullrev. The revdiff function was updated accordingly.
2011-05-05 18:05:24 +02:00
Matt Mackall
5be0491c06 manifest: add readfast method 2011-03-20 19:43:28 -05:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01: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
Benoit Boissinot
cbd0c9fbc1 revlog._addrevision(): make the parent of the cached delta explicit 2010-08-18 19:45:52 +02:00
Pradeepkumar Gayam
fb9106e388 manifest: correct readdelta() according to parentdeltas 2010-08-10 22:28:52 +05:30
Renato Cunha
5790eb1140 manifest: removed usage of the global cmp function
Py3k doesn't have a global cmp() function, making this call problematic in the
py3k port. Also, calling cmp() here is not necessary, since we only want to
know if the two values are equal. A check for equality perfect in this case and
this patch does that.
2010-08-07 16:12:51 -03:00
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