~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Aaron Bentley
  • Date: 2006-03-17 07:09:40 UTC
  • mto: This revision was merged to the branch mainline in revision 1617.
  • Revision ID: aaron.bentley@utoronto.ca-20060317070940-df789963405ca005
Init command can produce sharing branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
            return self.create_repository()
217
217
        
218
218
    @staticmethod
219
 
    def create_branch_convenience(base, force_new_repo=False, force_new_tree=None):
 
219
    def create_branch_convenience(base, force_new_repo=False,
 
220
                                  force_new_tree=None, format=None):
220
221
        """Create a new BzrDir, Branch and Repository at the url 'base'.
221
222
 
222
223
        This is a convenience function - it will use an existing repository
238
239
        :param force_new_repo: If True a new repository is always created.
239
240
        :param force_new_tree: If True or False force creation of a tree or 
240
241
                               prevent such creation respectively.
 
242
        :param format: Override for the for the bzrdir format to create
241
243
        """
242
244
        if force_new_tree:
243
245
            # check for non local urls
244
246
            t = get_transport(safe_unicode(base))
245
247
            if not isinstance(t, LocalTransport):
246
248
                raise errors.NotLocalUrl(base)
247
 
        bzrdir = BzrDir.create(base)
 
249
        if format is None:
 
250
            bzrdir = BzrDir.create(base)
 
251
        else:
 
252
            bzrdir = format.initialize(base)
248
253
        repo = bzrdir._find_or_create_repository(force_new_repo)
249
254
        result = bzrdir.create_branch()
250
255
        if force_new_tree or (repo.make_working_trees() and