NAME

Hg::Lib::Client

SYNOPSIS

  $client->run( $cmd, %opts );

DESCRIPTION

Hg::Lib::Client objects are used to send commands to mercurial's command server and retrieve results. They are created by the functions in Hg::Lib; see there for more details on how to do so.

METHODS

High-level access

add
  $res = $client->add( $file, %options );
  $res = $client->add( \@files, %options );

Add the specified file or files to the repository. The following options are available:

include string | ref to array of strings

Include names matching the given pattern(s).

exclude string | ref to array of strings

Exclude names matching the given pattern(s).

subrepos boolean

Recurse into subrepositories.

dryrun boolean

Do not perform actions, just print output.

mq boolean

Operate on patch repository.

Low-level access

run
  $client->run( $cmd, %options );

Send a command to the server. This is a convenience wrapper around Hg::Lib::Server::Pipe::runcommand.

$cmd

The command to execute, typically built using Hg::Lib::Utils::prep_cmd. It may be a string or an array of strings. Required.

%options

The following options are available

prompt

A reference to a subroutine to be called when the server requires line based input. It will be called as

  $data = $prompt->( $max_bytes, $output );

where $max_bytes is the maximum number of bytes to send and $output is the cumulative data sent on the output channel by the server for this command.

input

A reference to a subroutine to be called when the server requires a chunk of input data. It will be called as

  $data = $input->( $max_bytes );

where $max_bytes is the maximum number of bytes to send.

eh

A reference to a subroutine to be called if an error occurs. It will be called as

  $eh->( $ret, $output, $error );

where $ret is the command's return code, and $output and $error are any data sent on the output and error channels.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Diab Jerius <djerius@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.