|
30 | 30 | $ENV{'TZ'}="UTC"; |
31 | 31 |
|
32 | 32 | our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T, |
33 | | - $opt_b,$opt_r,$opt_I,$opt_s,$opt_l,$opt_d,$opt_D); |
| 33 | + $opt_b,$opt_r,$opt_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D); |
34 | 34 |
|
35 | 35 | sub usage() { |
36 | 36 | print STDERR <<END; |
37 | 37 | Usage: ${\basename $0} # fetch/update GIT from SVN |
38 | 38 | [-o branch-for-HEAD] [-h] [-v] [-l max_rev] |
39 | 39 | [-C GIT_repository] [-t tagname] [-T trunkname] [-b branchname] |
40 | 40 | [-d|-D] [-i] [-u] [-r] [-I ignorefilename] [-s start_chg] |
41 | | - [-m] [-M regex] [SVN_URL] |
| 41 | + [-m] [-M regex] [-A author_file] [SVN_URL] |
42 | 42 | END |
43 | 43 | exit(1); |
44 | 44 | } |
45 | 45 |
|
46 | | -getopts("b:C:dDhiI:l:mM:o:rs:t:T:uv") or usage(); |
| 46 | +getopts("A:b:C:dDhiI:l:mM:o:rs:t:T:uv") or usage(); |
47 | 47 | usage if $opt_h; |
48 | 48 |
|
49 | 49 | my $tag_name = $opt_t || "tags"; |
|
68 | 68 | push (@mergerx, qr/$opt_M/); |
69 | 69 | } |
70 | 70 |
|
| 71 | +our %users = (); |
| 72 | +if ($opt_A) { |
| 73 | + die "Cannot open $opt_A\n" unless -f $opt_A; |
| 74 | + open(my $authors,$opt_A); |
| 75 | + while(<$authors>) { |
| 76 | + chomp; |
| 77 | + next unless /^(\S+?)\s*=\s*(.+?)\s*<(.+)>\s*$/; |
| 78 | + (my $user,my $name,my $email) = ($1,$2,$3); |
| 79 | + $users{$user} = [$name,$email]; |
| 80 | + } |
| 81 | + close($authors); |
| 82 | +} |
| 83 | + |
71 | 84 | select(STDERR); $|=1; select(STDOUT); |
72 | 85 |
|
73 | 86 |
|
@@ -485,6 +498,10 @@ sub commit { |
485 | 498 |
|
486 | 499 | if (not defined $author) { |
487 | 500 | $author_name = $author_email = "unknown"; |
| 501 | + } elsif ($opt_A) { |
| 502 | + die "User $author is not listed in $opt_A\n" |
| 503 | + unless exists $users{$author}; |
| 504 | + ($author_name,$author_email) = @{$users{$author}}; |
488 | 505 | } elsif ($author =~ /^(.*?)\s+<(.*)>$/) { |
489 | 506 | ($author_name, $author_email) = ($1, $2); |
490 | 507 | } else { |
|
0 commit comments