File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -2309,6 +2309,9 @@ sub filenamesplit
2309
2309
return ( $filepart , $dirpart );
2310
2310
}
2311
2311
2312
+ # Cleanup various junk in filename (try to canonicalize it), and
2313
+ # add prependdir to accomodate running CVS client from a
2314
+ # subdirectory (so the output is relative to top directory of the project).
2312
2315
sub filecleanup
2313
2316
{
2314
2317
my $filename = shift ;
@@ -2320,11 +2323,36 @@ sub filecleanup
2320
2323
return undef ;
2321
2324
}
2322
2325
2326
+ if ($filename eq " ." )
2327
+ {
2328
+ $filename =" " ;
2329
+ }
2323
2330
$filename =~ s / ^\.\/ // g ;
2331
+ $filename =~ s % /+% /% g ;
2324
2332
$filename = $state -> {prependdir } . $filename ;
2333
+ $filename =~ s % /$%% ;
2325
2334
return $filename ;
2326
2335
}
2327
2336
2337
+ # Remove prependdir from the path, so that is is relative to the directory
2338
+ # the CVS client was started from, rather than the top of the project.
2339
+ # Essentially the inverse of filecleanup().
2340
+ sub remove_prependdir
2341
+ {
2342
+ my ($path ) = @_ ;
2343
+ if (defined ($state -> {prependdir }) && $state -> {prependdir } ne " " )
2344
+ {
2345
+ my ($pre )=$state -> {prependdir };
2346
+ $pre =~s % /$%% ;
2347
+ if (!($path =~s % ^\Q $pre\E /?%% ))
2348
+ {
2349
+ $log -> fatal(" internal error missing prependdir" );
2350
+ die (" internal error missing prependdir" );
2351
+ }
2352
+ }
2353
+ return $path ;
2354
+ }
2355
+
2328
2356
sub validateGitDir
2329
2357
{
2330
2358
if ( !defined ($state -> {CVSROOT }) )
You can’t perform that action at this time.
0 commit comments