Commit Graph

5540 Commits

Author SHA1 Message Date
Alexis S. L. Carvalho
4bc9e33d0e convert: add a mode where mercurial_sink skips empty revisions.
The getchanges function of some converter_source classes can return
some false positives.  I.e. they sometimes claim that a file "foo"
was changed in some revision, even though its contents are still the
same.

convert_svn is particularly bad, but I think this can also happen with
convert_cvs and, at least in theory, with mercurial_source.

For regular conversions this is not really a problem - as long as
getfile returns the right contents, we'll get a converted revision
with the right contents.  But when we use --filemap, this could lead
to superfluous revisions being converted.

Instead of fixing every converter_source, I decided to change
mercurial_sink to work around this problem.

When --filemap is used, we're interested only in revisions that touch
some specific files.  If a revision doesn't change any of these files,
then we're not interested in it (at least for revisions with a single
parent; merges are special).

For mercurial_sink, we abuse this property and rollback a commit if
the manifest text hasn't changed.  This avoids duplicating the logic
from localrepo.filecommit to detect unchanged files.
2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
8978438d64 convert: readd --filemap
To handle merges correctly, this revision adds a filemap_source class
that wraps a converter_source and does the work necessary to calculate
the subgraph we're interested in.

The wrapped converter_source must provide a new getchangedfiles method
that, given a revision rev, and an index N, returns the list of files
that are different in rev and its Nth parent.

The implementation depends on the ability to skip some revisions and to
change the parents field of the commit objects that we returned earlier.

