diff options
author | Sven Eden <yamakuzure@gmx.net> | 2018-05-16 07:01:59 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-05-16 07:05:40 +0200 |
commit | e83271e288268ff567828cb965608b7dc1753078 (patch) | |
tree | be5377dd64b6c1f9cf426116ccc5c3f232b4341d /pwx/migrate_tree.pl | |
parent | acc6b7f6d2b76e4919c130d26b3ae263b5bf7525 (diff) |
check_tree.pl migrate_tree.pl: Move necessary eop stuff into END blocks.
Diffstat (limited to 'pwx/migrate_tree.pl')
-rwxr-xr-x | pwx/migrate_tree.pl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pwx/migrate_tree.pl b/pwx/migrate_tree.pl index 977230101..9ecaee6b2 100755 --- a/pwx/migrate_tree.pl +++ b/pwx/migrate_tree.pl @@ -201,10 +201,10 @@ for ( my $i = 0 ; $i < $commit_count ; ++$i ) { # ---------------------------------------------------------- if ( scalar @lFiles > 1 ) { print "\nERROR: $fmt results in more than one patch!\n"; - return 0; + exit 1; } elsif ( 1 > scalar @lFiles ) { print "\nERROR: No patches found for $fmt!"; - return 0; + exit 1; } show_prg( sprintf("Reworking %s", basename( $lFiles[0] ) ) ); @@ -223,9 +223,6 @@ for ( my $i = 0 ; $i < $commit_count ; ++$i ) { } ## end for ( my $i = 0 ; $i < ...) show_prg(""); -# ----------------------------------------------------------------- -# --- 6) Write back the CSV file of mutual commits --- -set_last_mutual; # =========================== # === END OF MAIN PROGRAM === @@ -235,7 +232,11 @@ set_last_mutual; # === ==> -------- Cleanup -------- <== === # ================================================================ -length($previous_refid) and checkout_upstream($previous_refid); +END { + set_last_mutual; + length($previous_refid) and checkout_upstream($previous_refid); +} + # ================================================================ # === ==> ---- Function Implementations ---- <== === @@ -903,7 +904,7 @@ sub set_last_mutual { defined($hMutuals{$refid}{src}) and length($hMutuals{$refid}{src}) and $hMutuals{$refid}{src} = "src-" . $hMutuals{$refid}{src} or $hMutuals{$refid}{src} = "x"; - ($hMutuals{$refid}{src}) > $ref_len and $ref_len = length($hMutuals{$refid}{src}); + length($hMutuals{$refid}{src}) > $ref_len and $ref_len = length($hMutuals{$refid}{src}); defined($hMutuals{$refid}{tgt}) and length($hMutuals{$refid}{tgt}) and $hMutuals{$refid}{tgt} = "tgt-" . $hMutuals{$refid}{tgt} or $hMutuals{$refid}{tgt} = "x"; |