~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: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
        bzrdir,
26
26
        cache_utf8,
27
27
        config as _mod_config,
 
28
        controldir,
28
29
        debug,
29
30
        errors,
30
31
        lockdir,
64
65
BZR_BRANCH_FORMAT_6 = "Bazaar Branch Format 6 (bzr 0.15)\n"
65
66
 
66
67
 
67
 
class Branch(bzrdir.ControlComponent):
 
68
class Branch(controldir.ControlComponent):
68
69
    """Branch holding a history of revisions.
69
70
 
70
71
    :ivar base:
1861
1862
            "all are called with the url returned from the previous hook."
1862
1863
            "The order is however undefined.", (1, 9), None))
1863
1864
        self.create_hook(HookPoint('automatic_tag_name',
1864
 
            "Called to determine an automatic tag name for a revision."
 
1865
            "Called to determine an automatic tag name for a revision. "
1865
1866
            "automatic_tag_name is called with (branch, revision_id) and "
1866
1867
            "should return a tag name or None if no tag name could be "
1867
1868
            "determined. The first non-None tag name returned will be used.",
1958
1959
        return self.__dict__ == other.__dict__
1959
1960
 
1960
1961
    def __repr__(self):
1961
 
        if self.branch:
1962
 
            return "<%s of %s>" % (self.__class__.__name__, self.branch)
1963
 
        else:
1964
 
            return "<%s of format:%s bzrdir:%s>" % (
1965
 
                self.__class__.__name__, self.branch,
1966
 
                self.format, self.bzrdir)
 
1962
        return "<%s of %s>" % (self.__class__.__name__, self.branch)
1967
1963
 
1968
1964
 
1969
1965
class SwitchHookParams(object):
3313
3309
        """
3314
3310
        raise NotImplementedError(self.push)
3315
3311
 
 
3312
    @needs_write_lock
 
3313
    def copy_content_into(self, revision_id=None):
 
3314
        """Copy the content of source into target
 
3315
 
 
3316
        revision_id: if not None, the revision history in the new branch will
 
3317
                     be truncated to end with revision_id.
 
3318
        """
 
3319
        raise NotImplementedError(self.copy_content_into)
 
3320
 
3316
3321
 
3317
3322
class GenericInterBranch(InterBranch):
3318
3323
    """InterBranch implementation that uses public Branch functions."""