Code review comment for lp:~jameinel/bzr-builddeb/changelog-hook

Revision history for this message
John A Meinel (jameinel) wrote :

This adds a per-file commit hook, which checks
a) A Branch config called
  changelog_hook_enabled = True
b) A file named 'changelog' or 'debian/changelog'

If both hold true, and it perceives a conflict in the changelog file, it essentially runs Scott's merge_changelog code. This will always result in a conflict-free changelog file. The current algorithm is "prefer-mine". So if both changelogs have a section with a matching 'version', the text present in "this" are used.

So if a Ubuntu Developer wants to enable this plugin, they can edit branch.conf or locations.conf (or bazaar.conf) to set 'changelog_hook_enabled = True'. We can argue that just having 'bzr-builddeb' installed, would be sufficient to enable this for all branches when merging. (We could make the default True, and use the config to *disable* the plugin.)

There are some new tests for this, but I've also manually tested merging lp:ubuntu/bzrtools @-r4.3.1 into -r 50. And it seemed to do a nice clean merge (without the plugin enabled it conflicted as expected.) As an example:

 bzr branch lp:ubuntu/bzrtools -r 4.3.1 bzrtools_upstream
 bzr branch lp:ubuntu/bzrtools -r 50 bzrtools_ubuntu
 cd bzrtools_ubuntu
 bzr merge ../bzrtools_upstream

(There are other conflicts, but *debian/changelog* is not one of them)

« Back to merge proposal