diff options
author | Ian Clatworthy <ian.clatworthy@canonical.com> | 2009-08-28 00:20:00 +1000 |
---|---|---|
committer | Ian Clatworthy <ian.clatworthy@canonical.com> | 2009-08-28 00:20:00 +1000 |
commit | 8608c83089b110c0a7662734b66e35329c88cd1e (patch) | |
tree | 35ad3f7cd8de327cbb83572527a24493bcf93f65 /__init__.py | |
parent | a1462cd6591e0f69a4e9c79240ace96c1bfda4f2 (diff) | |
download | bzr-fastimport-8608c83089b110c0a7662734b66e35329c88cd1e.tar.gz |
add --plain option to fast-export
Diffstat (limited to '__init__.py')
-rw-r--r-- | __init__.py | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/__init__.py b/__init__.py index 9334098..e39a590 100644 --- a/__init__.py +++ b/__init__.py @@ -515,14 +515,48 @@ class cmd_fast_import_query(Command): class cmd_fast_export(Command): """Generate a fast-import stream from a Bazaar branch. - This program generates a stream from a bzr branch in the format - required by git-fast-import(1). It preserves merges correctly, - even merged branches with no common history (`bzr merge -r 0..-1`). + This program generates a stream from a Bazaar branch in fast-import + format used by tools such as bzr fast-import, git-fast-import and + hg-fast-import. If no destination is given or the destination is '-', standard output is used. Otherwise, the destination is the name of a file. If the destination ends in '.gz', the output will be compressed into gzip format. + + :Round-tripping: + + Recent versions of the fast-import specfication support features + that allow effective round-tripping of many Bazaar branches. As + such, fast-exporting a branch and fast-importing the data produced + will create a new repository with equivalent history, i.e. + "bzr log -v -p --include-merges" on the old branch and new branch + should produce similar, if not identical, results. + + .. note:: + + Be aware that the new repository may appear to have similar history + but internally it is quite different with new revision-ids and + file-ids assigned. As a consequence, the ability to easily merge + with branches based on the old repository is lost. Depending on your + reasons for producing a new repository, this may or may not be an + issue. + + :Interoperability: + + By default, fast-export uses the following "extended features" to + produce a richer data stream: + + * *multiple-authors* - if a commit has multiple authors (as commonly + occurs in pair-programming), all authors will be included in the + output, not just the first author + + * *commit-properties* - custom metadata per commit that Bazaar stores + in revision properties (e.g. branch-nick and bugs fixed by this + change) will be included in the output. + + To disable these features and produce output acceptable to git 1.6, + use the --plain option. :Examples: @@ -559,12 +593,16 @@ class cmd_fast_export(Command): Option('export-marks', type=str, argname='FILE', help="Export marks to file." ), + Option('plain', + help="Exclude metadata to maximise interoperability." + ), ] aliases = [] encoding_type = 'exact' def run(self, source, destination=None, verbose=False, git_branch="master", checkpoint=10000, marks=None, - import_marks=None, export_marks=None, revision=None): + import_marks=None, export_marks=None, revision=None, + plain=False): from bzrlib.plugins.fastimport import bzr_exporter if marks: @@ -573,7 +611,7 @@ class cmd_fast_export(Command): destination=destination, git_branch=git_branch, checkpoint=checkpoint, import_marks_file=import_marks, export_marks_file=export_marks, - revision=revision, verbose=verbose) + revision=revision, verbose=verbose, plain_format=plain) return exporter.run() |