]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Rcs/tla.pm
update
[ikiwiki.git] / IkiWiki / Rcs / tla.pm
index 48dc78157ae95b5406a6fdf61b04bb236c1f4a91..c9b64dbe5e09f4556126b5f1026c75a53fe22dc3 100644 (file)
@@ -13,7 +13,9 @@ sub quiet_system (@) {
        # See Debian bug #385939.
        open (SAVEOUT, ">&STDOUT");
        close STDOUT;
        # See Debian bug #385939.
        open (SAVEOUT, ">&STDOUT");
        close STDOUT;
+       open (STDOUT, ">/dev/null");
        my $ret=system(@_);
        my $ret=system(@_);
+       close STDOUT;
        open (STDOUT, ">&SAVEOUT");
        close SAVEOUT;
        return $ret;
        open (STDOUT, ">&SAVEOUT");
        close SAVEOUT;
        return $ret;
@@ -51,8 +53,8 @@ sub rcs_commit ($$$) { #{{{
                if (defined $rev && defined $oldrev && $rev ne $oldrev) {
                        # Merge their changes into the file that we've
                        # changed.
                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");
                        }
                }
                                warn("tla update failed\n");
                        }
                }
@@ -61,7 +63,7 @@ sub rcs_commit ($$$) { #{{{
                           "-L".possibly_foolish_untaint($message),
                           '-d', $config{srcdir}) != 0) {
                        my $conflict=readfile("$config{srcdir}/$file");
                           "-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;
                                warn("tla undo failed\n");
                        }
                        return $conflict;
@@ -103,10 +105,11 @@ sub rcs_recentchanges ($) {
                my $summ = $head->get("Summary");
                my $newfiles = $head->get("New-files");
                my $modfiles = $head->get("Modified-files");
                my $summ = $head->get("Summary");
                my $newfiles = $head->get("New-files");
                my $modfiles = $head->get("Modified-files");
+               my $remfiles = $head->get("Removed-files");
                my $user = $head->get("Creator");
 
                my $user = $head->get("Creator");
 
-               my @paths = grep {!/^.*\/\.arch-ids\/.*\.id$/} split(/ /,
-                       "$newfiles $modfiles");
+               my @paths = grep { !/^(.*\/)?\.arch-ids\/.*\.id$/ }
+                       split(/ /, "$newfiles $modfiles .arch-ids/fake.id");
 
                my $sdate = $head->get("Standard-date");
                my $when = time - str2time($sdate, 'UTC');
 
                my $sdate = $head->get("Standard-date");
                my $when = time - str2time($sdate, 'UTC');
@@ -122,7 +125,6 @@ sub rcs_recentchanges ($) {
 
                my @message;
                push @message, { line => escapeHTML($summ) };
 
                my @message;
                push @message, { line => escapeHTML($summ) };
-               $user = escapeHTML($user);
 
                my @pages;
 
 
                my @pages;
 
@@ -151,8 +153,8 @@ sub rcs_recentchanges ($) {
 
 sub rcs_notify () { #{{{
        # FIXME: Not set
 
 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}));
 
        }
        my $rev=int(possibly_foolish_untaint($ENV{REV}));
 
@@ -166,9 +168,10 @@ sub rcs_notify () { #{{{
 
        my $newfiles = $head->get("New-files");
        my $modfiles = $head->get("Modified-files");
 
        my $newfiles = $head->get("New-files");
        my $modfiles = $head->get("Modified-files");
+       my $remfiles = $head->get("Removed-files");
 
 
-       my @changed_pages = grep {!/^.*\/\.arch-ids\/.*\.id$/} split(/ /,
-               "$newfiles $modfiles");
+       my @changed_pages = grep { !/(^.*\/)?\.arch-ids\/.*\.id$/ }
+               split(/ /, "$newfiles $modfiles $remfiles .arch-ids/fake.id");
 
        if ($message =~ /$tla_webcommit/) {
                $user=defined $2 ? "$2" : "$3";
 
        if ($message =~ /$tla_webcommit/) {
                $user=defined $2 ? "$2" : "$3";