Commit Graph

379 Commits

Author SHA1 Message Date
Greg Ward
d9c710d107 revlog: rewrite several method docstrings
- methods: findmissing(), nodesbetween(), descendants(), ancestors()
- the goal is precise, concise, accurate, grammatical, understandable,
  consistently formatted docstrings
2009-12-10 09:35:43 -05:00
Benoit Boissinot
80a458a464 pychecker: remove unused local variables 2009-10-31 17:04:46 +01:00
Greg Ward
d0559b076a Improve some docstrings relating to changegroups and prepush(). 2009-09-08 17:58:59 -04: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
Alejandro Santos
3183e52503 compat: use // for integer division 2009-07-05 11:00:44 +02:00
Martin Geisler
7fc350327e revlog: make triple-quoted string a real comment 2009-05-31 00:58:20 +02:00
Matt Mackall
28a532efb7 revlog: refactor chunk cache interface again
- chunk to _chunk
- _prime to _chunkraw
- _chunkclear for cache clearing
- _chunk calls _chunkraw
- clean up _prime a bit
- simplify users in revision and checkinlinesize
- drop file descriptor passing (we're better off opening fds lazily
2009-05-27 16:01:34 -05:00
Matt Mackall
4dc9e4309d revlog: report indexfile rather than datafile for integrity check 2009-05-27 14:44:54 -05:00
Matt Mackall
df215f1dab revlog: move stat inside lazyparser 2009-05-27 14:44:51 -05:00
Benoit Boissinot
1d46ec6dc3 changegroup: the node list might be an empty generator (fix issue1678) 2009-05-27 02:46:59 +02:00
Martin Geisler
4176f5b789 replace xrange(0, n) with xrange(n) 2009-05-25 23:06:11 +02:00
Benoit Boissinot
d861db9be5 revlog: fix undefined variable introduced in 042cecef3ad7 2009-05-25 13:52:09 +02:00
Matt Mackall
2c2304d400 revlog: fix reading of larger revlog indices on Windows 2009-05-23 11:53:23 -05:00
Martin Geisler
5d72c242d8 Merge with stable 2009-12-12 23:03:05 +01:00
Benoit Boissinot
795d30a996 revlog: add fast path to ancestor 2009-12-03 01:01:49 +01:00
Martin Geisler
0a365d5ca2 use 'x is None' instead of 'x == None'
The built-in None object is a singleton and it is therefore safe to
compare memory addresses with is. It is also faster, how much depends
on the object being compared. For a simple type like str I get:

            | s = "foo" | s = None
  ----------+-----------+----------
  s == None | 0.25 usec | 0.21 usec
  s is None | 0.17 usec | 0.17 usec
2009-05-20 00:52:46 +02:00
Benoit Boissinot
c97e6590bb revlog: use set instead of dict 2009-05-17 03:49:59 +02:00
Benoit Boissinot
c8bc34d692 revlog.missing(): use sets instead of a dict 2009-05-17 02:44:12 +02:00
Peter Arrenbrecht
5851b0b382 revlog: slightly tune group() by not going rev->node->rev 2009-05-14 16:00:21 +02:00
Matt Mackall
c70b6084a7 revlog: add cache priming for reconstructing delta chains 2009-05-07 19:39:45 -05:00
Matt Mackall
7aa559f96a revlog: use chunk cache to avoid rereading when splitting inline files 2009-05-07 19:39:45 -05:00
Matt Mackall
d48241b5f7 revlog: clean up the chunk caching code 2009-05-07 19:39:45 -05:00
Matt Mackall
9f78d7798f revlog: use index to find index size 2009-05-07 19:39:45 -05:00
Matt Mackall
00548e0791 revlog: preread revlog .i file
Smaller revlogs can be read with a single read, do it on open.
2009-05-07 19:39:45 -05:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Martin Geisler
2c8901a1b9 turn some comments back into module docstrings 2009-04-26 01:24:49 +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
Martin Geisler
7a5147b673 rebase, revlog: use set(x) instead of set(x.keys())
The latter is both unnecessary and slower.
2009-04-25 22:25:49 +02:00
Martin Geisler
747c05d2eb revlog: let nodestotag be a set instead of a list 2009-04-22 20:51:20 +02:00
Martin Geisler
e2222d3c43 replace set-like dictionaries with real sets
Many of the dictionaries created by dict.fromkeys were emulating sets.
These can now be replaced with real sets.
2009-04-22 00:57:28 +02:00
Martin Geisler
1deb417a82 util: use built-in set and frozenset
This drops Python 2.3 compatibility.
2009-04-22 00:55:32 +02:00
Henrik Stuart
c1e6537e5f strip: make repair.strip transactional to avoid repository corruption
Uses a transaction instance from the local repository to journal the
truncation of revlog files, such that if a strip only partially completes,
hg recover will be able to finish the truncate of all the files.

The potential unbundling of changes that have been backed up to be restored
later will, in case of an error, have to be unbundled manually. The
difference is that it will be possible to recover the repository state so
the unbundle can actually succeed.
2009-04-16 15:34:03 +02:00
Benoit Boissinot
309c0e0a31 merge with -stable 2009-04-06 20:11:00 +02:00
Benoit Boissinot
e5ea532970 raise RevlogError when parser can't parse the revlog index
Initial patch and test thanks to Nicolas Dumazet.
2009-04-06 19:48:11 +02:00
Nicolas Dumazet
3ced073c3b revlog: faster hash computation when one of the parent node is null
Because we often compute sha1(nullid), it's interesting to copy a precomputed
hash of nullid instead of computing everytime the same hash. Similarly, when
one of the parents is null, we can avoid a < comparison (sort).

Overall, this change adds a string equality comparison on each hash() call,
but when p2 is null, we drop one string < comparison, and copy a hash instead
of computing it. Since it is common to have revisions with only one parent,
this change makes hash() 25% faster when cloning a big repository.
2009-03-23 15:32:29 +01:00
Peter Arrenbrecht
a2d3e23eef cleanup: drop variables for unused return values
They are unnecessary. I did leave them in localrepo.py where there is
something like:

  _junk = foo()
  _junk = None

to free memory early. I don't know if just `foo()` will free the return
value as early.
2009-03-23 13:13:02 +01:00
Peter Arrenbrecht
bc21361ed2 cleanup: drop unused imports 2009-03-23 13:12:07 +01: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
Matt Mackall
4bb1cd5f2b lookup: speed up partial lookup 2008-11-12 19:11:34 -06:00
Matt Mackall
4205fad04a revlog: speed up parents() 2008-11-12 15:58:46 -06:00
Matt Mackall
0770924171 revlog: remove delta function 2008-11-12 15:32:16 -06:00
Matt Mackall
b2807810c6 linkrev: take a revision number rather than a hash 2008-11-12 15:19:14 -06:00
Benoit Boissinot
4f2e35bc33 fix pull racing with push/commit (issue1320)
changegroup() has a problem when nodes which does not descend from a node
in <bases> are added to remote after the discovery phase.
If that happens, changegroup() won't send the correct set of nodes, ie.
some nodes will be missing.
To correct it we have to find the set of nodes that both remote and self
have (called <common>), and send all the nodes not in <common>.

This fix has some overhead, in the worst case it will re-send a whole branch.

A proper fix to avoid this overhead might be to change the protocol so that
the <common> nodes are sent (instead of the <bases> of the missing nodes).
2008-10-21 17:00:35 +02:00
Bernhard Leiner
b7e7ab32c3 use the new parseindex implementation C in parsers 2008-10-17 00:24:22 +02:00
Matt Mackall
a1af556eb5 revlog: fix heads performance regression 2008-10-12 15:21:08 -05:00
Sune Foldager
9b5eac039b provide nicer feedback when an unknown node id is passed to a command
Previously, an unknown node id would lead to the following error:
abort: 00changelog.i@343445453433: no node!

All other unknown revision would instead display as:
abort: unknown revision '343445453'!

The former error message has been suppressed in favor of the latter.
2008-10-04 10:14:39 +02:00
Martin Geisler
559197e59b Fixed docstring typos 2008-08-12 13:45:48 +02:00
Adrian Buehlmann
c330a45cd1 revlog: add files method 2008-08-13 20:18:41 -05:00
Stefano Tortarolo
5388b1792f Add ancestors and descendants to revlog
This patch adds two methods to revlog:
- ancestors: given a list of revisions returns their ancestors
- descendants: given a list of revisions return their descendants
2008-07-19 18:19:50 +02:00
Matt Mackall
bc715be859 add __len__ and __iter__ methods to repo and revlog 2008-06-26 14:35:50 -05:00
Alexander Solovyov
6a1b628db8 LookupError should have same __str__ as RevlogError 2008-06-18 16:47:47 +03:00
Alexander Solovyov
1088d84e91 make revlog.LookupError inherit from KeyError
This will improve integration with external applications which depend on
KeyError, which is usually raised by __getitem__ calls.
2008-06-18 12:48:04 +02:00
Peter Arrenbrecht
892bff8c6e drop superfluous param from revlog.addgroup() 2008-06-05 16:25:11 +02:00
Dirkjan Ochtman
34d6bea8db python 2.6 compatibility: compatibility wrappers for hash functions 2008-04-04 22:36:40 +02:00
Alexis S. L. Carvalho
e8bdcfb352 revlog.py: remove extra close()
atomictempfile.rename() already calls close().
2008-03-14 20:01:50 -03:00
Benoit Boissinot
8aa28e9a96 revlog: make sure the files are closed after an exception happens
This prevents a corruption when the writes happen after the truncate
initiated by the transaction rollback.
2008-03-14 22:12:50 +01:00
Matt Mackall
865487e7f2 revlog: report node and file when lookup fails 2008-03-11 17:42:29 -05: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
Alexis S. L. Carvalho
bda2fe75b5 revlog.revision: avoid opening the datafile without need.
If there's no inline data, revlog.revision opens the data file every
time it's called.  This is useful if we're going to call chunk many
times, but, if we're going to call it only once, it's better to let
chunk open the file - if we're lucky, all the data we're going to need
is already cached and we won't need to even look at the file.
2008-02-19 19:20:10 -03:00
Alexis S. L. Carvalho
ba985d288a simplify revlog.strip interface and callers; add docstring
Also, strip files only after the changelog and the manifest.
2008-01-19 18:01:16 -02:00
Alexis S. L. Carvalho
8b35462ec9 strip: calculate list of extra nodes to save and pass it to changegroupsubset
When we remove revision N from the repository, all revisions >= N are
affected: either it's a descendant from N and will also be removed, or
it's not a descendant of N and will be renumbered.

As a consequence, we have to (at least temporarily) remove all filelog
and manifest revisions that have a linkrev >= N, readding some of them
later.

Unfortunately, it's possible to have a revlog with two revisions
r1 and r2 such that r1 < r2, but linkrev(r1) > linkrev(r2).  If we try
to strip revision linkrev(r1) from the repository, we'll also lose
revision r2 when we truncate this revlog.

We already use changegroupsubset to create a temporary changegroup
containing the revisions that have to be restored, but that function is
unable to detect that we also wanted to save the r2 in the case above.

So we manually calculate these extra nodes and pass it to changegroupsubset.

This should fix issue764.
2008-01-19 18:01:16 -02:00
Matt Mackall
ebf85d18e1 util: get rid of is_win_9x wart 2007-12-18 14:01:42 -06:00
Bryan O'Sullivan
d32d6fb57f make LookupError more detailed 2007-11-28 08:36:55 -08:00
Matt Mackall
93267d50c5 revlog: make revlogv0 loading more robust against corruption 2007-11-24 12:13:32 -06:00
Benoit Boissinot
0442ace6c2 fix UnboundLocalError, refactor a bit
bin wasn't defined in all branches (bug introduced in 959d401a1954
2007-10-11 12:16:55 +02:00
Matt Mackall
81a40fb9b2 revlog: break up compression of large deltas
Python's zlib apparently makes an internal copy of strings passed to
compress(). To avoid this, compress strings 1M at a time, then join
them at the end if the result would be smaller than the original.

For initial commits of large but compressible files, this cuts peak
memory usage nearly in half.
2007-10-11 00:46:54 -05:00
Matt Mackall
0804290ab7 revlog: fix caching of buffer objects 2007-10-11 00:46:53 -05:00
Matt Mackall
9d62709a2c revlog: avoid large yields in group()
Split large yields so that the downstream consumer (chunkbuffer) will avoid
some pain when reading ahead.
2007-10-11 00:46:51 -05:00
Matt Mackall
adbffbec3c revlog: reduce memory usage in addgroup
- use a buffer to extract the delta from a chunk
- avoid concatenating to a compressed delta
- use a buffer to directly extra full text from a trivial delta
- delete chunk and delta objects after use
2007-10-11 00:46:47 -05: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
a92b40c2ed revlog: generate trivial deltas against null revision
To avoid extra memory usage and performance issues with large files,
generate a trivial delta header for deltas against the null revision
rather than calling the usual delta generator.

We append the delta header to meta rather than prepending it to data
to avoid a large allocate and copy.
2007-10-03 17:17:27 -05:00
Alexis S. L. Carvalho
07df6adfb5 revlog: fix revlogio.packentry corner case
We want to store version information about the revlog in the first
entry of its index.  The code in packentry was using some heuristics
to detect whether this was the first entry, but these heuristics could
fail in some cases (e.g. rev 0 was empty; rev 1 descends directly from
the nullid and is stored as a delta).

We now give the revision number to packentry to avoid heuristics.
2007-09-26 01:58:45 -03:00
Matt Mackall
1e7f28023a Merge with crew 2007-09-24 12:34:26 -05:00
Patrick Mezard
327e3eb360 revlog: fix inlined revision transaction extra data (issue 749) 2007-09-23 18:24:19 +02:00
Matt Mackall
ccc415d026 revlog: more robust for damaged indexes
- fix flag reporting
- make broken length reporting smarter
2007-09-21 17:14:39 -05:00
Matt Mackall
37cc19c8c5 revlog: localize some fastpath functions 2007-07-26 12:02:58 -05:00
Matt Mackall
eeb8f14a99 revlog: minor chunk speed-up 2007-07-26 12:02:58 -05:00
Matt Mackall
d106fa8150 revlog: minor revdiff reorganization 2007-07-26 12:02:58 -05:00
Matt Mackall
9429a0a390 revlog: move flag checking out of the offset fastpath 2007-07-26 12:02:58 -05:00
Matt Mackall
767bb11dd5 revlog: avoid some unnecessary seek/tell syscalls 2007-07-23 20:44:08 -05:00
Matt Mackall
dd01d60440 lazyparser.findnode: fix typo and s/rfind/find/
There's no reason to use reverse string search and it's slightly slower
2007-07-23 20:44:08 -05:00
Matt Mackall
7292978647 lazyindex: speed up __getitem__
This function is fairly performance sensitive, so we make a couple
ugly tweaks:

- keep all entries packed so we needn't test entry types
- fold index lookup/load into unpack call to eliminate
  local variable setting
2007-07-23 20:44:08 -05:00
Matt Mackall
a68e049384 lazyparser: up the blocksize from 512 bytes to 64k 2007-07-23 20:44:08 -05:00
Matt Mackall
b607d22a05 revlog: implement a fast path for heads 2007-07-23 20:44:08 -05:00
Matt Mackall
cb95c386e8 revlogio: speed up parsing
- precalcuate ending offset
- pull some variables into local scope
- separate inline and out of line code paths
2007-07-23 20:44:08 -05:00
Matt Mackall
8fa2498ebf revlog: eliminate diff and patches functions
call mdiff variants directly
2007-07-23 20:44:08 -05:00
Matt Mackall
9257ef4f4f revlog: speed up chunkcache
- use a reasonable cache size
- avoid an extra copy when we pull in big revs
2007-07-23 20:44:08 -05:00
Matt Mackall
141c035280 revlog: some basic code reordering 2007-07-23 20:44:08 -05:00
Matt Mackall
ff72ed852c revlog: abstract out index entry packing
This lets us remove most of the remaining v0/v1 logic from revlog
2007-07-23 20:44:08 -05:00
Matt Mackall
1f16099cd0 revlog: simplify revlog.__init__
- move stat into io helper
- get rid of self.defversion and self.indexstat
- fold _load into __init__
2007-07-23 20:44:08 -05:00
Matt Mackall
f3686b0a39 revlog: mark cache private 2007-07-23 20:44:08 -05:00
Matt Mackall
9a71ba31c4 revlog: pull chunkcache back into revlog 2007-07-23 20:44:08 -05:00
Matt Mackall
35c14c89a6 revlog: change _inline from a function to a variable 2007-07-23 20:44:08 -05:00
Matt Mackall
b51cdea681 revlog: simplify addrevision
- remove unused defaults for p1, p2, and text
- reduce some if/else
- use better variable names
- remove some extra variables
- remove some obsolete corner tests
- simply first entry handling for revlogng
- simply inline vs outofline writeout
2007-07-23 20:44:08 -05:00
Matt Mackall
0ab56eac5f revlog: some codingstyle cleanups 2007-07-23 20:44:08 -05:00
Matt Mackall
2cb4c11520 revlog: add a magic null revision to our index
We expand our index by one entry so that index[nullrev] points to a
unique entry, the null revision. This naturally eliminates numerous
extra tests in the performance-sensitive index access functions, most
of which are now trivial again.

Adding new entries is now done with insert(-1, e) rather than
append(e).
2007-07-23 20:44:08 -05:00
Matt Mackall
f03d3e07aa revlog: change accesses to index entry elements to use positive offsets 2007-07-23 20:44:08 -05:00
Matt Mackall
04b4378f47 revlog: parse revlogv0 indexes into v1 internally
This lets us eliminate lots of special case code in our
performance-sensitive index accessors.
2007-07-23 20:44:08 -05:00
Matt Mackall
70e7477200 revlog: only allow lazy parsing with revlogng files
This will allow us to store indices in memory in a single entry format
2007-07-23 20:44:08 -05:00
Matt Mackall
214f50b511 revlog: simplify the v1 immediate parser
- read all the data at once (large files are handled by the lazy parser)
- cache the entire file for inline revlogs
- simplify looping
2007-07-23 20:44:08 -05:00
Matt Mackall
3b9167f022 revlog: set the threshold for lazy parsing higher
A typical machine can parse a 1MB index in well under a second
2007-07-23 20:44:08 -05:00
Matt Mackall
1889aee8b0 revlog: simplify the v0 parser 2007-07-23 20:44:07 -05:00
Matt Mackall
e7ef5dc500 revlog: add revlogio interface
This lets us separate the logic for different on-disk revlog formats from
the main revlog logic.
2007-07-23 20:44:07 -05:00
Matt Mackall
2158f34c5f revlog: regroup parsing code 2007-07-23 20:44:07 -05:00
Matt Mackall
d5b7eaa69a revlog: privatize some methods 2007-07-21 16:18:42 -05:00
Matt Mackall
0e54e000c1 revlog: delete unused function makenode 2007-07-21 16:18:24 -05:00
Matt Mackall
9eea27ad83 revlog: raise offset/type helpers to global scope 2007-07-21 16:18:21 -05:00
Thomas Arendsen Hein
2501b7aeac Fix revlog.children so the real children of the null revision can be calculated. 2007-07-03 12:45:33 +02:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
Alexis S. L. Carvalho
ae21f631dc merge with crew-stable 2007-06-04 00:26:53 -03:00
Alexis S. L. Carvalho
f0513bf1bb Also check the index file size when deciding whether to reload a revlog.
This should fix some spurious failures from test-clone-pull-corruption
(issue552).
2007-06-04 00:24:48 -03:00
Alexis S. L. Carvalho
047c4b002b Merge with crew-stable. 2007-04-07 04:45:27 -03:00
Alexis S. L. Carvalho
b98b34fc2e revlog.py: fix/tweak read ahead code in lazyparser 2007-04-07 04:27:55 -03:00
Matt Mackall
746c62bff7 Fixups for recent changes in revlog version handling 2007-04-02 14:16:44 -05:00
Thomas Arendsen Hein
c0c7def517 Fixed spacing in assignment of REVLOG_DEFAULT_VERSION 2007-03-24 13:31:43 +01: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
Matt Mackall
29e8301c27 Merge with stable 2007-03-15 18:57:47 -05:00
Matt Mackall
e33842c05f revlog: attempt to gracefully handle some interleaved damage 2007-03-15 18:38:46 -05:00
Brendan Cully
53a62dfb33 lazyindex: handle __delitem__ in loadblock 2007-02-04 16:08:56 -08:00
Brendan Cully
8a6eea2483 Add revlog.LookupError exception, and use it instead of RevlogError.
Remove repo.LookupError, which devolves to the revlog version.
2006-12-18 12:22:43 -08:00
Matt Mackall
887599574c Sync with -stable 2006-12-17 21:48:22 -06:00
Benoit Boissinot
fc997dfbf2 fix calculation of new heads added during push with -r
fix issue450
2006-12-17 05:00:22 +01: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
Thomas Arendsen Hein
aaa1f20f5a Use unsigned version format.
This way can use one additional bit, and when encountering invalid revlogs
with the first bit set don't produce python warnings or strange error messages.
2006-12-01 23:27:53 +01:00
Thomas Arendsen Hein
d279e55ca0 Improve error message for unknown revlog flags.
Old: unknown flags 120000 for ...
New: unknown flags 0x0012 for ...
2006-12-01 23:16:12 +01:00
Matt Mackall
b4165617fe Make revlog error slightly less scary 2006-12-01 02:24:56 -06:00
Matt Mackall
9c3965d552 add docstring to reachable 2006-11-19 16:32:36 -06:00
Thomas Arendsen Hein
d3c6666f73 Indentation cleanups for 16c127c30658. 2006-11-19 16:09:04 +01:00
Marcos Chaves
794888ecba fix warnings generated by pygettext.py. 2006-11-18 17:20:38 -02:00
Matt Mackall
aa97044b36 revlog: reachable actually takes a node 2006-11-13 13:26:57 -06:00
Benoit Boissinot
46893fed9e revlog: more nullrev fixes 2006-10-29 16:14:55 +01:00
Benoit Boissinot
a0c2a353ec revlog: return 0 as offset for nullid 2006-10-29 16:14:02 +01:00
Benoit Boissinot
a2d320e112 revlog.size() fix handling of rev == -1 2006-10-29 14:41:14 +01:00
Thomas Arendsen Hein
687e4a7111 Define and use nullrev (revision of nullid) instead of -1. 2006-10-29 10:53:51 +01:00
Alexis S. L. Carvalho
7342f50f68 revlog.py: always return tuples from parents and parentrevs
There's at least one place doing parentrevs(rev) != (rev-1, -1),
which is always true with revlog v0, since parentrevs returns a list
in this case.
2006-10-24 23:00:43 -03:00
Matt Mackall
49503fb772 Merge with crew 2006-10-24 13:46:04 -05:00
Benoit Boissinot
7c004b60e9 fix errors spotted by pychecker 2006-10-19 16:55:34 +02:00
Benoit Boissinot
1bccbf1e1e revlog.children: use parentrevs instead of parents 2006-10-19 10:23:27 +02:00
Matt Mackall
4a6017f8e8 Only look up tags and branches as a last resort 2006-10-18 11:44:56 -05:00
Matt Mackall
833cdcbbe2 revlog.lookup tweaks
- fast path for binary node ids
- direct lookup for full hex ids
- silly change to bin_id
2006-10-17 22:07:54 -05:00
Alexis S. L. Carvalho
54c70682e5 make revlog.addgroup pass its file handles to addrevision
This should fix issue255.

It looks like the problem there happens when addgroup calls addrevision
to add a full revision, and addrevision decides to split the index file
into a .i/.d pair.  Since addgroup has an open file handle for the
index file, the renaming of the new .i file to its final name fails on
windows.
2006-10-14 18:47:48 -03:00
Benoit Boissinot
a1bd76f99b nodesbetween: fix a bug with duplicate heads 2006-10-12 11:40:26 +02:00
Brendan Cully
65be154af0 Teach bdiff to support buffer objects
manifest.add gives revlog.addrevision a buffer object, which may
be cached and used for a second call in the same session (as mq does
when pushing multiple patches). The other option would be to cast the
buffer to str when caching it.
2006-10-11 12:06:14 -07:00
Benoit Boissinot
00efcc68ba correctly find the type of 'id' in revlog.lookup 2006-09-30 15:15:59 +02:00
Benoit Boissinot
445628dbea optimize revlog.lookup when passed hex(node)[:...]
Instead of converting each node from the filenode to a hex form,
convert the arg to a bin form.
For a revlog with 26711 entries, doing 100 lookup:
before: ~18s
after : ~13s
2006-09-24 13:52:27 +02:00
Benoit Boissinot
1dc0baf068 cleanups in revlog.lookup
- add comments
- do a clean separation of the different cases
- don't use a list of each possible node when
  doing the lookup, just keep the previous entry
2006-09-24 13:52:25 +02:00