~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branchbuilder.py

  • Committer: Robert Collins
  • Date: 2007-04-27 06:16:29 UTC
  • mto: (2495.3.1 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 2498.
  • Revision ID: robertc@robertcollins.net-20070427061629-hqnq6rocm9dgljhx
Add a format parameter to BranchBuilder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
      branch = builder.get_branch()
35
35
    """
36
36
 
37
 
    def __init__(self, transport):
 
37
    def __init__(self, transport, format=None):
38
38
        """Construct a BranchBuilder on transport.
39
39
        
40
40
        :param transport: The transport the branch should be created on.
41
41
            If the path of the transport does not exist but its parent does
42
42
            it will be created.
 
43
        :param format: The name of a format in the bzrdir format registry
 
44
            for the branch to be built.
43
45
        """
44
46
        if not transport.has('.'):
45
47
            transport.mkdir('.')
 
48
        if format is None:
 
49
            format = 'default'
46
50
        self._branch = bzrdir.BzrDir.create_branch_convenience(transport.base,
47
 
            format=bzrdir.format_registry.make_bzrdir('default'))
 
51
            format=bzrdir.format_registry.make_bzrdir(format))
48
52
 
49
53
    def build_commit(self):
50
54
        """Build a commit on the branch."""