~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-26 03:15:58 UTC
  • mfrom: (4050.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090226031558-1ubr618vdn4r5f07
(robertc) Fix race condition with branch hooks during cloning when
        the new branch is stacked. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
878
878
            raise errors.InvalidRevisionNumber(revno)
879
879
 
880
880
    @needs_read_lock
881
 
    def clone(self, to_bzrdir, revision_id=None):
 
881
    def clone(self, to_bzrdir, revision_id=None, repository_policy=None):
882
882
        """Clone this branch into to_bzrdir preserving all semantic values.
883
883
 
884
884
        Most API users will want 'create_clone_on_transport', which creates a
888
888
                     be truncated to end with revision_id.
889
889
        """
890
890
        result = to_bzrdir.create_branch()
 
891
        if repository_policy is not None:
 
892
            repository_policy.configure_branch(result)
891
893
        self.copy_content_into(result, revision_id=revision_id)
892
894
        return  result
893
895
 
1668
1670
 
1669
1671
    def _make_reference_clone_function(format, a_branch):
1670
1672
        """Create a clone() routine for a branch dynamically."""
1671
 
        def clone(to_bzrdir, revision_id=None):
 
1673
        def clone(to_bzrdir, revision_id=None,
 
1674
            repository_policy=None):
1672
1675
            """See Branch.clone()."""
1673
1676
            return format.initialize(to_bzrdir, a_branch)
1674
1677
            # cannot obey revision_id limits when cloning a reference ...