.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SVN::Class 3pm" .TH SVN::Class 3pm "2022-06-17" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SVN::Class \- manipulate Subversion workspaces with Perl objects .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use SVN::Class; \& \& my $file = svn_file( \*(Aqpath/to/file\*(Aq ); \& my $fh = $file\->open(\*(Aq>>\*(Aq); \& print {$fh} "hello world\en"; \& $fh\->close; \& $file\->add; \& if ($file\->modified) { \& my $rev = $file\->commit(\*(Aqthe file changed\*(Aq); \& print "$file was committed with revision $rev\en"; \& } \& else { \& croak "$file was not committed: " . $file\->errstr; \& } \& \& my $dir = svn_dir( \*(Aqpath/to/dir\*(Aq ); \& $dir\->mkpath unless \-d $dir; \& $dir\->add; # recurses by default \& $dir\->commit(\*(Aqadded directory\*(Aq) if $dir\->modified; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" SVN::Class extends Path::Class to allow for basic Subversion workspace management. SVN::Class::File and SVN::Class::Dir are subclasses of Path::Class::File::Stat and Path::Class::Dir respectively. .PP SVN::Class does not use the SVN::Core Subversion \s-1SWIG\s0 bindings. Instead, the \f(CW\*(C`svn\*(C'\fR binary tool is used for all interactions, using IPC::Cmd. This design decision was made for maximum portability and to eliminate non-CPAN dependencies. .SH "EXPORT" .IX Header "EXPORT" SVN::Class exports two functions by default: \fBsvn_file()\fR and \fBsvn_dir()\fR. These work just like the \fBdir()\fR and \fBfile()\fR functions in Path::Class. If you do not want to export them, just invoke SVN::Class like: .PP .Vb 1 \& use SVN::Class (); .Ve .SS "svn_file( \fIfile\fP )" .IX Subsection "svn_file( file )" Works just like \fBPath::Class::file()\fR. .SS "svn_dir( \fIdir\fP )" .IX Subsection "svn_dir( dir )" Works just like \fBPath::Class::dir()\fR. .SH "METHODS" .IX Header "METHODS" SVN::Class inherits from Path::Class. Only new or overridden methods are documented here. .SS "svn" .IX Subsection "svn" Path to the svn binary. Defaults to \f(CW\*(C`svn\*(C'\fR and thus relies on environment's \&\s-1PATH\s0 to find and execute the correct command. .SS "stdout" .IX Subsection "stdout" Get the stdout from the last \fBsvn_run()\fR. .SS "stderr" .IX Subsection "stderr" Get the stderr from the last \fBsvn_run()\fR. .SS "error" .IX Subsection "error" If the last \fBsvn_run()\fR exited with non-zero, \fBerror()\fR will return same as \fBstderr()\fR. If \fBsvn_run()\fR was successful, returns the empty string. .SS "error_code" .IX Subsection "error_code" Returns the last exit value of \fBsvn_run()\fR. .SS "verbose" .IX Subsection "verbose" Get/set a true value to enable \s-1IPC\s0 output in \fBsvn_run()\fR. .SS "debug" .IX Subsection "debug" Get/set a true value to see debugging output printed on stderr. .SS "svn_run( \fIcmd\fP, \fIopts\fP, \fIfile\fP )" .IX Subsection "svn_run( cmd, opts, file )" Execute \fIcmd\fR given \fIopts\fR and \fIfile\fR as arguments. This is a wrapper around the IPC::Run \fBrun()\fR function. .PP \&\fIopts\fR should be an array ref of options to pass to \fIcmd\fR. .PP \&\fIfile\fR defaults to \f(CW$self\fR\->\fBstringify()\fR. .PP Returns the success code from IPC::Run \fBrun()\fR. Sets the stdout, stderr, err, errstr, and error_code values in the SVN::Class object. .PP This method is used internally by all the Subversion commands. .PP \&\fB\s-1NOTE:\s0\fR In order to standardize the output of Subversion commands into a locale that is easily parse-able by other methods that call \fBsvn_run()\fR internally, all commands are run with \f(CW\*(C`LC_ALL=C\*(C'\fR to make sure output is \s-1ASCII\s0 only. .SS "log" .IX Subsection "log" Returns svn log of the file or 0 on error. The log is returned as an arrayref (same as accessing \fBstdout()\fR). .SS "add" .IX Subsection "add" Schedule the object for addition to the repository. .SS "delete" .IX Subsection "delete" Schedule the object for removal from the repository. .SS "update" .IX Subsection "update" Get the latest version of the object from the repository. .SS "up" .IX Subsection "up" Alias for \fBupdate()\fR. .SS "revert" .IX Subsection "revert" Undo the last Subversion action on the object. .SS "commit( \fImessage\fP )" .IX Subsection "commit( message )" Commit the object to the repository with the log \fImessage\fR. .PP Returns the revision number of the commit on success, 0 on failure. .SS "status" .IX Subsection "status" Returns the workspace status of the object. .SS "modified" .IX Subsection "modified" Returns true if the \fBstatus()\fR of the object is \f(CW\*(C`Add\*(C'\fR or \f(CW\*(C`Modified\*(C'\fR. .SS "conflicted" .IX Subsection "conflicted" Returns true if the \fBstatus()\fR of the object is \f(CW\*(C`Conflicted\*(C'\fR. .SS "diff" .IX Subsection "diff" Diff the workspace version of the object against either the repository or the current working baseline version. .SS "blame" .IX Subsection "blame" Annotated accounting of who modified what lines of the object. .SS "info" .IX Subsection "info" Returns SVN::Class::Info instance with information about the current object or 0 on failure. .SS "dump" .IX Subsection "dump" Returns a Data::Dump serialization of the object. Useful for debugging. .SS "errstr" .IX Subsection "errstr" Returns the contents of \fBerror()\fR as a newline-joined string. .SS "outstr" .IX Subsection "outstr" Returns the contents of \fBstdout()\fR as a newline-joined string. .SH "AUTHOR" .IX Header "AUTHOR" Peter Karman, \f(CW\*(C`\*(C'\fR .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to \&\f(CW\*(C`bug\-svn\-class at rt.cpan.org\*(C'\fR, or through the web interface at . I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc SVN::Class .Ve .PP You can also look for information at: .IP "\(bu" 4 AnnoCPAN: Annotated \s-1CPAN\s0 documentation .Sp .IP "\(bu" 4 \&\s-1CPAN\s0 Ratings .Sp .IP "\(bu" 4 \&\s-1RT: CPAN\s0's request tracker .Sp .IP "\(bu" 4 Search \s-1CPAN\s0 .Sp .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" I looked at SVN::Agent before starting this project. It has a different \s-1API,\s0 more like SVN::Client in the SVN::Core, but I cribbed some of the ideas. .PP The Minnesota Supercomputing Institute \f(CW\*(C`http://www.msi.umn.edu/\*(C'\fR sponsored the development of this software. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2007 by the Regents of the University of Minnesota. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" Path::Class, Class::Accessor::Fast, SVN::Agent, IPC::Cmd