]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Rcs/tla.pm
* Numerous tla fixes from Clint.
[ikiwiki.git] / IkiWiki / Rcs / tla.pm
index 0f62dfa830123b2b9f77e7fc8772d0ed9a479dd6..61f49cc1b1665f5f071ba22bf3b1b57cf5d79a2b 100644 (file)
@@ -10,8 +10,10 @@ package IkiWiki;
 my $tla_webcommit=qr/^web commit (by (\w+)|from (\d+\.\d+\.\d+\.\d+)):?(.*)/;
 
 sub quiet_system (@) {
+       # See Debian bug #385939.
        open (SAVEOUT, ">&STDOUT");
        close STDOUT;
+       open (STDOUT, ">/dev/null");
        my $ret=system(@_);
        open (STDOUT, ">&SAVEOUT");
        close SAVEOUT;
@@ -50,8 +52,8 @@ sub rcs_commit ($$$) { #{{{
                if (defined $rev && defined $oldrev && $rev ne $oldrev) {
                        # Merge their changes into the file that we've
                        # changed.
-                       if (system("tla", "update", "-d",
-                                  "$config{srcdir}/$file") != 0) {
+                       if (quiet_system("tla", "update", "-d",
+                                  "$config{srcdir}") != 0) {
                                warn("tla update failed\n");
                        }
                }
@@ -60,7 +62,7 @@ sub rcs_commit ($$$) { #{{{
                           "-L".possibly_foolish_untaint($message),
                           '-d', $config{srcdir}) != 0) {
                        my $conflict=readfile("$config{srcdir}/$file");
-                       if (system("tla", "undo", "--quiet", "-d", "$config{srcdir}") != 0) {
+                       if (system("tla", "undo", "-n", "--quiet", "-d", "$config{srcdir}") != 0) {
                                warn("tla undo failed\n");
                        }
                        return $conflict;
@@ -104,7 +106,7 @@ sub rcs_recentchanges ($) {
                my $modfiles = $head->get("Modified-files");
                my $user = $head->get("Creator");
 
-               my @paths = grep {!/^.*\/\.arch-ids\/.*\.id$/} split(/ /,
+               my @paths = grep {!/^(.*\/\)?.arch-ids\/.*\.id$/} split(/ /,
                        "$newfiles $modfiles");
 
                my $sdate = $head->get("Standard-date");
@@ -121,7 +123,6 @@ sub rcs_recentchanges ($) {
 
                my @message;
                push @message, { line => escapeHTML($summ) };
-               $user = escapeHTML($user);
 
                my @pages;
 
@@ -150,8 +151,8 @@ sub rcs_recentchanges ($) {
 
 sub rcs_notify () { #{{{
        # FIXME: Not set
-       if (! exists $ENV{REV}) {
-               error("REV is not set, not running from tla post-commit hook, cannot send notifications");
+       if (! exists $ENV{ARCH_VERSION}) {
+               error("ARCH_VERSION is not set, not running from tla post-commit hook, cannot send notifications");
        }
        my $rev=int(possibly_foolish_untaint($ENV{REV}));
 
@@ -166,7 +167,7 @@ sub rcs_notify () { #{{{
        my $newfiles = $head->get("New-files");
        my $modfiles = $head->get("Modified-files");
 
-       my @changed_pages = grep {!/^.*\/\.arch-ids\/.*\.id$/} split(/ /,
+       my @changed_pages = grep {!/(^.*\/)?\.arch-ids\/.*\.id$/} split(/ /,
                "$newfiles $modfiles");
 
        if ($message =~ /$tla_webcommit/) {