Commits

Palmer, 2E0EOL committed e74d667

Manipulate output, store the revNum as a fake label and keep the key as just the hash
(for sane comparisons / quick lookups).

Comments (0)

Files changed (1)

 {
 	my %history = ( );
 	my %Params = ( );
-	my $changeset = '0' x 12;
+	my $changeset = '-1:' . '0' x 12; # "before" tip in empty repo.
 
 	%Params = @_ if ( scalar(@_) && (scalar(@_) % 2 == 0) );
 	my $b = $Params{'Branch'} || '.'; # . means 'this' branch
 		chomp($logLine);
 		printf("Line: %s\n", $logLine);
 		if ( $logLine =~ m/^(\w+):\s+(.*)$/ ) {
-			if ( $1 eq 'changeset' ) { # New changeset?
-				$changeset = $2;
+			my ( $label, $detail ) = ( $1, $2 );
+			if ( $label eq 'changeset' ) { # New changeset?
+				if ( $detail =~ m/^(\d+):([0-9a-f]+)$/ ) {
+					$changeset = $2;
+					$history{$changeset}->{'revNum'} = $1;
+				}
 				next;
 			}
-			$history{$changeset}->{$1} = $2;
+			$history{$changeset}->{$label} = $detail;
 		}
 	}
 	return %history;