Arch::Changeset(3pm)
β¨ Arch::Changeset β¨
okay bestie, so this is the manual page for Arch::Changeset β the Perl class that's literally the whole changeset concept from Arch, all wrapped up in one cute little object with some genuinely useful methods. it lives in the User Contributed Perl Documentation section, and we're gonna go through every single bit of it together. no skipping. π
πΈ NAME πΈ
Arch::Changeset β a class representing an Arch changeset. that's it, that's the vibe. she's a changeset, she's an object, she's iconic. π
π¦ SYNOPSIS π¦
so like, you can make Arch::Changeset objects directly if you already have a changeset directory sitting there. like this:
use Arch::Changeset;
my $changeset = Arch::Changeset->new(
'migo@homemail.com--Perl-GPL/arch-perl--devel--0--patch-6',
'/tmp/,,changeset-6',
);
but tbh usually they just get created indirectly by other objects, which is way more the norm:
use Arch::Session;
$changeset = Arch::Session->new->get_revision_changeset(
'migo@homemail.com--Perl-GPL/arch-perl--devel--0--patch-6'
);
use Arch::Library;
$changeset = Arch::Library->new->get_revision_changeset(
'migo@homemail.com--Perl-GPL/arch-perl--devel--0--patch-6'
);
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);
see how easy that is? the indirect route is giving effortless. β¨
π DESCRIPTION π
so this class represents the changeset concept in Arch, and it hands you a bunch of genuinely useful methods to play with. that's the whole deal. lowkey elegant, ngl. π
π METHODS π
the following methods are available:
newget_patchget_indexget_changesget_all_diffsjoin_all_diffsancestor
π new revision-spec dir-name
constructs the Arch::Changeset object that goes with the given fully-qualified revision-spec and the existing directory dir-name. so you bring the revision spec, you bring the dir, she does the rest. π«Ά
π get_patch file-path
π get_patch file-path type
π get_patch file-path type full-file-asis
returns the patch (or, y'know, whatever other content) of the given file-path inside the changeset.
type is an integer, and here's the tea:
0β unknown, try to autodetect. this one is the default.1β modified file, or a metadata change.2β new file.3β removed file.
the default behaviour is to create a fake diff against /dev/null for non-binary new and removed files. but the full-file-asis flag, if you set it to true, changes that whole situation and causes it to return the content of such a file as-is. binary new and removed files are always returned as-is regardless of that flag, no cap. also, this flag is just plain ignored if type is 1. sorry bestie, that's the rules. π
in the scalar content it returns the patch in diff(1) format (or the whole file content, as described above). in the list content it returns 4 scalars:
- the patch
- the file name on the disk containing this patch (or the whole file)
- the change type β that is
"patch","new"or"removed" - the as-is flag
the returned values that come after the first one (the patch/file content) share the order of the corresponding parameters. the parameters are more like hints, while the returned values accurately describe the content. so like, trust the return values, they're the main character here. π
π get_index name
returns the content of the index file name as an ID => path hash. so basically a little lookup table, slay.
valid names are:
'orig-dirs-index''orig-files-index''mod-dirs-index''mod-files-index'
π get_changes
returns a list of changes in the changeset. that's it. she's giving you the list. β¨
π get_all_diffs
returns all diffs in the changeset (as an array or an arrayref). this includes changes of types MODIFY, ADD and DELETE. so every kind of change, all up in there. π₯
π join_all_diffs
returns the concatenated output of all diffs in the changeset. like, all of them, glued together into one big string. it's giving compilation. π
π ancestor
returns the ancestor of the changeset. if a =ancestor file is found β which is the case for library changesets, iykyk β its content is returned. otherwise it tries to guess the ancestor of the revision using Arch::Util::adjacent_revision. detective work, but make it Perl. π΅οΈββοΈ
π BUGS π
Awaiting for your reports.
(yes bestie, that's literally all it says. they're just sitting there, waiting, manifesting your bug reports. go off.) π
π§ AUTHORS π§
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
β SEE ALSO β
for more information, see tla, Arch::Session, Arch::Library, Arch::Util.
and that's the whole page, bestie! π this one's perl v5.20.2, dated 2006-04-15 β so yeah, she's a vintage icon and she's still serving. periodt. π
π¦ where this page comes from
- ubuntu jammy: libarch-perl 0.5.2-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms