64
65
name_prefix = "changelog"
66
def get_filepath(self, params, tree):
67
"""Calculate the path to the file in a tree.
69
This is overridden to return just the basename, rather than full path,
70
so that e.g. if the config says ``changelog_merge_files = ChangeLog``,
71
then all ChangeLog files in the tree will match (not just one in the
74
:param params: A MergeHookParams describing the file to merge
75
:param tree: a Tree, e.g. self.merger.this_tree.
77
return urlutils.basename(tree.id2path(params.file_id))
67
def file_matches(self, params):
68
affected_files = self.affected_files
69
if affected_files is None:
70
config = self.merger.this_branch.get_config()
71
# Until bzr provides a better policy for caching the config, we
72
# just add the part we're interested in to the params to avoid
73
# reading the config files repeatedly (breezy.conf, location.conf,
75
config_key = self.name_prefix + '_merge_files'
76
affected_files = config.get_user_option_as_list(config_key)
77
if affected_files is None:
78
# If nothing was specified in the config, use the default.
79
affected_files = self.default_files
80
self.affected_files = affected_files
82
filepath = osutils.basename(params.this_path)
83
if filepath in affected_files:
79
87
def merge_text(self, params):
80
88
"""Merge changelog changes.