Commits

Anonymous committed d5fbcc8

add add() method and docs

Comments (0)

Files changed (1)

lib/Hg/Lib/Client.pm

 functions in B<Hg::Lib>; see there for more details on how to do so.
 
 =head1 METHODS
+
+=head2 High-level access
+
+=over
+
+=item B<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:
+
+=over
+
+=item C<include> I<string> | I<ref to array of strings>
+
+Include names matching the given pattern(s).
+
+=item C<exclude> I<string> | I<ref to array of strings>
+
+Exclude names matching the given pattern(s).
+
+=item C<subrepos> I<boolean>
+
+Recurse into subrepositories.
+
+=item C<dryrun> I<boolean>
+
+Do not perform actions, just print output.
+
+=item C<mq> I<boolean>
+
+Operate on patch repository.
+
+=back
+
+=cut
+
+sub add {
+
+    my $self = shift;
+
+    state $check = compile(
+	StrList,
+        slurpy Dict [
+            include  => Optional [StrList],
+            exclude  => Optional [StrList],
+            subrepos => Optional [Bool],
+            dryrun   => Optional [Bool],
+            mq       => Optional [Bool],
+        ] );
+
+    my ( $filelist, $opts ) = $check->( @_ );
+
+    my $cmd = $self->_prep_cmd( 'add', $filelist, $opts );
+
+    return $self->run( $cmd );
+}
+
+
+=back
+
+
 =head2 Low-level access
 
 =over