~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

Merge in bzr.dev 3801, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1126
1126
        # (params) where params is a ChangeBranchTipParams with the members
1127
1127
        # (branch, old_revno, new_revno, old_revid, new_revid)
1128
1128
        self['post_change_branch_tip'] = []
 
1129
        # Introduced in 1.9
 
1130
        # Invoked when a stacked branch activates its fallback locations and
 
1131
        # allows the transformation of the url of said location.
 
1132
        # the api signature is
 
1133
        # (branch, url) where branch is the branch having its fallback
 
1134
        # location activated and url is the url for the fallback location.
 
1135
        # The hook should return a url.
 
1136
        self['transform_fallback_location'] = []
1129
1137
 
1130
1138
 
1131
1139
# install the default hooks into the Branch class.
2021
2029
            errors.UnstackableBranchFormat):
2022
2030
            pass
2023
2031
        else:
 
2032
            for hook in Branch.hooks['transform_fallback_location']:
 
2033
                url = hook(self, url)
 
2034
                if url is None:
 
2035
                    hook_name = Branch.hooks.get_hook_name(hook)
 
2036
                    raise AssertionError(
 
2037
                        "'transform_fallback_location' hook %s returned "
 
2038
                        "None, not a URL." % hook_name)
2024
2039
            self._activate_fallback_location(url)
2025
2040
 
2026
2041
    def _check_stackable_repo(self):