chiark / gitweb /
list: output produces # if we are on base
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 23 Jan 2012 01:42:05 +0000 (01:42 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 23 Jan 2012 01:43:25 +0000 (01:43 +0000)
tb-list.pl

index 9b76473..385e031 100755 (executable)
@@ -168,8 +168,15 @@ eval sortsub()." 1;" or die "$@ ?";
 #----- printing -----
 
 my $current_branch = current_branch();
-my $current_patch = $current_branch->{Kind} eq 'tip'
-    ? $current_branch->{Fullname} : '';
+my $current_patch = '';
+my $ifcurrent;
+if ($current_branch->{Kind} eq 'tip') {
+    $current_patch = $current_branch->{Fullname};
+    $ifcurrent = '>';
+} elsif ($current_branch->{Kind} eq 'base') {
+    $current_patch = $current_branch->{Fullname};
+    $ifcurrent = '#';
+}
 
 foreach my $p (@output) {
     my $v = $patches{$p};
@@ -180,7 +187,7 @@ foreach my $p (@output) {
        $msg =~ m/^Subject:\s*(?:\[[^][]*\]\s*)?(.*\S)\s*$/mi
        ? $1 : "[no subject]";  
     printf("%1s%1s %s\@%s/%s/%-20s %s\n",
-          $p eq $current_patch ? '>' : '',
+          $p eq $current_patch ? $ifcurrent : '',
           $v->{Info}[0]{Deleted} ? 'D' : '',
           $pa->{Email}, $pa->{Domain}, $pa->{Date}, $pa->{Nick},
           $subject)