[kde-services-devel] r490 - in trunk/hotstuff: . src
josef at new.kstuff.org
josef at new.kstuff.org
Sun Nov 23 10:37:51 CET 2008
Author: josef
Date: 2008-11-23 10:37:50 +0100 (Sun, 23 Nov 2008)
New Revision: 490
Modified:
trunk/hotstuff/TODO
trunk/hotstuff/src/hotstuff-scan
trunk/hotstuff/src/hotstuff-versioning
Log:
- experimental code found uncommitted as of yet: read revision and changelog from SVN information
Modified: trunk/hotstuff/TODO
===================================================================
--- trunk/hotstuff/TODO 2008-11-23 09:33:41 UTC (rev 489)
+++ trunk/hotstuff/TODO 2008-11-23 09:37:50 UTC (rev 490)
@@ -13,6 +13,8 @@
* populate changelog entries automatically when using SVN
- implement by adding changelog entries in hotstuff-versioning before calling hotstuff-scan
+* bug report by JohnFlux: SVN-backed subdirectories are stripped in the database
+
------------------------------------------------------
* stuff.xml.php, providers.xml:
Modified: trunk/hotstuff/src/hotstuff-scan
===================================================================
--- trunk/hotstuff/src/hotstuff-scan 2008-11-23 09:33:41 UTC (rev 489)
+++ trunk/hotstuff/src/hotstuff-scan 2008-11-23 09:37:50 UTC (rev 490)
@@ -312,6 +312,19 @@
}
}
+my @changes;
+my $revision;
+if(-f "$uploaddir/_changes"){
+ open(X, "$uploaddir/_changes");
+ @changes = <X>;
+ close(X);
+}
+if(-f "$uploaddir/_revision"){
+ open(X, "$uploaddir/_revision");
+ $revision = <X>;
+ close(X);
+}
+
foreach my $tmp(@newstuffs){
my %stuff = %$tmp;
@@ -455,6 +468,27 @@
"WHERE id = $tmp{'id'}";
$res = $conn->prepare($statec);
$res->execute();
+
+ if((@changes) && ($revision)){
+ my $nextid = $dbvals{"directory"};
+ my $nextcontents = $dbvals("contents");
+ #my $oldrevision = $tmp{"id"};
+ my $oldrevision = $revision - 1;
+
+ $statec = "INSERT INTO versions " .
+ "(version, revision, previous) VALUES " .
+ "($nextid, $revision, '$oldrevision')";
+ $res = $conn->prepare($statec);
+ $res->execute();
+
+ # FIXME: there's apparently a <changes> tag but neither
+ # the ghns.xsd schema nor hotstuff.sql support it!?
+ $statec = "INSERT INTO contents " .
+ "(index, type, content) VALUES "
+ "($nextcontents, 'changes', '@changes')";
+ $res = $conn->prepare($statec);
+ $res->execute();
+ }
}
}
next if $tmp{"(installed)"};
Modified: trunk/hotstuff/src/hotstuff-versioning
===================================================================
--- trunk/hotstuff/src/hotstuff-versioning 2008-11-23 09:33:41 UTC (rev 489)
+++ trunk/hotstuff/src/hotstuff-versioning 2008-11-23 09:37:50 UTC (rev 490)
@@ -73,7 +73,11 @@
print "Performing initial checkout from $repository...\n";
system("svn co $repository $downloaddir");
}else{
- system("svn up $downloaddir");
+ my $rev = `LANG=C svn info $downloaddir | grep Revision | cut -d " " -f 2`;
+ $rev += 1;
+ system("svn up -r$rev $downloaddir");
+ system("svn log --xml -r$rev $downloaddir | xmlstarlet sel -t -v '/log/logentry/msg' > $downloaddir/_changes");
+ system("echo $rev > $downloaddir/_revision");
}
system("hotstuff-scan --nomove -c $opt_config");
exit;
More information about the kde-services-devel
mailing list