chiark / gitweb /
Move old update algorith, which is very wrong according to new THEORY, into its own...
[topbloke.git] / tb-list.pl
index 1e952704a152cdf08da42eb617e51d1a5aaabe26..385e031c4fa22c6df28599c1b9d6e0ebe5d72588 100755 (executable)
@@ -150,7 +150,7 @@ sub sortsub () {
            foreach my $ix (qw(0 1)) {
                my $ab = (qw(a b))[$ix];
                my $ba = (qw(b a))[$ix];
-               my $r = (qw(-1 1))[$ix];
+               my $r = (qw(1 -1))[$ix];
                $txt .= "    return $r if \$v${ab}->{Info}[3]{\$$ba};\n";
            }
         } else {
@@ -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)