forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunco.pl
More file actions
31 lines (29 loc) · 884 Bytes
/
unco.pl
File metadata and controls
31 lines (29 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require "$tool/built/include/ctutils.pl" ;
require "$tool/built/include/ctdelta.pl" ;
# Remove a branch for an element if needed
# input is in:
# $_[0] = element
sub CTUncoDoIt {
local( $elem ) = $_[0] ;
local( $ver ) = &CTDeltaGetVersion( $elem ) ;
if ( $ctdebug ne "" ) {
print STDERR "Unco script: got version '" . $ver . "'\n" ;
}
local( @verlist ) ;
@verlist = split( /\//, $ver ) ;
local( $vlast ) = pop( @verlist ) ;
if ( $ctdebug ne "" ) {
print STDERR "Unco script: last part of version is '" . $vlast . "'\n" ;
}
if ( $#verlist > 1 ) {
local( $branch ) = join( "/", @verlist ) ;
if ( $vlast == 0 ) {
local( $cmd ) = "cleartool rmbranch -force -nc $elem" . "@@" . "$branch" ;
if ( $ctdebug ne "" ) {
print STDERR "Unco script: command is '" . $cmd . "'\n" ;
}
system $cmd ;
}
}
}
1;