@matheusbsbs / matheus-bagliano / commits / ded9f40059
Fork 0

cvsimport: skip commits that are too recent (option and documentation)

This makes the earlier "wait for 10 minutes before importing" safety overridable with "-a(ll)" flag, and adds necessary documentation. Signed-off-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>

Martin Langhoff committed Jan 8, 2007 at 19:43 UTC ded9f40059b185cd88569aa349784f140418f400
2 files changed +11 -4
Documentation/git-cvsimport.txt
+6 -1
@@ -90,7 +90,8 @@ If you need to pass multiple options, separate them with a comma.
90 Print a short usage message and exit.
91
92 -z <fuzz>::
93 - Pass the timestamp fuzz factor to cvsps.
93 + Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
94 + cvsps defaults to 300s.
95
96 -s <subst>::
97 Substitute the character "/" in branch names with <subst>
@@ -99,6 +100,10 @@ If you need to pass multiple options, separate them with a comma.
100 CVS by default uses the unix username when writing its
101 commit logs. Using this option and an author-conv-file
102 in this format
103 +
104 +-a::
105 + Import all commits, including recent ones. cvsimport by default
106 + skips commits that have a timestamp less than 10 minutes ago.
107 +
108 ---------
109 exon=Andreas Ericsson <ae@op5.se>
git-cvsimport.perl
+5 -3
@@ -29,7 +29,7 @@ use IPC::Open2;
29 $SIG{'PIPE'}="IGNORE";
30 $ENV{'TZ'}="UTC";
31
32 -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);
32 +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, $opt_a);
33 my (%conv_author_name, %conv_author_email);
34
35 sub usage() {
@@ -37,7 +37,7 @@ sub usage() {
37 Usage: ${\basename $0} # fetch/update GIT from CVS
38 [-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
39 [-p opts-for-cvsps] [-C GIT_repository] [-z fuzz] [-i] [-k] [-u]
40 - [-s subst] [-m] [-M regex] [-S regex] [CVS_module]
40 + [-s subst] [-a] [-m] [-M regex] [-S regex] [CVS_module]
41 END
42 exit(1);
43 }
@@ -105,6 +105,8 @@ if ($opt_d) {
105 }
106 $opt_o ||= "origin";
107 $opt_s ||= "-";
108 +$opt_a ||= 0;
109 +
110 my $git_tree = $opt_C;
111 $git_tree ||= ".";
112
@@ -829,7 +831,7 @@ while (<CVS>) {
831 $state = 11;
832 next;
833 }
832 - if ( $starttime - 300 - (defined $opt_z ? $opt_z : 300) <= $date) {
834 + if (!$opt_a && $starttime - 300 - (defined $opt_z ? $opt_z : 300) <= $date) {
835 # skip if the commit is too recent
836 # that the cvsps default fuzz is 300s, we give ourselves another
837 # 300s just in case -- this also prevents skipping commits