Prevent accidental commit of a versioned and localy changed file

John Arbash Meinel john at arbash-meinel.com
Mon Jul 7 15:59:14 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sabin Iacob wrote:
> Marius Gedminas wrote:
>> On Fri, Jul 04, 2008 at 07:26:57PM +0300, Panagiotis Papadakos wrote:
>>  
>>> Lets say that I have a file on my local branch,
>>> which is under version control. I need to make
>>> some changes to this file so that the code of the branch
>>> can work using my personal options (lets say
>>> this is a config file). And I don't want to accidentally
>>> commit the changes I have made to the central branch.
>>> Is there any way I can somehow 'lock' the file?
>>>     
>>
>> I've been missing this sort of thing in Subversion.  It would be nice if
>> Bazaar had a way to mark files "uncommittable".
>>   
> 
> I seem to remember something like this in tla (Gnu Arch): there was a
> kind of files called "precious" which were copied if a new branch was
> created, but weren't taken into account when committing (tla didn't
> recognise them as source files).
> 
> 

I don't think this is quite what he wants. He wants a "version, but do not
commit". The idea is basically when you have a config file, and you want to
run out of the source tree.

The way I've always seen it done elsewhere is that you have a:

config.template

which you then copy to "config" and edit.

IMO, it is a much cleaner way of doing it.

That said, you could certainly put something like this together in a plugin. A
simple pre-commit check should be able to do it. As a first draft, you could
just abort if it tries to commit the file. A further version might just try to
skip the file if it is being committed as part of a recursive commit.

Unfortunately, the point at which our current logic does a pre_commit check,
doesn't let you modify the commit. Only abort it.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIci9CJdeBCYSNAAMRAl7eAJ9iuZNWe+g3BFVjKqE+PoimQHX1QwCfdieJ
Egvxv6rNdnOd7max7rqIJg8=
=qjD0
-----END PGP SIGNATURE-----



More information about the bazaar mailing list