bzr svn propedit equivalent

Jari Aalto jari.aalto at cante.net
Mon Mar 5 14:04:34 GMT 2007


Harald Meland <harald.meland at usit.uio.no> writes:
> It depends, I guess.  Are you going to design this for "sloppy"
> scripters (i.e. assume that perl coders will do
>
>   $val = `bzr config get $foo`;

Yes. 

The unix commands traditionally answer with status codes. That
is a good design principle. Like in shell programs:

    val=$(bzr config get $foo)

    [ "$?" = "0" ] || { echo "[FATAL] ..."; exit 1; }

> and hence risk that $val includes the settings for all valid config
> variables), or only for "safe" scripters (i.e. assume perl scripters
> will instead do something like
>
>   open (CFG, "-|", qw(bzr config get), $foo);
>   my $val = join ("\n", <CFG>);
>   close (CFG) || die "bzr config get $foo exited with non-zero value: $?";
>
> )

Or like this:

    $foo or die "[PANIC] Hmpf, I found empty \$foo";
    $val = `bzr config get $foo`;

Jari




More information about the bazaar mailing list