Document changes made since last edit of CHANGES.
[cvs2svn.git] / cvs2svn_lib / bzr_output_option.py
blob28061022718eab0dae019fd417c48b5de16fa5f6
1 # (Be in -*- python -*- mode.)
3 # ====================================================================
4 # Copyright (c) 2009 CollabNet. All rights reserved.
6 # This software is licensed as described in the file COPYING, which
7 # you should have received as part of this distribution. The terms
8 # are also available at http://subversion.tigris.org/license-1.html.
9 # If newer versions of this license are posted there, you may use a
10 # newer version instead, at your option.
12 # This software consists of voluntary contributions made by many
13 # individuals. For exact contribution history, see the revision
14 # history and logs, available at http://cvs2svn.tigris.org/.
15 # ====================================================================
17 """Classes for outputting the converted repository to bzr.
19 Relies heavily on the support for outputting to git, with a few tweaks to make
20 the dialect of the fast-import file more suited to bzr.
22 """
24 from cvs2svn_lib.git_output_option import GitOutputOption
25 from cvs2svn_lib.symbol import Trunk
28 class BzrOutputOption(GitOutputOption):
29 """An OutputOption that outputs to a git-fast-import formatted file, in a
30 dialect more suited to bzr.
31 """
33 name = "Bzr"
35 def __init__(
36 self, dump_filename, revision_writer,
37 author_transforms=None,
38 tie_tag_fixup_branches=True,
40 """Constructor.
42 See superclass for meaning of parameters.
43 """
44 GitOutputOption.__init__(self, dump_filename, revision_writer,
45 author_transforms, tie_tag_fixup_branches)
47 def get_tag_fixup_branch_name(self, svn_commit):
48 # Use a name containing '.', which is not allowed in CVS symbols, to avoid
49 # conflicts (though of course a conflict could still result if the user
50 # requests symbol transformations).
51 return 'refs/heads/tag-fixup.%s' % svn_commit.symbol.name
53 def describe_lod_to_user(self, lod):
54 """This needs to make sense to users of the fastimported result."""
55 # This sort of needs to replicate the entire branch name mapping logic from
56 # bzr-fastimport :-/
57 if isinstance(lod, Trunk):
58 return 'trunk'
59 else:
60 return lod.name