From 970ce063ee0c17b69ee5343d6934faab479f6ed8 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Mon, 4 Feb 2008 00:12:01 -0800 Subject: [PATCH] Fixed finding of parent's description when @ARGV doesn't mention it. --- support/patch-update | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/support/patch-update b/support/patch-update index 502380df..a76f111d 100755 --- a/support/patch-update +++ b/support/patch-update @@ -56,16 +56,9 @@ if ($incl_generated_files) { my $last_touch = time; my(@patches, %local_patch); -if (@ARGV) { - foreach (@ARGV) { - s{^(patches|patch|origin/patch)/} {}; - s{\.diff$} {}; - push(@patches, $_); - } - open(PIPE, '-|', 'git', 'branch', '-l') or die $!; -} else { - open(PIPE, '-|', 'git', 'branch', '-a') or die $!; -} + +# Start by finding all patches so that we can load all possible parents. +open(PIPE, '-|', 'git', 'branch', '-a') or die $!; while () { if (m# origin/patch/(.*)#) { push(@patches, $1); @@ -93,6 +86,16 @@ foreach my $patch (@patches) { $description{$patch} = $desc; } +if (@ARGV) { + # Limit the list of patches to actually process based on @ARGV. + @patches = ( ); + foreach (@ARGV) { + s{^(patches|patch|origin/patch)/} {}; + s{\.diff$} {}; + push(@patches, $_); + } +} + my %completed; foreach my $patch (@patches) { next if $completed{$patch}++; -- 2.34.1