[RFC] merge with nothing to do should return non-zero

Aaron Bentley aaron.bentley at utoronto.ca
Fri Aug 17 05:17:33 BST 2007


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

Robert Collins wrote:
> I was just trying to use bzr from a shell script, and I noticed that
> 'bzr merge FOO' when there is nothing missing returns 'Nothing to do'
> but does not return non-zero.

Of course not.  It successfully did nothing, as you requested ;-)

> Can we do
> something like 
> 0 - merge done
> 1 - nothing to do
> 2 - error occured

Actually, 1 is already "conflicts occurred", and is documented as such
in HACKING.  Changing that might break existing scripts.

With Martin's patch merged, the next available status code is 5.

0 - Total success
1 - Conflicts
2 - [Unrepresentable diff changes, not at all similar to 'nothing to
     do']
3 - User error
4 - Internal error
5 - Sucessfully did nothing


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

iD8DBQFGxR/o0F+nu1YWqI0RAuJ4AJ9PrFZ2m8VrtctbNuyRzRw0Drgi5gCfSL/I
k/vW1Y8OjJMNievA8nN3+tU=
=+hoK
-----END PGP SIGNATURE-----



More information about the bazaar mailing list