NAME
VCI::Abstract::Committable - Anything that can be committed to a repository.
DESCRIPTION
This is a Moose::Role that represents any item that can be committed to a repository. In other words, a File or a Directory.
It represents it at a specific time in its history, so it has a revision identifier and time.
CONSTRUCTION
When you call new
on a Committable, if you don't specify revision
and time
, then we assume that you're talking about the most recent version that's in the repository, and "revision" and "time" will return the revision and time of the most recent revision.
METHODS
Accessors
All accessors are read-only.
A lot of these accessors have to do with revision identifiers. Some committables (such as directories) might not have revision identifiers of their own in certain types of version-control systems. In this case, the revision identifiers will always be undef
, but they will still have revision times. (</first_revision> and "last_revision" might be equal to each other, though.)
Information About The History of the Item
These are accessors that don't tell you about this particular file or directory, but actually tell you about its history in the repository.
history
-
A VCI::Abstract::History representing the history of all commits to this item.
Note that this VCI::Abstract::History object is only guaranteed to have information about this file or directory--it may or may not contain information about commits to other items.
first_revision
-
A VCI::Abstract::Committable representing the earliest revision for this item in the current Project.
This will be the same type of Committable as the current one. (For example, if this is a VCI::Abstract::File, then
first_revision
will also be a VCI::Abstract::File.) last_revision
-
A VCI::Abstract::Committable representing the most recent revision for this item in the current Project.
This will be the same type of Committable as the current one. (For example, if this is a VCI::Abstract::File, then
last_revision
will also be a VCI::Abstract::File.)
Information About This Point In History
This is the current revision and time of the specific item you're looking at right now. If you're looking at an old verion of the file/directory, it may not be the same as the information about the most recent revision.
revision
-
The revision identifier of the particular item that you're dealing with right now.
time
-
A timestamp (an integer number of seconds since January 1, 1970) representing the time that this revision was committed to the repository.
path
-
The file system path, from the project directory, of this file, including its filename if it's a file.
In most version-control systems, this will never change, but there are some modern systems that understand the idea of moving or renaming a file, so this could be different at different points in history.
name
-
The particular name of just this item, without its full path. If it's a directory, it will just be the name of the directory (without any separators like
/
).Just like "path", this may change over time in some version-control systems.
For the root directory of a project, this will be an empty string.
parent
-
The VCI::Abstract::Directory that contains this item. If this is the root directory of the Project, then this will be
undef
.The most reliable way to check if this is the root directory is to see if this accessor returns
undef
. project
-
The VCI::Abstract::Project that this committable is in.