aboutsummaryrefslogtreecommitdiffstats
path: root/Perl/Webwml
diff options
context:
space:
mode:
authorSteve McIntyre <93sam>2018-05-30 02:26:19 +0000
committerSteve McIntyre <93sam>2018-05-30 02:26:19 +0000
commitafdb29732ca24242f1a2e94f98e90034f9925f46 (patch)
treee7fd6434eca8cdc6b4d1f8b917290cc45af5b374 /Perl/Webwml
parent85831e64ab93ed694a25e2e6ccaaff73d9fddeea (diff)
Major updates to perl scripts
Add new git backend in VCS_git.pm Switch from an old-style set of function calls to an OO API. This allows for initialisation and some state to be kept in the VCS_git.pm module - namely a per-file cache of commit hashes for a massive performance boost when doing lots of lookups. Extend the API with 2 new utility functions: * get_oldest_revision() * next_revision() Extended the vcs_cmp_rev() function to take a filename too. Add a test harness to validate the git and cvs backends. Add switch_to_git_translations.pl to walk the tree and switch from cvs revisions to git commit hashes in translation-check headers. Change all of our local scripts to use the new Local::VCS frontend *where it makes sense*. Some scripts will behave slightly differently, as the new world can't exactly match the old behaviour. CVS version numbers check_desc_trans.pl: 1.9 -> 1.10 check_trans.pl: 1.93 -> 1.94 copypage.pl: 1.42 -> 1.43 karma.pl: 1.6 -> 1.7 remove_stale.pl: 1.22 -> 1.23 smart_change.pl: 1.8 -> 1.9 stattrans.pl: 1.127 -> 1.128 switch_to_git_translations.pl: INITIAL -> 1.1 touch_translations.pl: 1.9 -> 1.10 vcs-test.pl: INITIAL -> 1.1 Perl/Local/Util.pm: 1.4 -> 1.5 Perl/Local/VCS.pm: 1.3 -> 1.4 Perl/Local/VCS_CVS.pm: 1.13 -> 1.14 Perl/Local/VCS_git.pm: 1.12 -> 1.13 Perl/Webwml/Langs.pm: 1.5 -> 1.6 Perl/Webwml/TransIgnore.pm: 1.3 -> 1.4
Diffstat (limited to 'Perl/Webwml')
-rw-r--r--Perl/Webwml/Langs.pm7
-rw-r--r--Perl/Webwml/TransIgnore.pm5
2 files changed, 7 insertions, 5 deletions
diff --git a/Perl/Webwml/Langs.pm b/Perl/Webwml/Langs.pm
index 4df3ecb6631..16857146ff2 100644
--- a/Perl/Webwml/Langs.pm
+++ b/Perl/Webwml/Langs.pm
@@ -34,7 +34,7 @@ the list of languages in which Debian web site is translated.
package Webwml::Langs;
use Carp;
-use Local::VCS 'vcs_get_topdir';
+use Local::VCS;
use strict;
use warnings;
@@ -52,13 +52,14 @@ determined from VCS meta-info.
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
+ my $VCS = Local::VCS->new();
my $root;
if (@_)
{
$root = shift;
} else
{
- $root = vcs_get_topdir;
+ $root = $VCS->get_topdir();
}
my $self = _read($root);
bless ($self, $class);
@@ -72,7 +73,7 @@ sub new {
# TODO: or rather define the lnaguages in a module, and include those in
# languages.wml
sub _read {
- my $root = shift || vcs_get_topdir;
+ my $root = shift || Local::VCS->get_topdir();
open( my $file, '<', "$root/english/template/debian/languages.wml")
or croak ("Unable to read $root/english/template/debian/languages.wml");
diff --git a/Perl/Webwml/TransIgnore.pm b/Perl/Webwml/TransIgnore.pm
index d3f6b7e9234..a06f987ff87 100644
--- a/Perl/Webwml/TransIgnore.pm
+++ b/Perl/Webwml/TransIgnore.pm
@@ -33,7 +33,7 @@ package Webwml::TransIgnore;
use Carp;
use File::Spec::Functions;
-use Local::VCS qw{ vcs_get_topdir };
+use Local::VCS;
use strict;
use warnings;
@@ -64,7 +64,8 @@ sub new
bless ($self, $class);
# determine the root dir
- my $root = shift || vcs_get_topdir('.');
+ my $VCS = Local::VCS->new();
+ my $root = shift || $VCS->get_topdir('.');
# Read global .transignore file
$self->_read($root);

© 2014-2024 Faster IT GmbH | imprint | privacy policy