Subversion Repositories DevTools

Rev

Rev 361 | Rev 5282 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 361 Rev 4247
Line 247... Line 247...
247
    $data->setProperty('count.file', $find_files);
247
    $data->setProperty('count.file', $find_files);
248
    $data->setProperty('count.dir',  $find_dirs);
248
    $data->setProperty('count.dir',  $find_dirs);
249
    $data->setProperty('count.dirdepth',  $find_depth);
249
    $data->setProperty('count.dirdepth',  $find_depth);
250
    $data->setProperty('count.makefile',  $find_makefiles);
250
    $data->setProperty('count.makefile',  $find_makefiles);
251
 
251
 
-
 
252
	#
-
 
253
	#	Dirty test for subversion usage
-
 
254
	#
-
 
255
	if ( -d '.svn' )
-
 
256
	{
-
 
257
		Message('Subversion workspace');
-
 
258
	}
-
 
259
	else
-
 
260
	{
252
    #
261
        #
253
    #   Determine the number of clearcase branches used by files
262
        #   Determine the number of clearcase branches used by files
254
    #   and folders in this view
263
        #   and folders in this view
255
    #
264
        #
256
    Verbose ("Determine ClearCase branches");
265
        Verbose ("Determine ClearCase branches");
257
    
266
 
258
    #
267
        #
259
    #   Ensure that the 'cleartool' program can be located
268
		#   Ensure that the 'cleartool' program can be located
260
    #
269
		#
261
    Verbose2 ("Locate clearcase utility in users path");
270
		Verbose2 ("Locate clearcase utility in users path");
262
    Error ("Cannot locate the 'cleartool' utility in the users PATH")
271
		Error ("Cannot locate the 'cleartool' utility in the users PATH")
263
        unless ( LocateProgInPath('cleartool', '--All') );
272
			unless ( LocateProgInPath('cleartool', '--All') );
264
 
273
 
265
    my %branches;
274
		my %branches;
266
    my $cmd = QuoteCommand (qw (cleartool ls -vob_only -visible -rec -short), $opt_root );
275
		my $cmd = QuoteCommand (qw (cleartool ls -vob_only -visible -rec -short), $opt_root );
267
    Verbose2($cmd);
276
		Verbose2($cmd);
268
 
277
 
269
    open(CMD, "$cmd 2>&1 |") || Error( "can't run command: $!");
278
		open(CMD, "$cmd 2>&1 |") || Error( "can't run command: $!");
270
    while (<CMD>)
279
		while (<CMD>)
271
    {
280
		{
272
        chomp;
281
			chomp;
273
        tr~\\/~/~s;                 # Clean up and convert multiple / and \ -> /
282
			tr~\\/~/~s;                 # Clean up and convert multiple / and \ -> /
274
 
283
 
275
        #
284
			#
276
        #   If we are not within a VOB, then we will get errors
285
			#   If we are not within a VOB, then we will get errors
277
        #
286
			#
278
        if ( m~cleartool: Error:~i )
287
			if ( m~cleartool: Error:~i )
279
        {
288
			{
280
            Verbose ( $_ );
289
				Verbose ( $_ );
281
            next;
290
				next;
282
        }
291
			}
283
 
292
 
284
        #
293
			#
285
        #   Split the line into filename and branch
294
			#   Split the line into filename and branch
286
        #   Only want the last branch. DOn't need the version on the branch
295
			#   Only want the last branch. DOn't need the version on the branch
287
        #
296
			#
288
        m~([^/]+)\@\@.*/(.+)/\d+~;
297
			m~([^/]+)\@\@.*/(.+)/\d+~;
289
        my $file = $1;
298
			my $file = $1;
290
        my $branch = $2;
299
			my $branch = $2;
291
        Verbose2( "ct ls: " . $_ . ": $file,[$branch]");
300
			Verbose2( "ct ls: " . $_ . ": $file,[$branch]");
292
 
301
 
293
        #
302
			#
294
        #   Ignore build files
303
			#   Ignore build files
295
        #   Try to catch naughty users that put non-buildfiles onthe auto builder branch
304
			#   Try to catch naughty users that put non-buildfiles onthe auto builder branch
296
        #
305
			#
297
        next if ( $file eq 'build.pl' );
306
			next if ( $file eq 'build.pl' );
298
        next if ( $file =~ m~depends\.xml$~ );
307
			next if ( $file =~ m~depends\.xml$~ );
299
 
308
 
300
        $branches{$branch} = 0
309
			$branches{$branch} = 0
301
            unless ( exists $branches{$branch} );
310
				unless ( exists $branches{$branch} );
302
        $branches{$branch}++;
311
			$branches{$branch}++;
-
 
312
		}
-
 
313
		close(CMD);
-
 
314
		
-
 
315
		my @blist = sort keys %branches;
-
 
316
		$data->setProperty('ccbranch.count',  1 + $#blist );
-
 
317
		$data->setProperty('ccbranch.list',  join (',', @blist) );
303
    }
318
    }
304
    close(CMD);
-
 
305
        
-
 
306
    my @blist = sort keys %branches;
-
 
307
    $data->setProperty('ccbranch.count',  1 + $#blist );
-
 
308
    $data->setProperty('ccbranch.list',  join (',', @blist) );
-
 
309
    
-
 
310
 
319
 
311
    #
320
    #
312
    #   All done
321
    #   All done
313
    #   Save the current set of metrics
322
    #   Save the current set of metrics
314
    #
323
    #