Reserved Edit Plugin
Simon Kersey
simon.kersey at ipl.com
Tue Mar 30 11:00:56 BST 2010
Hi,
I would just like to let you know that I have added a plugin to support
reserved edit functionality to launchpad:
http://launchpad.net/bzr-reserved-edit.
Hopefully the plugin will be useful to people wanting to control updates to
files that don’t merge easily.
The plugin provides the following commands:
red-enable : enable reserved edits on a centralised branch
red-add : add file to reserved edit (RED) list
red-remove : remove file from reserved edit list
red-lock : lock file on reserved edit list (only user with lock can
commit changes)
red-unlock : unlock file on reserved edit list
red-ls : list status of files on reserved edit list
It also installs the following hooks:
Pre-commit hook that stops the user committing changes to files on the
reserved edit list unless they are locked by that user.
Branch open hook and BzrDir pre-open hook to make reserved edit files
read-only if they are on the reserved edit list and not locked by the
current user.
Oh and just for fun, it adds some tools (with icons) to the latest versions
of BzrExplorer via the plugin extensions.
It is designed to be used in the situation where you have a bound branch or
checkout from a central branch held on a local file system
(transport = file://, so also mapped network drives) repository.
When you run the red-… commands they first attempt to find the central branch
holding the RED locks. It does this by attempting to open the supplied
directory as a working tree; then checking if the tree has a bound location
or old bound branch; if the bound location has reserved edits enabled then
this is the central location else it recurses from the bound location
looking for a parent with reserved edits enabled.
In the central location the plugin stores locks in ‘.bzr/red/locks’ and
status information in ‘branch.conf’. The following status information is
stored:
red_is_enabled = True
red_enabled_on = 14/12/2009 15:03:16 UTC
red_enabled_by = <bzr user name>
red_updated_at = 1268042479
red_processed_at = 1260873441
Any feedback would be welcome.
Cheers,
Simon
More information about the bazaar
mailing list