~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

Merge bzr.dev

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 
530
535
            source_branch.sprout(result, revision_id=revision_id)
531
536
        else:
532
537
            result.create_branch()
533
 
        result.create_workingtree()
 
538
        if result_repo is None or result_repo.make_working_trees():
 
539
            result.create_workingtree()
534
540
        return result
535
541
 
536
542
 
1469
1475
            w = Weave(file_id)
1470
1476
            self.text_weaves[file_id] = w
1471
1477
        text_changed = False
1472
 
        previous_entries = ie.find_previous_heads(parent_invs, w)
 
1478
        previous_entries = ie.find_previous_heads(parent_invs,
 
1479
                                                  None,
 
1480
                                                  None,
 
1481
                                                  entry_vf=w)
1473
1482
        for old_revision in previous_entries:
1474
1483
                # if this fails, its a ghost ?
1475
1484
                assert old_revision in self.converted_revs