- FOR IMPLEMENTORS OF VCI::VCS MODULES: CONSTRUCTION
- SEE ALSO
VCI::Abstract::Committable - Anything that can be committed to a repository.
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.
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 be an empty string or something specified by the VCI::VCS implementation, but they will still have revision times. ("first_revision" and "last_revision" might be equal to each other, though.)
These are accessors that don't tell you about this particular file or directory, but actually tell you about its history in the repository.
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.
A VCI::Abstract::Committable representing the earliest revision for this item in the current Project.
A VCI::Abstract::Committable representing the most recent revision for this item in the current Project.
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.
The revision identifier of the particular item that you're dealing with right now. Similar to "revision" in VCI::Abstract::Commit.
This may be different than the revision id of the commit that this file/directory was committed in, because some VCSes (like CVS) have revision ids for individual files.
A datetime representing the time that this revision was committed to the repository.
The Path of this file, from the root of the project, including its filename if it's a file.
In some version-control systems, this will never change, but there are many modern systems that understand the idea of moving, renaming, or copying a file, so this could be different at different points in history.
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.
The VCI::Abstract::Directory that contains this item. If this is the root directory of the Project, then this will be
The most reliable way to check if this is the root directory is to see if this accessor returns
The VCI::Abstract::Project that this committable is in.
When you call
new on a Committable, if you don't specify
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.