~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2010-07-21 09:58:42 UTC
  • mfrom: (4797.58.7 2.1)
  • mto: (5050.3.13 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: mbp@canonical.com-20100721095842-hz0obu8gl0x05nty
merge up 2.1 to 2.2

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