[MERGE] 'bzr merge' defaults to '--reprocess'

Aaron Bentley aaron at aaronbentley.com
Thu Oct 2 13:53:56 BST 2008


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

John Arbash Meinel wrote:
> Aaron Bentley wrote:
>> If I have aliased "merge" to "merge --reprocess", I want a way to force
>> it back to the default behavior, without using --no-aliases.
> 
> 
> 'bzr merge --reprocess --no-reprocess' does just that.

Oh.  I expected it would prevent reprocessing, not put it back into auto
mode.  Merging without reprocessing *is* useful, so --no-reprocess
should still enable it.

> But I guess you're asking for a way to hide the parameter you gave (in
> the alias)
> 
> I've run into that elsewhere, I have 'log = log -r -10..-1 --short', and
> now I just tried to do "bzr log -c X" to try it out, but it fails
> because "-c" and "-r" are "incompatible".
> 
> I'm not sure if there is a great answer. It seems like we would need
> finer control about how options are parsed and what overrides what.

We already support multi-valued flags via RegistryOption.from_kwargs.

So we can do
RegistryOption.from_kwargs('reprocess-mode',
    reprocess='Always reprocess',
    no_reprocess='Never reprocess',
    auto_reprocess='Auto-detect whether to reprocess',
    enum_switch=False,
    value_switch=True)

For -r and -c, I agree we need some finer control.  But I believe
optparse already supports this kind of thing.

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

iD8DBQFI5MRk0F+nu1YWqI0RAmTKAJ9jQ8QjOFQfJjYVUoCUlmMkyum2BACcDTo+
bXcEOYqUMMU2FyA5+wlF3Hg=
=pFn1
-----END PGP SIGNATURE-----



More information about the bazaar mailing list