Commit 00f3ccc5 authored by drumm's avatar drumm
Browse files

Remove semver feature flag, it is always allowed

parent 6ae49b88
......@@ -80,7 +80,7 @@ class DrupalorgVersioncontrolLabelVersionMapperGit implements VersioncontrolRele
}
$api_term = $matches['api_term'];
}
elseif (self::isSemverAllowed($project_node) && preg_match('/^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<extra>(?:alpha|beta|rc)\d+))?$/', $tag_name, $matches)) {
elseif (preg_match('/^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<extra>(?:alpha|beta|rc)\d+))?$/', $tag_name, $matches)) {
$version->version_major = $matches['major'];
$version->version_minor = $matches['minor'];
$version->version_patch = $matches['patch'];
......@@ -142,7 +142,7 @@ class DrupalorgVersioncontrolLabelVersionMapperGit implements VersioncontrolRele
$version->version_major = $matches['major'];
$api_term = $matches['api_term'];
}
elseif (self::isSemverAllowed($project_node) && preg_match('/^(?<major>\d+)(?:\.(?<minor>\d+))?\.x$/', $branch_name, $matches)) {
elseif (preg_match('/^(?<major>\d+)(?:\.(?<minor>\d+))?\.x$/', $branch_name, $matches)) {
$version->version_major = $matches['major'];
if (isset($matches['minor'])) {
$version->version_minor = $matches['minor'];
......@@ -199,24 +199,4 @@ class DrupalorgVersioncontrolLabelVersionMapperGit implements VersioncontrolRele
return TRUE;
}
/**
* Determine if semantic versioning is allowed for a project.
*
* @param object $project
* A project node.
*
* @return bool
* TRUE if the allowed version format string contains 'patch'.
*/
private static function isSemverAllowed($project) {
if (empty($project->field_release_version_format)) {
$format_string = variable_get('project_release_version_format_' . project_release_release_node_types()[0], '');
}
else {
$format_string = $project->field_release_version_format[LANGUAGE_NONE][0]['value'];
}
return strpos($format_string, 'patch') !== FALSE;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment