[MERGE] call commit hooks with correct local branch (for unbound branches)

Aaron Bentley aaron at aaronbentley.com
Fri Jan 2 17:23:15 GMT 2009


Marius Kruger wrote:
> hi,
> 
> I'm trying to write a pre_commit hook, but when it is called,
> it seems that the local and master branch are the wrong way around.
> looking at bzrlib.commit._process_hooks I see:
> around line 543:
>         # new style commit hooks:
>         if not self.bound_branch:
>             hook_master = self.branch
>             hook_local = None
>         else:
>             hook_master = self.master_branch
>             hook_local = self.branch
> 
> this looks wrong to me, but I might be missing something.

That is right.

The master branch is the authoritative branch.  It is the branch that
should be queried by most hook operations.  For an operation on a bound
branch, there is also a local branch, which is not authoritative, but
might be local, might be faster, might be out-of-date.

For operations on unbound branches, there is only a master branch.

Aaron



More information about the bazaar mailing list