Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cvsimport: introduce -L<imit> option to workaround memory leaks
author
Martin Langhoff
<martin@catalyst.net.nz>
Mon, 22 May 2006 11:38:08 +0000
(23:38 +1200)
committer
Junio C Hamano
<junkio@cox.net>
Tue, 23 May 2006 07:29:35 +0000
(
00:29
-0700)
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
7f7e6ea
)
diff --git
a/git-cvsimport.perl
b/git-cvsimport.perl
index d257e668d6241b03fad0fbffcd4306694017f703..6c232c0d4bde99fbb9fd48d9a5cd8f10f041579e 100755
(executable)
--- a/
git-cvsimport.perl
+++ b/
git-cvsimport.perl
@@
-29,7
+29,7
@@
$SIG{'PIPE'}="IGNORE";
$ENV{'TZ'}="UTC";
$SIG{'PIPE'}="IGNORE";
$ENV{'TZ'}="UTC";
-our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M,$opt_A,$opt_S);
+our($opt_h,$opt_o,$opt_v,$opt_k,$opt_u,$opt_d,$opt_p,$opt_C,$opt_z,$opt_i,$opt_P, $opt_s,$opt_m,$opt_M,$opt_A,$opt_S
,$opt_L
);
my (%conv_author_name, %conv_author_email);
sub usage() {
my (%conv_author_name, %conv_author_email);
sub usage() {
@@
-85,7
+85,7
@@
($)
close ($f);
}
close ($f);
}
-getopts("hivmkuo:d:p:C:z:s:M:P:A:S:") or usage();
+getopts("hivmkuo:d:p:C:z:s:M:P:A:S:
L:
") or usage();
usage if $opt_h;
@ARGV <= 1 or usage();
usage if $opt_h;
@ARGV <= 1 or usage();
@@
-719,6
+719,7
@@
sub commit {
}
};
}
};
+my $commitcount = 1;
while(<CVS>) {
chomp;
if($state == 0 and /^-+$/) {
while(<CVS>) {
chomp;
if($state == 0 and /^-+$/) {
@@
-852,6
+853,9
@@
sub commit {
} elsif($state == 9 and /^\s*$/) {
$state = 10;
} elsif(($state == 9 or $state == 10) and /^-+$/) {
} elsif($state == 9 and /^\s*$/) {
$state = 10;
} elsif(($state == 9 or $state == 10) and /^-+$/) {
+ if ($opt_L && $commitcount++ >= $opt_L) {
+ last;
+ }
commit();
$state = 1;
} elsif($state == 11 and /^-+$/) {
commit();
$state = 1;
} elsif($state == 11 and /^-+$/) {