.\" 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 "Arch::Changeset 3pm" .TH Arch::Changeset 3pm "2022-06-08" "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" Arch::Changeset \- class representing Arch changeset .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBArch::Changeset\fR objects may be created directly if you got a changeset directory: .PP .Vb 5 \& use Arch::Changeset; \& my $changeset = Arch::Changeset\->new( \& \*(Aqmigo@homemail.com\-\-Perl\-GPL/arch\-perl\-\-devel\-\-0\-\-patch\-6\*(Aq, \& \*(Aq/tmp/,,changeset\-6\*(Aq, \& ); .Ve .PP But often are created indirectly by other objects: .PP .Vb 4 \& use Arch::Session; \& $changeset = Arch::Session\->new\->get_revision_changeset( \& \*(Aqmigo@homemail.com\-\-Perl\-GPL/arch\-perl\-\-devel\-\-0\-\-patch\-6\*(Aq \& ); \& \& use Arch::Library; \& $changeset = Arch::Library\->new\->get_revision_changeset( \& \*(Aqmigo@homemail.com\-\-Perl\-GPL/arch\-perl\-\-devel\-\-0\-\-patch\-6\*(Aq \& ); \& \& print scalar $changeset\->get_patch("perllib/Arch/Changeset.pm"); \& \& my $diff_file = ($changeset\->get_patch("README", 1))[2]; \& print Arch::Util::load_file($diff_file); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class represents the changeset concept in Arch and provides some useful methods. .SH "METHODS" .IX Header "METHODS" The following methods are available: .PP \&\fBnew\fR, \&\fBget_patch\fR, \&\fBget_index\fR, \&\fBget_changes\fR, \&\fBget_all_diffs\fR, \&\fBjoin_all_diffs\fR, \&\fBancestor\fR. .IP "\fBnew\fR \fIrevision-spec\fR \fIdir-name\fR" 4 .IX Item "new revision-spec dir-name" Construct the Arch::Changeset object associated with the given fully-qualified \fIrevision-spec\fR and the existing directory \fIdir-name\fR. .IP "\fBget_patch\fR \fIfile-path\fR" 4 .IX Item "get_patch file-path" .PD 0 .IP "\fBget_patch\fR \fIfile-path\fR \fItype\fR" 4 .IX Item "get_patch file-path type" .IP "\fBget_patch\fR \fIfile-path\fR \fItype\fR \fIfull-file-asis\fR" 4 .IX Item "get_patch file-path type full-file-asis" .PD Return the patch (or otherwise content) of the given \fIfile-path\fR in the changeset. .Sp \&\fItype\fR is integer: 0 (unknown, try to autodetect, this is the default), 1 (modified file, or metadata change), 2 (new file), 3 (removed file). .Sp The default behaviour is to create a fake diff against \fI/dev/null\fR for non-binary new and removed files; the \fIfull-file-asis\fR flag, if set to true, changes this behaviour and causes to return the content of such file as-is. Binary new and removed files are always returned as-is regardless of the flag. This flag is also ignored if \fItype\fR is 1. .Sp In the scalar content return the patch in \fBdiff\fR\|(1) format (or the whole file content as described above). In the list content return 4 scalars: the patch, the file name on the disk containing this patch (or the whole file), the change type (that is \*(L"patch\*(R", \*(L"new\*(R" or \*(L"removed\*(R") and the as-is flag. .Sp The returned values that follow the first one (the patch/file content) share the order of the corresponding parameters; the parameters are more hints, while the returned values accurately describe the content. .IP "\fBget_index\fR \fIname\fR" 4 .IX Item "get_index name" Returns the content of the index file \fIname\fR as an \fB\s-1ID\s0\fR => \fBpath\fR hash. .Sp Valid \fIname\fRs are 'orig\-dirs\-index', 'orig\-files\-index', 'mod\-dirs\-index' and \&'mod\-files\-index'. .IP "\fBget_changes\fR" 4 .IX Item "get_changes" Returns a list of changes in the changeset. .IP "\fBget_all_diffs\fR" 4 .IX Item "get_all_diffs" Returns all diffs in the changeset (array or arrayref). This includes changes of types \fI\s-1MODIFY\s0\fR, \fI\s-1ADD\s0\fR and \fI\s-1DELETE\s0\fR. .IP "\fBjoin_all_diffs\fR" 4 .IX Item "join_all_diffs" Returns concatenated output of all diffs in the changeset. .IP "\fBancestor\fR" 4 .IX Item "ancestor" Return the ancestor of the changeset. If \fI=ancestor\fR file is found (that is the case for library changesets) its content is returned, otherwise try to guess the ancestor of the revision using \fBArch::Util::adjacent_revision\fR. .SH "BUGS" .IX Header "BUGS" Awaiting for your reports. .SH "AUTHORS" .IX Header "AUTHORS" Mikhael Goikhman (migo@homemail.com\*(--Perl\-GPL/arch\-perl\*(--devel). .SH "SEE ALSO" .IX Header "SEE ALSO" For more information, see tla, Arch::Session, Arch::Library, Arch::Util.