Merge algorithms
Andrew Bennetts
andrew.bennetts at canonical.com
Mon Oct 25 02:02:24 BST 2010
Eli Zaretskii wrote:
> > Date: Mon, 25 Oct 2010 08:49:15 +1300
> > From: Robert Collins <robertc at robertcollins.net>
> > Cc: Andrew Bennetts <andrew.bennetts at canonical.com>, bazaar at lists.canonical.com
> >
> > On Sun, Oct 24, 2010 at 5:36 AM, Eli Zaretskii <eliz at gnu.org> wrote:
> > > Perhaps I'm missing something. Can I get the plugin write something
> > > into .bzr.log, so I could be sure it is being invoked?
> >
> > bzr should log that its loaded the plugin :)
>
> It didn't. So that must mean I goofed somehow with locations.conf.
(Or it may mean the plugin isn't being loaded at all: check what "bzr
plugins" reports, but I don't think this is your problem.)
> Perhaps I got it wrong, but my understanding was that I need to create
> `.bzr/branch/locations.conf' under the branch's top directory, and put
> there these two lines:
>
> [/foo/bar]
> changelog_merge_files = ChangeLog
>
> where "/foo/bar" is the absolute file name of the branch's top
> directory, the one where I create `.bzr/branch/locations.conf'. Is
> that right, or did I mess up?
You messed up, or more accurately: I messed up the instructions. They're
not technically wrong, but they are (obviously!) confusing because they
silently assume you know exactly what I mean when I say “locations.conf” or
“branch.conf”.
The confusion is that there are two quite different places you can configure
this plugin, but they have not very distinct names: in per-user
configuration file (~/.bazaar/locations.conf) or in a per-branch
configuration file ($my_branch/.bzr/branch/branch.conf). Unfortunately I've
confused you so that you've tried to use a configuration file that doesn't
exist as far as Bazaar as concerned ($my_branch/.bzr/branch/branch.conf).
The distinction between “$HOME/.bazaar” and “.bzr” is a bit too easy to
miss, especially when “$HOME” is written as “~”. There's an open bug about
moving ~/.bazaar to a more standard location (under ~/.config or
something?), which would perhaps help, although the transition is likely to
be a bit painful.
So, in this case I think you need to do one of:
1. cat .bzr/branch/locations.conf >> ~/.bazaar/.locations.conf
rm .bzr/branch/locations.conf
or
2. grep -v \\\[ .bzr/branch/locations.conf >> .bzr/branch/branch/conf
rm .bzr/branch/locations.conf
i.e. move the configuration to one of the per-user locations.conf (including
section heading defining the location), or the per-branch branch.conf (no
section heading required).
For reference, the configuration files are hopefully documented fully and
properly at
<http://doc.bazaar.canonical.com/latest/en/user-reference/configuration-help.html#configuration-files>
(and summarised version that serves as an overview is at
<http://doc.bazaar.canonical.com/latest/en/user-guide/configuring_bazaar.html>).
I think I'll tweak bzr-changelog-merge so that you can pass a -D debug flag
to make it report on if it is finding configuration settings, and if it is
finding files matching those settings, etc.
I also clearly need to tweak the help text, but perhaps I should actually
just remove most of the attempt at quick start help and refer to the main
bzr docs for configuration? I'm not sure. Suggestions are welcome!
-Andrew.
More information about the bazaar
mailing list