690
692
revision=revision, verbose=verbose, plain_format=plain,
691
693
rewrite_tags=rewrite_tag_names, baseline=baseline)
692
694
return exporter.run()
695
class cmd_fast_export_from_cvs(Command):
696
"""Generate a fast-import file from a CVS repository.
698
Destination is a dump file, typically named xxx.fi where xxx is
699
the name of the project. If '-' is given, standard output is used.
701
cvs2svn 2.3 or later must be installed as its cvs2bzr script is used
702
under the covers to do the export.
704
The source must be the path on your filesystem to the part of the
705
repository you wish to convert. i.e. either that path or a parent
706
directory must contain a CVSROOT subdirectory. The path may point to
707
either the top of a repository or to a path within it. In the latter
708
case, only that project within the repository will be converted.
711
Remote access to the repository is not sufficient - the path
712
must point into a copy of the repository itself. See
713
http://cvs2svn.tigris.org/faq.html#repoaccess for instructions
714
on how to clone a remote CVS repository locally.
716
By default, the trunk, branches and tags are all exported. If you
717
only want the trunk, use the `--trunk-only` option.
719
By default, filenames, log messages and author names are expected
720
to be encoded in ascii. Use the `--encoding` option to specify an
721
alternative. If multiple encodings are used, specify the option
722
multiple times. For a list of valid encoding names, see
723
http://docs.python.org/lib/standard-encodings.html.
725
Windows users need to install GNU sort and use the `--sort`
726
option to specify its location. GNU sort can be downloaded from
727
http://unxutils.sourceforge.net/.
730
_see_also = ['fast-import', 'fast-import-filter']
731
takes_args = ['source', 'destination']
732
takes_options = ['verbose',
734
help="Export just the trunk, ignoring tags and branches."
736
ListOption('encoding', type=str, argname='CODEC',
737
help="Encoding used for filenames, commit messages "
738
"and author names if not ascii."
740
Option('sort', type=str, argname='PATH',
741
help="GNU sort program location if not on the path."
744
encoding_type = 'exact'
745
def run(self, source, destination, verbose=False, trunk_only=False,
746
encoding=None, sort=None):
748
from bzrlib.plugins.fastimport.exporters import fast_export_from
751
custom.append("--trunk-only")
754
custom.extend(['--encoding', enc])
756
custom.extend(['--sort', sort])
757
fast_export_from(source, destination, 'cvs', verbose, custom)
760
class cmd_fast_export_from_darcs(Command):
761
"""Generate a fast-import file from a Darcs repository.
763
Destination is a dump file, typically named xxx.fi where xxx is
764
the name of the project. If '-' is given, standard output is used.
766
Darcs 2.2 or later must be installed as various subcommands are
767
used to access the source repository. The source may be a network
768
URL but using a local URL is recommended for performance reasons.
771
_see_also = ['fast-import', 'fast-import-filter']
772
takes_args = ['source', 'destination']
773
takes_options = ['verbose',
774
Option('encoding', type=str, argname='CODEC',
775
help="Encoding used for commit messages if not utf-8."
778
encoding_type = 'exact'
779
def run(self, source, destination, verbose=False, encoding=None):
780
from bzrlib.plugins.fastimport.exporters import fast_export_from
782
if encoding is not None:
783
custom = ['--encoding', encoding]
784
fast_export_from(source, destination, 'darcs', verbose, custom)
787
class cmd_fast_export_from_hg(Command):
788
"""Generate a fast-import file from a Mercurial repository.
790
Destination is a dump file, typically named xxx.fi where xxx is
791
the name of the project. If '-' is given, standard output is used.
793
Mercurial 1.2 or later must be installed as its libraries are used
794
to access the source repository. Given the APIs currently used,
795
the source repository must be a local file, not a network URL.
798
_see_also = ['fast-import', 'fast-import-filter']
799
takes_args = ['source', 'destination']
800
takes_options = ['verbose']
801
encoding_type = 'exact'
802
def run(self, source, destination, verbose=False):
804
from bzrlib.plugins.fastimport.exporters import fast_export_from
805
fast_export_from(source, destination, 'hg', verbose)
808
class cmd_fast_export_from_git(Command):
809
"""Generate a fast-import file from a Git repository.
811
Destination is a dump file, typically named xxx.fi where xxx is
812
the name of the project. If '-' is given, standard output is used.
814
Git 1.6 or later must be installed as the git fast-export
815
subcommand is used under the covers to generate the stream.
816
The source must be a local directory.
820
Earlier versions of Git may also work fine but are
821
likely to receive less active support if problems arise.
824
_see_also = ['fast-import', 'fast-import-filter']
825
takes_args = ['source', 'destination']
826
takes_options = ['verbose']
827
encoding_type = 'exact'
828
def run(self, source, destination, verbose=False):
830
from bzrlib.plugins.fastimport.exporters import fast_export_from
831
fast_export_from(source, destination, 'git', verbose)
834
class cmd_fast_export_from_mtn(Command):
835
"""Generate a fast-import file from a Monotone repository.
837
Destination is a dump file, typically named xxx.fi where xxx is
838
the name of the project. If '-' is given, standard output is used.
840
Monotone 0.43 or later must be installed as the mtn git_export
841
subcommand is used under the covers to generate the stream.
842
The source must be a local directory.
845
_see_also = ['fast-import', 'fast-import-filter']
846
takes_args = ['source', 'destination']
847
takes_options = ['verbose']
848
encoding_type = 'exact'
849
def run(self, source, destination, verbose=False):
851
from bzrlib.plugins.fastimport.exporters import fast_export_from
852
fast_export_from(source, destination, 'mtn', verbose)
855
class cmd_fast_export_from_p4(Command):
856
"""Generate a fast-import file from a Perforce repository.
858
Source is a Perforce depot path, e.g., //depot/project
860
Destination is a dump file, typically named xxx.fi where xxx is
861
the name of the project. If '-' is given, standard output is used.
863
bzrp4 must be installed as its p4_fast_export.py module is used under
864
the covers to do the export. bzrp4 can be downloaded from
865
https://launchpad.net/bzrp4/.
867
The P4PORT environment variable must be set, and you must be logged
868
into the Perforce server.
870
By default, only the HEAD changelist is exported. To export all
871
changelists, append '@all' to the source. To export a revision range,
872
append a comma-delimited pair of changelist numbers to the source,
876
_see_also = ['fast-import', 'fast-import-filter']
877
takes_args = ['source', 'destination']
879
encoding_type = 'exact'
880
def run(self, source, destination, verbose=False):
882
from bzrlib.plugins.fastimport.exporters import fast_export_from
884
fast_export_from(source, destination, 'p4', verbose, custom)
887
class cmd_fast_export_from_svn(Command):
888
"""Generate a fast-import file from a Subversion repository.
890
Destination is a dump file, typically named xxx.fi where xxx is
891
the name of the project. If '-' is given, standard output is used.
893
Python-Subversion (Python bindings to the Subversion APIs)
894
1.4 or later must be installed as this library is used to
895
access the source repository. The source may be a network URL
896
but using a local URL is recommended for performance reasons.
899
_see_also = ['fast-import', 'fast-import-filter']
900
takes_args = ['source', 'destination']
901
takes_options = ['verbose',
902
Option('trunk-path', type=str, argname="STR",
903
help="Path in repo to /trunk.\n"
904
"May be `regex:/cvs/(trunk)/proj1/(.*)` in "
905
"which case the first group is used as the "
906
"branch name and the second group is used "
910
encoding_type = 'exact'
911
def run(self, source, destination, verbose=False, trunk_path=None):
913
from bzrlib.plugins.fastimport.exporters import fast_export_from
915
if trunk_path is not None:
916
custom.extend(['--trunk-path', trunk_path])
917
fast_export_from(source, destination, 'svn', verbose, custom)