To make the conversion restartable, we assume the revisons in the
revmapfile are topologically sorted.
2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
ab0d9013c0 convert: move filemapper class to a separate file 2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
9ca59573cc convert: disable current --filemap support
The --filemap support in hg convert doesn't handle merges correctly.
(And after 98d1e8c16343 I managed to break it even for simple cases
where we don't want the first revision.)
2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
10150a4dc3 convert: allow the converter_source to say "skip this revision"
If getchanges returns a string, it's assumed to be the id of an
already converted revision.  We map the current revision to the same
revision this converted revision was mapped to.

To allow skipping a root revision, getchanges can return the special
string 'hg-convert-skipped-revision' (a.k.a. common.SKIPREV), which
hopefully won't clash with any real id.

The converter_source is responsible for rewriting the parents of the
commit objects to make sure the revision graph makes sense.
2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
af43e5bffa convert: pass the order of the revmapfile to the converter_source
The entries in this file are supposed to be topologically sorted and
this may be useful for a converter_source.
2007-10-04 23:21:37 -03:00
Matt Mackall
24f40f64eb Merge with crew 2007-10-04 19:47:22 -05:00
Matt Mackall
3f58de820d merge: add debug diagnostics for findcopies 2007-10-04 19:44:37 -05:00
Patrick Mezard
755593a7fa Merge with crew-stable 2007-10-04 14:26:34 +02: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
Matt Mackall
a6cf90f286 Merge with crew 2007-10-03 16:50:32 -05:00
Patrick Mezard
01d91ed943 Merge with crew-stable 2007-10-03 21:08:37 +02:00
Bryan O'Sullivan
417886f00a Merge with crew 2007-10-02 21:01:00 -07:00
Bryan O'Sullivan
028f525b88 convert: fix a few residual bugs in darcs importer 2007-10-02 21:00:38 -07:00
Matt Mackall
93b72e820b Merge with crew 2007-10-02 18:04:18 -05:00
Bryan O'Sullivan
5e33599d0f Merge with crew. 2007-10-02 13:49:36 -07:00
Bryan O'Sullivan
ecdd764817 convert: support darcs as a source repo 2007-10-02 13:49:11 -07:00
Bryan O'Sullivan
3ba6252dc7 convert: fail properly if we can't read a source hg repository 2007-10-02 13:48:52 -07:00
Bryan O'Sullivan
65b17f114c util: add default argument to strdate 2007-10-02 13:46:59 -07:00
Bryan O'Sullivan
57e084bf32 convert: add before/after hooks for converter sources 2007-10-02 13:46:17 -07:00
Benoit Boissinot
7cf891935c merge with -stable 2007-10-02 20:25:35 +02:00
Patrick Mezard
2b0b08ada6 Merge with crew-stable 2007-09-30 16:38:42 +02:00
Patrick Mezard
091596b961 Merge with crew-stable 2007-09-30 12:36:11 +02:00
Bryan O'Sullivan
cfd6f17898 Merge with crew-stable. 2007-09-29 21:10:54 -07:00
Bryan O'Sullivan
cf0914fc76 Merge with crew. 2007-09-29 20:55:36 -07:00
Matt Mackall
2a7d5cc815 bdiff: switch to lyhash
lyhash is a very simple and fast hash function that had the fewest
hash collisions on a 3.9M line text corpus and 190k line binary corpus
and should have significantly fewer collisions than the current hash
function.
2007-09-27 23:59:18 -05:00
Matt Mackall
4c16d712e6 bdiff: use INT_MAX to avoid some inner loop comparisons 2007-09-27 23:59:02 -05:00
Christoph Spiel
49d1dc563c bdiff: simple splitlines optimization 2007-09-27 23:58:54 -05:00
Christoph Spiel
52ef4eacce I have spotted the biggest bottleneck in "bdiff.c". Actually it was
pretty easy to find after I recompiled the python interpreter and
mercurial for profiling.

In "bdiff.c" function "equatelines" allocates the minimum hash table
size, which can lead to tons of collisions. I introduced an
"overcommit" factor of 16, this is, I allocate 16 times more memory
than the minimum value. Overcommiting 128 times does not improve the
performance over the 16-times case.
2007-09-27 23:57:57 -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
Dirkjan Ochtman
7b9cb3b6fc Don't try to determine interactivity if ui() called with interactive=False.
WSGI applications are not supposed to refer to sys.stdin. In af5aceab19f4,
hgweb and hgwebdir were fixed to pass interactive=False to their ui()'s, but
sys.stdin.isatty() was still called by the ui objects. This change makes sure
only the ui.fixconfig() method will call ui.isatty() (by making the
ui._readline() method, which is currently only called from ui.prompt(),
private). ui.fixconfig() is changed to let config files override the initial
interactivity setting, but not check isatty() if interactive=False was
specified in the creation of the ui.
2007-09-25 19:05:34 +02:00
Alexis S. L. Carvalho
ddf41e005d Merge with crew-stable 2007-09-24 19:14:18 -03:00
Matt Mackall
28d6a9f074 manifest: minor performance tweak 2007-09-24 12:42:25 -05:00
Matt Mackall
b7b5c1ade9 dirstate: speed up read and write
read:
- single call to len(st)
- fewer assignments for position tracking
- don't split apart tuple from unpack
- use a literal for the unpack spec

write:
- localize variables and functions
- avoid copied function call
- use % for string concatenation
2007-09-24 12:41:54 -05:00
Matt Mackall
c79b6cded5 dirstate: make dir collision logic faster
- shortcircuit decpath if we haven't built the _dirs map
- increment only for leafnodes of directory tree
  (this should make construction more like O(nlog n) than O(n^2))
2007-09-24 12:36:38 -05: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
Patrick Mezard
c6d86b7b87 Merge with crew-stable 2007-09-23 15:29:58 +02:00
Patrick Mezard
e735e01dae bisect: remove useless try/except 2007-09-22 19:05:36 +02:00
Patrick Mezard
f770ac70cd Merge with crew-stable 2007-09-22 18:56:36 +02:00
Benoit Boissinot
2c52922666 bisect: don't write data on failure 2007-09-22 18:35:53 +02:00
Benoit Boissinot
5d47e0ef5a bisect: do silent init if necessary 2007-09-22 18:23:56 +02:00
Matt Mackall
e8a1dfd594 convert-cvs: update test to pass on Linux 2007-09-21 17:25:25 -05:00
Matt Mackall
e38e06ffb3 verify: report first bad changeset
- add linkrev and file arguments to err
- track lowest reported linkrev in err
- find linkrev in a couple cases
- sort linkrevs when reporting a bunch of errors against a file
- tidy up lots of messages
- make more robust against damaged indexes
- report first bad changeset if an error is encountered
2007-09-21 17:18:06 -05: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
44c4641c5d debugindex: more robust for damaged indexes 2007-09-21 17:13:38 -05:00
Patrick Mezard
f54216b36e debuginstall: stop looking for patch utility, just test it 2007-09-15 16:07:05 +02:00
Brendan Cully
04f2479b21 Updated zsh completion from issue722. 2007-09-14 21:47:40 -07:00
Patrick Mezard
d24e36a450 Merge with crew-stable 2007-09-14 23:10:41 +02:00