~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Fix remaining uses of deprecated apis within bzrlib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
393
393
        if revno < 1 or revno > self.revno():
394
394
            raise InvalidRevisionNumber(revno)
395
395
        
396
 
    def clone(self, to_location, revision=None, basis_branch=None, to_branch_type=None):
 
396
    def clone(self, to_location, revision=None, basis_branch=None, to_branch_format=None):
397
397
        """Copy this branch into the existing directory to_location.
398
398
 
399
399
        Returns the newly created branch object.
418
418
        assert isinstance(to_location, basestring)
419
419
        if not bzrlib.osutils.lexists(to_location):
420
420
            os.mkdir(to_location)
421
 
        if to_branch_type is None:
422
 
            to_branch_type = BzrBranch
423
 
        print "FIXME use a branch format here"
424
 
        br_to = to_branch_type.initialize(to_location)
 
421
        if to_branch_format is None:
 
422
            br_to = Branch.initialize(to_location)
 
423
        else:
 
424
            br_to = to_branch_format.initialize(to_location)
425
425
        mutter("copy branch from %s to %s", self, br_to)
426
426
        if basis_branch is not None:
427
427
            basis_branch.push_stores(br_to)
1050
1050
        history = self._get_truncated_history(revision)
1051
1051
        if not bzrlib.osutils.lexists(to_location):
1052
1052
            os.mkdir(to_location)
1053
 
        branch_to = Branch.initialize(to_location)
 
1053
        branch_to = BzrBranchFormat6().initialize(to_location)
1054
1054
        mutter("copy branch from %s to %s", self, branch_to)
1055
1055
 
1056
1056
        self.repository.copy(branch_to.repository)
1067
1067
 
1068
1068
    def clone(self, to_location, revision=None, basis_branch=None, to_branch_type=None):
1069
1069
        print "FIXME: clone via create and fetch is probably faster when versioned file comes in."
1070
 
        if to_branch_type is None:
1071
 
            to_branch_type = BzrBranch
1072
 
 
1073
 
        if to_branch_type == BzrBranch \
1074
 
            and self.repository.weave_store.listable() \
1075
 
            and self.repository.revision_store.listable():
 
1070
        if (to_branch_type is None
 
1071
            and self.repository.weave_store.listable()
 
1072
            and self.repository.revision_store.listable()):
1076
1073
            return self._clone_weave(to_location, revision, basis_branch)
1077
 
 
1078
 
        return Branch.clone(self, to_location, revision, basis_branch, to_branch_type)
 
1074
        else:
 
1075
            return Branch.clone(self, to_location, revision, basis_branch, to_branch_type)
1079
1076
 
1080
1077
    def fileid_involved_between_revs(self, from_revid, to_revid):
1081
1078
        """Find file_id(s) which are involved in the changes between revisions.