$S = "\001"; #$S = ";"; # @ # % * escapes... # sub p4_esc { my ($path) = (@_); $path =~ s/%/%23/g; $path =~ s/^\@/\001/; $path =~ s/\@$/\001/; $path =~ s/\@\@/%40/g; $path =~ s/^\001/\@/; $path =~ s/\001$/\@/; $path =~ s/#/%25/g; $path =~ s/\*/%2a/g; return $path; } sub atq { my ($s) = @_; $s =~ s/\@/\@\@/g; return "\@$s\@"; } sub traverse { local($dir, $lev, $onfile, $ondir, $onsymlink) = @_; local($dirent); local($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks); local($dirhandle) = "dh$lev"; opendir($dirhandle, $dir); while (($dirent = readdir($dirhandle))) { if ($dirent eq "." || $dirent eq "..") { next; } ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = lstat("$dir/$dirent"); typsw: { -f _ && do { if (defined(&$onfile)) { &$onfile("$dir", "$dirent"); } last typsw; } ; -d _ && do { if (defined(&$ondir)) { &$ondir("$dir", "$dirent"); } do traverse("$dir/$dirent", $lev+1, $onfile, $ondir, $onsymlink); last typsw; } ; -l "$dir/$dirent" && do { if (defined(&$onsymlink)) { &$onsymlink("$dir", "$dirent"); } if ($SYM_SPECIAL && $lev == 0) { do traverse("$dir/$dirent", $lev+1, $onfile, $ondir, $onsymlink); } last typsw; } ; } } closedir($dirhandle); } sub rm { my($path) = @_; my($sts) = 0; if (-e $path) { print "$Myname> unlink $path\n"; $sts = unlink $path; $sts = (! $sts); if ($sts) { print ("$Myname: *** \"unlink $path\" returned $sts\n"); } } return $sts; } sub s { my ($cmd, $doit) = @_; my ($sts); if (! defined($doit)) { $doit = 1; } if (! $doit) { print "$Myname; $cmd\n"; return; } print "$Myname> $cmd\n"; if (($sts = system($cmd)) != 0) { my $sig = $sts & 0x0f; $sts = $sts >> 8; print ("$Myname: *** \"$cmd\" exited with signal $sig status $sts\n"); return $sts; } return 0; } sub p4d_vers { my ($P4D) = @_; my $v = `$P4D -V`; my ($y, $r) = ($v =~ m/\nRev. P4D\/[^\/]+\/(\d+)\.(\d+).*\//); if (! $v || ! $r) { print "$Myname: cannot recognize p4d version in:\n$v\n"; exit 1; } return ($y, $r); } 1;
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#10 | 8160 | michael |
Archive obsolete CVS to Perforce converter. See the Perforce KB and website for an updated CVS to Perforce converter. |
||
#9 | 7274 | Richard Geiger | Integrate dev changes to become 3.1 | ||
#8 | 5649 | Richard Geiger | Integrate 3.0b5, b6 changes... | ||
#7 | 5619 | Richard Geiger | Changes for 3.0b4 | ||
#6 | 5601 | Richard Geiger | Integrate 3.0 changes, preparing to publish. | ||
#5 | 4923 | Richard Geiger | Integrate 2.5.1-3 changes. | ||
#4 | 4735 | Richard Geiger |
This is release 2.5, which handles those four extra special characters Perforce 2004.2 kind-of allows :-) |
||
#3 | 1786 | rmg | Publish 2.0 | ||
#2 | 256 | james | push cvs2p4 1.2.6 to public area | ||
#1 | 152 | Laura Wingerd | cvs2p4 goes public. | ||
//guest/richard_geiger/utils/cvs2p4/lib/util.pl | |||||
#1 | 130 | Richard Geiger |
CVS-to-Perforce converter. This is release 1.2.2 (first submit to the Perforce Public Depot) |