Commit Graph

187 Commits

Author SHA1 Message Date
Alexis S. L. Carvalho
fe9d865e0d convert: display all errors if we couldn't open the source repo
This should give the user a better hint of what's going wrong.

Improve some error messages.  In particular, mention "CVS checkout" instead
of "CVS repo".

Fixes issue822 and issue826.
2007-11-09 20:21:35 -02:00
Alexis S. L. Carvalho
959d3f5cd4 test-convert-darcs: skip if we can't find the elementtree module
This patch is a bit dirty to avoid having to repeat the dance required
to import elementtree.
2007-11-09 20:21:35 -02:00
Benoit Boissinot
37290329f4 fix typo in convert help text, update test 2007-11-05 20:15:33 +01:00
Rafael Villar Burke ext:(%22)
163660fdbe Update convert help text
Add Mercurial as a source format, clarify that the include directive triggers the exclusion of all not explicitely included files/dirs and use MAPFILE instead of revmapfile in the text, following the short message convention.
2007-11-02 20:09:21 +01:00
Patrick Mezard
6aa1e21320 Fix Windows os.popen bug with interleaved stdout/stderr output
See python bug 1366 "popen spawned process may not write to stdout under windows" for more details.
2007-11-01 12:05:14 +01:00
Kirill Smelkov
c46ae95f3f convert: svn -- fix tags handling
They were simply not detected.
2007-10-13 15:25:11 +04:00
Kirill Smelkov
87c2048488 convert: svn -- fix 'exists'
Previously 'exists' erroneously returned False for empty dirictories. This is
wrong since we want to detect even empty 'branches/' or 'tags/'.
2007-10-13 15:22:03 +04:00
Bryan O'Sullivan
0ec99ed035 convert: refactor sink initialisation, to remove hardcoding of hg
We also introduce options to explicitly set the source and destination
repository types.

Improve testing of corner cases a little.
2007-10-10 15:42:00 -07:00
Bryan O'Sullivan
1264846224 convert: add default constructor for converter_sink 2007-10-10 15:30:00 -07:00
Bryan O'Sullivan
6df62fb77c convert: make contents of "extra" dict available from sources, for sinks.
This breaks hash preservation for hg->hg conversion, as each converted
change gets a convert_revision item added to its extra dict.  Ugh.
2007-10-10 15:30:00 -07:00
Bryan O'Sullivan
31308e92ec convert: rename convert_svn to svn_source 2007-10-10 15:30:00 -07:00
Bryan O'Sullivan
27bb37764f convert: report errors more meaningfully if run with --traceback 2007-10-10 00:15:33 -07:00
Benoit Boissinot
8905e2628f convert: do not output when trying to load svn bindings 2007-10-07 20:45:10 +02:00
Benoit Boissinot
7120a66c0d convert: split converters into sink/source 2007-10-07 20:44:54 +02:00
Patrick Mezard
99fd23e158 convert: fix darcs_source.pull() under windows 2007-10-07 18:59:03 +02:00
Patrick Mezard
fec1f9ad02 convert: fix darcs_source._run() under windows 2007-10-07 18:58:54 +02:00
Patrick Mezard
2d81806ba5 convert: quote "^" to avoid windows using it as an escape char. 2007-10-06 21:19:06 +02:00
Alexis S. L. Carvalho
5a20fc9e55 mercurial_sink: regrab locks in setbranch 2007-10-06 15:30:15 -03:00
Alexis S. L. Carvalho
856d368557 convert --filemap: reduce memory usage 2007-10-06 15:30:15 -03:00
Alexis S. L. Carvalho
f377d00047 convert: change SKIPREV to 'SKIP' 2007-10-06 15:30:15 -03:00
Alexis S. L. Carvalho
a305a3e419 convert_svn: add --filemap support 2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
df6f43b4df convert_cvs: add --filemap support 2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
b7d48206ca convert_git: add --filemap support 2007-10-04 23:21:37 -03:00
Alexis S. L. Carvalho
f951bc5803 mercurial_source: add --filemap support 2007-10-04 23:21:37 -03:00
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
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
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
57e084bf32 convert: add before/after hooks for converter sources 2007-10-02 13:46:17 -07:00
Patrick Mezard
091596b961 Merge with crew-stable 2007-09-30 12:36:11 +02:00
Patrick Mezard
12ec5fa979 convert: fix missing import 2007-09-30 12:08:33 +02:00
Bryan O'Sullivan
cfd6f17898 Merge with crew-stable. 2007-09-29 21:10:54 -07:00
Bryan O'Sullivan
4f30385a85 convert: delete empty directories if deleting a file (bug 754) 2007-09-29 21:08:14 -07:00
Alexis S. L. Carvalho
ddf41e005d Merge with crew-stable 2007-09-24 19:14:18 -03:00
Alexis S. L. Carvalho
6f75c91b5f convert_git: avoid returning two entries for the same file in getchanges
This could happen in merge changesets if the merged file was different
from both parents.
2007-09-24 19:00:11 -03:00
Patrick Mezard
d24e36a450 Merge with crew-stable 2007-09-14 23:10:41 +02:00
Patrick Mezard
8577cf36be convert: workaround for cvsps.cache under Windows
In non-cygwin environment, cvsps fails to create its cache directory and redirect its output to stderr. Just ignore the error and capture stderr as well.
2007-09-14 22:17:53 +02:00
Patrick Mezard
7d74b8608f convert: fix remote cvs file paths separator 2007-09-14 22:17:53 +02:00
Patrick Mezard
fc230fc7bd convert: avoid interpreting Windows path as CVS connection strings.
CVS connection strings regexp detect colons to separate protocols from path and login. Unfortunately, Windows paths contains colons and were interpreted as rsh connection strings.
2007-09-14 22:17:53 +02:00
Patrick Mezard
93f1b14c12 convert: call popen2 in binary mode, with a command string. 2007-09-14 22:17:53 +02:00
Thomas Arendsen Hein
0b6d82e138 Don't decode unicode strings.
This does not work with python2.3 and is probably not useful anyway with 2.4.
2007-09-07 16:14:51 +02:00
Alexis S. L. Carvalho
2442d0db1e convert: rename a class and a function 2007-09-01 02:49:18 -03:00
Alexis S. L. Carvalho
7dac6f1262 convert: mercurial_source: also search for copies in modified files
There are some corner cases where we may have a copy in a file that
isn't in the added list:

- the result of a hg copy --after --force

- after a merge across a (local) rename
2007-09-01 02:49:18 -03:00