~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-08-14 15:36:22 UTC
  • mfrom: (1551.8.5 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20060814153622-a58babcb7b36ffca
Add Branch.create_checkout method

Show diffs side-by-side

added added

removed removed

Lines of Context:
762
762
        old_format = bzrdir.BzrDirFormat.get_default_format()
763
763
        bzrdir.BzrDirFormat.set_default_format(bzrdir.BzrDirMetaFormat1())
764
764
        try:
765
 
            if lightweight:
766
 
                checkout = bzrdir.BzrDirMetaFormat1().initialize(to_location)
767
 
                branch.BranchReferenceFormat().initialize(checkout, source)
768
 
            else:
769
 
                checkout_branch =  bzrdir.BzrDir.create_branch_convenience(
770
 
                    to_location, force_new_tree=False)
771
 
                checkout = checkout_branch.bzrdir
772
 
                checkout_branch.bind(source)
773
 
                if revision_id is not None:
774
 
                    rh = checkout_branch.revision_history()
775
 
                    checkout_branch.set_revision_history(rh[:rh.index(revision_id) + 1])
776
 
            checkout.create_workingtree(revision_id)
 
765
            source.create_checkout(to_location, revision_id, lightweight)
777
766
        finally:
778
767
            bzrdir.BzrDirFormat.set_default_format(old_format)
779
768