~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: 2008-09-23 03:52:00 UTC
  • mfrom: (3681.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080923035200-4k29gtzxfev8l3a0
(robertc) Add a Branch.open hook. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
        self._revision_id_to_revno_cache = None
92
92
        self._last_revision_info_cache = None
93
93
        self._open_hook()
 
94
        hooks = Branch.hooks['open']
 
95
        for hook in hooks:
 
96
            hook(self)
94
97
 
95
98
    def _open_hook(self):
96
99
        """Called by init to allow simpler extension of the base class."""
1068
1071
        # (branch, revision_history), and the branch will
1069
1072
        # be write-locked.
1070
1073
        self['set_rh'] = []
 
1074
        # Invoked after a branch is opened. The api signature is (branch).
 
1075
        self['open'] = []
1071
1076
        # invoked after a push operation completes.
1072
1077
        # the api signature is
1073
1078
        # (push_result)