thoughts on a bzrrc file

Magnus Therning magnus at therning.org
Thu May 19 09:15:56 BST 2005


Answering my own emails now, slightly schizophrenic I guess ;-)

On Thu, May 19, 2005 at 08:49:38AM +0100, Magnus Therning wrote:
>On Thu, May 19, 2005 at 05:27:51PM +1000, Benno wrote:
>>On Thu May 19, 2005 at 17:12:46 +1000, Martin Pool wrote:
>[..]
>>>----------------
>>># my bzr config file
>>>
>>>diff_program = diff -uw %s %s
>>>email = Martin Pool <mbp at sourcefrog.net>
>>>editor = emacsclient %s
>>>
>>
>>How about the option of having a ~/.bzrrc.py file for those that want
>>to script settings. I think my previous example had setting a different
>>email based on the project. E.g:
>>
>>if (project_is_about_work):
>>  email = me at work
>>else: 
>>  email = me at home
>
>Is there some other (non-programming) way of adding per-project
>settings?
>
>First I was thinking of personal defaults in ~/.bzrrc and per-project in
>the working area but for obvious reasons that wouldn't be very good.
>
>Maybe it'd be possible to put several config files in ~/.bzr/?
>For projectA we'd first load ~/.bzr/bzr.conf and then let things in
>~/.bzr/projectA.conf override... I guess I should put some code behind
>all this rambling instead.

More ramblings...

Would the following be possible using ConfigParser?
(If I remember correctly it doesn't have built-in support for
sub-levels, but adding one level shouldn't be difficult.)

[bzr]
email = Magnus Therning <magnus at therning.org>
diff_program = diff -uw %s %s

[bzr/projectA]
email = Magnus Therning <mtherning at sourceforge.net>

Then it shouldn't be too difficult to extend it to external commands as
well:

[my_ext_cmd]
foo = foo
bar = bar

[my_ext_cmd/projectA]
foo = qux

Good idea? Bad idea?

/M

-- 
Magnus Therning                    (OpenPGP: 0xAB4DFBA4)
magnus at therning.org
http://magnus.therning.org/

Software is not manufactured, it is something you write and publish.
Keep Europe free from software patents, we do not want censorship
by patent law on written works.

Few false ideas have more firmly gripped the minds of so many
intelligent men than the one that, if they just tried, they could
invent a cipher that no one could break.
      -- David Kahn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050519/017c044f/attachment.pgp 


More information about the bazaar mailing list