summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2016-05-09 17:52:33 +0200
committerDavid Lawrence <dkl@mozilla.com>2016-05-09 17:52:33 +0200
commitee3196e7a3c314413baa15dcddb4a5f9961630d7 (patch)
tree235f9241a3aeb8de5dd3703cf0626b17e8588198
parent32be47bad06b7f122a57921d1fc834de4a4f85bc (diff)
downloadbugzilla-ee3196e7a3c314413baa15dcddb4a5f9961630d7.tar.gz
bugzilla-ee3196e7a3c314413baa15dcddb4a5f9961630d7.tar.xz
Bug 1271172 - When copying a flag that has a period in the version, the description is not incremented properly
-rw-r--r--extensions/TrackingFlags/lib/Admin.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/extensions/TrackingFlags/lib/Admin.pm b/extensions/TrackingFlags/lib/Admin.pm
index 542e990d5..1adcad241 100644
--- a/extensions/TrackingFlags/lib/Admin.pm
+++ b/extensions/TrackingFlags/lib/Admin.pm
@@ -113,8 +113,18 @@ sub admin_edit {
if ($flag->name =~ /^(\D+)(\d+)$/) {
$flag->set_name("$1" . ($2 + 1));
}
- if ($flag->description =~ /^(\D+)(\d+)$/) {
- $flag->set_description("$1" . ($2 + 1));
+ if ($flag->description =~ /^(\D+)([\d\.]+)$/) {
+ my $description = $1;
+ my $version = $2;
+ if ($version =~ /\./) {
+ my ($major, $minor) = split(/\./, $version);
+ $minor++;
+ $version = "$major.$minor";
+ }
+ else {
+ $version++;
+ }
+ $flag->set_description($description . $version);
}
$flag->set_sortkey(_next_unique_sortkey($flag->sortkey));
$flag->set_type($flag->flag_type);