r17178 - /scripts/svn-tag-pending-bugs

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Tue Mar 11 08:37:08 UTC 2008


Author: dmn
Date: Tue Mar 11 08:37:07 2008
New Revision: 17178

URL: http://svn.debian.org/wsvn/?sc=1&rev=17178
Log:
Tag bugs closed by commits as pending

Added:
    scripts/svn-tag-pending-bugs   (with props)

Added: scripts/svn-tag-pending-bugs
URL: http://svn.debian.org/wsvn/scripts/svn-tag-pending-bugs?rev=17178&op=file
==============================================================================
--- scripts/svn-tag-pending-bugs (added)
+++ scripts/svn-tag-pending-bugs Tue Mar 11 08:37:07 2008
@@ -1,0 +1,62 @@
+#!/usr/bin/perl -w
+
+# Find bugs closed by this commit and tag them pending in the BTS
+#
+# Synopsis: $0 repos_path revision
+#
+# Copyright © 2008 Damyan Ivanov <dmn at debian.org>
+#
+# This program is free software. You may distribute it under
+# the terms of Perl
+
+use strict;
+use SVN::Client;
+use Mail::Send;
+use File::Basename qw(basename);
+use Sys::Hostname::Long;
+
+my( $repo_path, $revision ) = @ARGV;
+
+my $svn = SVN::Client->new();
+my ( $package, $author, $log );
+
+$svn->log(
+  [ "file://$repo_path" ],
+  $revision, $revision, 1, 1, 
+  sub {
+    my %p = %{$_[0]};
+    (keys %p)[0] =~ m{/trunk/([^/]+)/.+};
+    $package = $1;
+    
+    $author = $_[2]; $log = $_[4];
+  },
+);
+
+my @bugs;
+my $log_copy = $log;
+while( $log_copy =~ s/(closes:\s*(?:bug)?\#\s*\d+(?:,\s*(?:bug)?\#\s*\d+)*)//is )
+{
+  my $match = $1;
+  push @bugs, $1 while $match =~ s/#(\d+)//;
+}
+
+exit unless @bugs;
+
+my @who = getpwuid(getpwnam($author));
+$author = "$who[6] ($who[0])";
+
+my $msg = Mail::Send->new(
+  Subject=>"Bug in $package fixed in revision $revision",
+  Bcc	=> 'control at bugs.debian.org',
+);
+$msg->add('X-Mailer', (basename $0).' running on '.hostname_long);
+$msg->add('X-Svn-Repository', $repo_path);
+
+$msg->to( join(', ', map( "$_-submitter\@bugs.debian.org", @bugs )) );
+
+my $out = $msg->open();
+$out->print("tag $_ pending\n") foreach @bugs;
+$out->print("thanks\n\n");
+$out->print("Some bugs are closed in revision $revision\nby $author\n\n");
+$out->print("Commit message:\n\n$log\n");
+$out->close;

Propchange: scripts/svn-tag-pending-bugs
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-perl-cvs-commits mailing list