- See Also
App::Sqitch::Plan::Depend - Sqitch dependency specification
my $depend = App::Sqitch::Plan::Depend->new( plan => $plan, App::Sqitch::Plan::Depend->parse('!proj:change@tag') );
An App::Sqitch::Plan::Line represents a single dependency from the dependency list for a planned change. Is is constructed by App::Sqitch::Plan and included in App::Sqitch::Plan::Change objects
my $depend = App::Sqitch::Plan::Depend->new(%params);
Instantiates and returns a App::Sqitch::Plan::Line object. Parameters:
The plan with which the dependency is associated. Required.
Name of the project. Required.
Boolean to indicate whether the dependency is a conflicting dependency.
The name of the change.
The name of the tag claimed as the dependency.
The ID of a change. Mutually exclusive with
my %params = App::Sqitch::Plan::Depend->parse($string);
Parses a dependency specification as extracted from a plan and returns a hash reference of parameters suitable for passing to
undef if the string is not a properly-formatted dependency.
my $plan = $depend->plan;
Returns the App::Sqitch::Plan object with which the dependency specification is associated.
say $depend->as_string, ' conflicts' if $depend->conflicts;
Returns true if the dependency is a conflicting dependency, and false if it is not (in which case it is a required dependency).
say $depend->as_string, ' required' if $depend->required;
Returns true if the dependency is a required, and false if it is not (in which case it is a conflicting dependency).
Returns a string indicating the type of dependency, either "require" or "conflict".
my $proj = $depend->project;
Returns the name of the project with which the dependency is associated.
Returns true if the
project parameter was passed to the constructor with a defined value, and false if it was not passed to the constructor.
my $change = $depend->change;
Returns the name of the change, if any. If
undef is returned, the dependency is a tag-only dependency.
my $tag = $depend->tag;
Returns the name of the tag, if any. If
undef is returned, the dependency is a change-only dependency.
Returns the ID of the change if the dependency was specified as an ID, or if the dependency is a local dependency.
Returns true if the
id parameter was passed to the constructor with a defined value, and false if it was not passed to the constructor.
Change ID used by the engine when deploying a change. That is, if the dependency is in the database, it will be assigned this ID from the database. If it is not in the database,
resolved_id will be undef.
Returns true if the dependency references a change external to the current project, and false if it is part of the current project.
The opposite of
is_external(): returns true if the dependency is in the internal (current) project, and false if not.
Returns the key name of the dependency, with the change name and/or tag, properly formatted for passing to the
find() method of App::Sqitch::Plan. If the dependency was specified as an ID, rather than a change or tag, then the ID will be returned.
Returns the project-qualified key name. That is, if there is a project name, it returns a string with the project name, a colon, and the key name. If there is no project name, the key name is returned.
my $string = $depend->as_string;
Returns the full stringification of the dependency, suitable for output to a plan file. That is, the same as
conflicts returns true, in which case it is prepended with "!".
David E. Wheeler <email@example.com>
Copyright (c) 2012-2020 iovation Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.