# # # patch "contrib/Monotone.pm" # from [49c7660792c91a1bea224f5763be14e8912aad38] # to [888e6db40973edad6381d4ca11eaad6cbaf3345b] # ============================================================ --- contrib/Monotone.pm 49c7660792c91a1bea224f5763be14e8912aad38 +++ contrib/Monotone.pm 888e6db40973edad6381d4ca11eaad6cbaf3345b @@ -15,7 +15,7 @@ our @EXPORT = qw( ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( ); -our $VERSION = '0.02'; +our $VERSION = '0.03'; #constructor sub new { @@ -50,6 +50,24 @@ sub open ($$) { # die("Wrong monotone interface version: $out") if ($out != 5.0 || $err ne ""); } +sub open_args ($) { + my $self=shift; + local (*READ, *WRITE); + die("Monotone automate session already running!") if (defined($self->{PID}) && $self->{PID}); + my $cmd = "mtn automate stdio"; + while (my $arg=shift) { + $cmd = $cmd." $arg"; + } + $self->{PID} = open2(\*READ, \*WRITE, $cmd ); + die("Unable to start mtn automate stdio session") if (!(defined($self->{PID}) && $self->{PID})); + $self->{In} = *READ; + $self->{Out} = *WRITE; + $self->{CmdNum} = 0; + + # my ($out, $err) = $self->call("interface_version"); + # die("Wrong monotone interface version: $out") if ($out != 5.0 || $err ne ""); +} + sub setOpts { my $self = shift;