X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/99d52a1794f25ee2efc7a580e8e9bc8819811bd9..994c242994e54c98c2dad665a5fdbccc6fe0bdeb:/IkiWiki/Rcs/tla.pm diff --git a/IkiWiki/Rcs/tla.pm b/IkiWiki/Rcs/tla.pm index 0f62dfa83..c9b64dbe5 100644 --- a/IkiWiki/Rcs/tla.pm +++ b/IkiWiki/Rcs/tla.pm @@ -10,9 +10,12 @@ 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(@_); + close STDOUT; open (STDOUT, ">&SAVEOUT"); close SAVEOUT; return $ret; @@ -50,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 (system("tla", "update", "-d", - "$config{srcdir}/$file") != 0) { + if (quiet_system("tla", "update", "-d", + "$config{srcdir}") != 0) { warn("tla update failed\n"); } } @@ -60,7 +63,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; @@ -102,10 +105,11 @@ sub rcs_recentchanges ($) { 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 @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'); @@ -121,7 +125,6 @@ sub rcs_recentchanges ($) { my @message; push @message, { line => escapeHTML($summ) }; - $user = escapeHTML($user); my @pages; @@ -150,8 +153,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})); @@ -165,9 +168,10 @@ sub rcs_notify () { #{{{ 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";