]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-cvsimport.perl
Merge branch 'lt/rev-list-gitlink'
[git.git] / git-cvsimport.perl
index 2954fb846e3372a648124d92b7c1a1ccbd44306f..efa6a0c41ad5a253047789e8ac2a30bf57f8646d 100755 (executable)
@@ -223,7 +223,8 @@ sub conn {
                        }
                }
 
-               $user="anonymous" unless defined $user;
+               # if username is not explicit in CVSROOT, then use current user, as cvs would
+               $user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
                my $rr2 = "-";
                unless ($port) {
                        $rr2 = ":pserver:$user\@$serv:$repo";
@@ -818,6 +819,7 @@ while (<CVS>) {
                $state = 4;
        } elsif ($state == 4 and s/^Branch:\s+//) {
                s/\s+$//;
+               tr/_/\./ if ( $opt_u );
                s/[\/]/$opt_s/g;
                $branch = $_;
                $state = 5;