]> git.donarmstrong.com Git - debbugs.git/commitdiff
Merge branch 'master' into cgiencoding
authorDon Armstrong <don@donarmstrong.com>
Fri, 6 Jul 2012 17:55:47 +0000 (10:55 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 6 Jul 2012 17:55:47 +0000 (10:55 -0700)
Debbugs/CGI/Bugreport.pm
Makefile
debian/changelog
debian/control
t/11_blocks.t
t/cover_lib/Safe.pm [new file with mode: 0644]
templates/en_US/cgi/short_bug_status.tmpl

index 8589ac9a71f971217472b2cd8c749d27f52b0a44..02e6fba3a84431f773ab6077349bd549f64d29cc 100644 (file)
@@ -339,9 +339,12 @@ sub handle_record{
                       (\d+(?:,\s+\d+)*(?:\,?\s+and\s+\d+)?)}
                      {$1.(defined $3?$2.bug_links(bug=>$3):'').$4.
                           english_join([map {bug_links(bug=>$_)} (split /\,?\s+(?:and\s+)?/, $5)])}xeo;
+         $output =~ s{([Aa]dded|[Rr]emoved)( indication that bug )(\d+)( blocks )([\d\s\,]+)}
+                     {$1.$2.(bug_links(bug=>$3)).$4.
+                          english_join([map {bug_links(bug=>$_)} (split /\,?\s+(?:and\s+)?/, $5)])}eo;
          # Add links to reassigned packages
          $output =~ s{(Bug reassigned from package \`)([^']+?)((?:'|\&\#39;) to \`)([^']+?)((?:'|\&\#39;))}
-         {$1.q(<a href=").html_escape(pkg_url(pkg=>$2)).qq(">$2</a>).$3.q(<a href=").html_escape(pkg_url(pkg=>$4)).qq(">$4</a>).$5}eo;
+         {$1.q(<a href=").html_escape(package_links(package=>$2)).qq(">$2</a>).$3.q(<a href=").html_escape(package_links(package=>$4)).qq(">$4</a>).$5}eo;
          if (defined $time) {
               $output .= ' ('.strftime('%a, %d %b %Y %T GMT',gmtime($time)).') ';
          }
index e92a5f603d8e31a27c6106252e2691196b202486..da8de6085d0c1fc8611bdd633d77350c9d003bd0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -34,6 +34,9 @@ build:
 test:
        $(PERL) -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))'
 
+testcover:
+       PERLLIB=t/cover_lib/ cover -test
+
 clean:
        if [ -e Makefile.perl ]; then \
                $(MAKE) -f Makefile.perl clean; \
index 2efedc5d063246d0fd16ab69cf187ca735beed00..c7a071ccff3687ee7fe296d52dd9033353d7fb8d 100644 (file)
@@ -3,7 +3,13 @@ debbugs (2.4.2~exp2) experimental; urgency=low
   * Hack around elinks css bug (closes: #593804)
   * affects now appends packages by default (closes: #656371). Thanks to
     Andreas Beckmann and Julien Cristau.
+  * Fix spacing in owner block (closes: #670411)
 
+  [Thanks to Arnout Engelen: ]
+  * Add Homepage (closes: #670555).
+  * Fix VCS in control (closes: #670556).
+  * Link to blocked bugs (closes: #670568).
+  
  -- Don Armstrong <don@debian.org>  Wed, 25 Aug 2010 01:57:38 -0700
 
 debbugs (2.4.2~exp1) experimental; urgency=low
index a4550fa06ad8d183cab4974cf8d452a5827cef06..ee365efdecc5ec36077ec06b9d346143286c94a9 100644 (file)
@@ -4,8 +4,8 @@ Priority: extra
 Maintainer: Debbugs developers <debian-debbugs@lists.debian.org>
 Uploaders: Colin Watson <cjwatson@debian.org>, Don Armstrong <don@debian.org>
 Standards-Version: 3.8.2
-Vcs-Bzr: http://bugs.debian.org/debbugs-source/mainline
 Vcs-Browser: http://bugs.debian.org/debbugs-source/mainline
+Vcs-Git: http://bugs.debian.org/debbugs-source/debbugs.git
 Build-Depends: debhelper (>= 5)
 Build-Depends-Indep: libparams-validate-perl,
  libmailtools-perl, libmime-tools-perl, libio-stringy-perl, libmldbm-perl,
@@ -14,6 +14,7 @@ Build-Depends-Indep: libparams-validate-perl,
  libmail-rfc822-address-perl, libsafe-hole-perl, libuser-perl,
  libconfig-simple-perl, libtest-pod-perl, liblist-moreutils-perl,
  libtext-template-perl
+Homepage: http://wiki.debian.org/Teams/Debbugs
 
 Package: debbugs
 Architecture: all
index 553fe251ef16e200084536eeb4828b34fc7eb447..11c765ac5cdaaebf07d69b503eb694db9dd87551 100644 (file)
@@ -1,6 +1,6 @@
 # -*- mode: cperl;-*-
 
-use Test::More tests => 14;
+use Test::More tests => 20;
 
 use warnings;
 use strict;
@@ -21,6 +21,7 @@ use File::Basename qw(dirname basename);
 use lib qw(t/lib);
 use DebbugsTest qw(:all);
 use Data::Dumper;
+use Test::WWW::Mechanize;
 
 # HTTP::Server:::Simple defines a SIG{CHLD} handler that breaks system; undef it here.
 $SIG{CHLD} = sub {};
@@ -159,3 +160,36 @@ ok(system('sh','-c','find '.$sendmail_dir.q( -type f | xargs grep -q "Subject: P
 
 $status = read_bug(bug=>3);
 ok($status->{blockedby} eq '5','bug 3 is blocked by exactly 5');
+
+# Check how this blocked bug is presented on the web interface
+
+# start up an HTTP::Server::Simple
+my $bugreport_cgi_handler = sub {
+     # I do not understand why this is necessary.
+     $ENV{DEBBUGS_CONFIG_FILE} = "$config{config_dir}/debbugs_config";
+     my $content = qx(perl -I. -T cgi/bugreport.cgi);
+     $content =~ s/^\s*Content-Type:[^\n]+\n*//si;
+     print $content;
+};
+
+my $port = 11342;
+
+ok(DebbugsTest::HTTPServer::fork_and_create_webserver($bugreport_cgi_handler,$port),
+   'forked HTTP::Server::Simple successfully');
+
+my $mech = Test::WWW::Mechanize->new();
+
+$mech->get_ok('http://localhost:'.$port.'/?bug=10',
+             'Page received ok');
+
+ok($mech->content() =~ qr//i,
+   'Title of bug is \'Submitting a bug\'');
+
+ok($mech->content() =~ qr/Added blocking bug\(s\) of <a[^>]+10[^>]+>10<\/a>: <a[^>]+2[^>]+>2<\/a>/i,
+   '\'Added blocking bug(s) of x: y\' received markup');
+
+$mech->get_ok('http://localhost:'.$port.'/?bug=2',
+             'Page received ok');
+
+ok($mech->content() =~ qr/Added indication that bug <a[^>]+2[^>]+>2<\/a> blocks <a[^>]+10[^>]+>10<\/a>/i,
+   '\'indication that bug x blocks y\' received markup');
diff --git a/t/cover_lib/Safe.pm b/t/cover_lib/Safe.pm
new file mode 100644 (file)
index 0000000..e3227c2
--- /dev/null
@@ -0,0 +1,31 @@
+# this is a tiny module which basically provides a fake safe for use with Devel::Cover
+package Safe;
+
+sub new {
+    my $class = shift;
+    my $self = {root => 'fakeSafe'};
+    bless ($self,$class);
+    return $self;
+}
+
+sub permit {
+}
+
+sub reval {
+    my ($self,$code) = @_;
+    eval "package $self->{root}; $code";
+}
+
+sub root {
+    my ($self) = @_;
+    return($self->{root});
+}
+
+sub varglob {
+    my ($self,$var) = @_;
+    no strict 'refs';
+    no warnings 'once';
+    return *{$self->{root}."::$var"};
+}
+
+1;
index 685d93f8d4e4068a1edc5fe2482c1fb9b60f0e6f..821a4594d9cd4d217bc86105fbf34c9f433a98ea 100644 (file)
@@ -48,7 +48,7 @@
   <span>Date: {$status{date_text}};</span>
 { my $output = ''; 
   if (defined $status{owner} and length $status{owner}) {
-     $output = q(<span>Owned by: ).package_links(owner=>$status{owner}).q(;</span>);
+     $output = q(<span>Owned by: ).package_links(owner=>$status{owner}).qq(;</span>\n);
   }
   $output;
 }<span>Severity: {my $output = $status{severity};