~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-12-14 18:03:42 UTC
  • mfrom: (4871.4.2 admin-guide-upgrade)
  • Revision ID: pqm@pqm.ubuntu.com-20091214180342-nk22cwvqcz54e331
(nmb) Add upgrade section to admin-guide

Show diffs side-by-side

added added

removed removed

Lines of Context:
1103
1103
        params = ChangeBranchTipParams(
1104
1104
            self, old_revno, new_revno, old_revid, new_revid)
1105
1105
        for hook in hooks:
1106
 
            hook(params)
 
1106
            try:
 
1107
                hook(params)
 
1108
            except errors.TipChangeRejected:
 
1109
                raise
 
1110
            except Exception:
 
1111
                exc_info = sys.exc_info()
 
1112
                hook_name = Branch.hooks.get_hook_name(hook)
 
1113
                raise errors.HookFailed(
 
1114
                    'pre_change_branch_tip', hook_name, exc_info)
1107
1115
 
1108
1116
    @needs_write_lock
1109
1117
    def update(self):
2135
2143
        # All-in-one needs to always unlock/lock.
2136
2144
        repo_control = getattr(self.repository, 'control_files', None)
2137
2145
        if self.control_files == repo_control or not self.is_locked():
2138
 
            self.repository._warn_if_deprecated(self)
2139
2146
            self.repository.lock_write()
2140
2147
            took_lock = True
2141
2148
        else:
2153
2160
        # All-in-one needs to always unlock/lock.
2154
2161
        repo_control = getattr(self.repository, 'control_files', None)
2155
2162
        if self.control_files == repo_control or not self.is_locked():
2156
 
            self.repository._warn_if_deprecated(self)
2157
2163
            self.repository.lock_read()
2158
2164
            took_lock = True
2159
2165
        else: