Marking files as read-only in bzr
Martin Pool
mbp at canonical.com
Fri Nov 10 06:48:51 GMT 2006
On 3 Nov 2006, Joseph Wakeling <joseph.wakeling at webdrake.net> wrote:
> Hello all,
>
> First off, thanks to everyone who's been taking part in the cross-list
> discussion with the git folks. It's been fascinating reading.
>
> Now, to bzr. Is it possible for bzr to mark a file as read-only in the
> branch, that is, to refuse to allow any changes to be committed to it?
>
> The context I'm thinking of is some data files accompanied by MATLAB
> (or, in this case, GNU Octave:-) functions to analyse them. It makes
> sense for data to be part of the branch, but I want to ensure that it
> can't be altered, for obvious reasons.
There's no built-in facility to do this, but you can accomplish it in a
couple of ways.
First I'd suggest putting the data files in a separate branch, and then
have symlinks or some similar setup. It's good to think of branches as
having a policy about who can commit to them and when: in this case it
would be that you only commit to it when you get new experimental data,
etc.
You could alternatively write a plugin that cancels commits that touch
those files.
--
Martin
More information about the bazaar
mailing list