You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/09/12 17:21:18 UTC
svn commit: r1169794 - /httpd/docs-build/trunk/lib/metafile.pl
Author: sf
Date: Mon Sep 12 15:21:18 2011
New Revision: 1169794
URL: http://svn.apache.org/viewvc?rev=1169794&view=rev
Log:
In a git repo, LastChangedRevision is not updated in the xml files. In this
case, try to determine it from the revision log when checking for out-of-date
translations.
This is not perfect, as it doesn't work for files with modifications which
have not been committed to svn.
Modified:
httpd/docs-build/trunk/lib/metafile.pl
Modified: httpd/docs-build/trunk/lib/metafile.pl
URL: http://svn.apache.org/viewvc/httpd/docs-build/trunk/lib/metafile.pl?rev=1169794&r1=1169793&r2=1169794&view=diff
==============================================================================
--- httpd/docs-build/trunk/lib/metafile.pl (original)
+++ httpd/docs-build/trunk/lib/metafile.pl Mon Sep 12 15:21:18 2011
@@ -29,6 +29,7 @@
# against fat fingers
use strict;
+use warnings;
# for file operations
use FindBin;
@@ -152,6 +153,7 @@ for $file (@files) {
}
} # for (@files)
+my $no_git;
# get revision of the english original
sub reven($$) {
my $dirname = shift;
@@ -176,6 +178,22 @@ sub reven($$) {
$revs{"$dirname$basename"} = $rev;
}
+ unless ($rev || $no_git) {
+ # LastChangedRevision is not available with git-svn or a git checkout
+ # from git.apache.org. Try to get the revision from the log.
+ my $curpath = docpath("$dirname$basename.xml");
+ # XXX: This does not work if there has been a local commit
+ my $log = qx{git log -1 $curpath 2> /dev/null};
+ if ($? == 0) {
+ if ( $log =~ /git-svn-id:[^\@]+\@(\d+)\s/ ) {
+ $revs{"$dirname$basename"} = $rev = $1;
+ }
+ }
+ else {
+ # no git repo
+ $no_git = 1;
+ }
+ }
return $rev;
}