Subversion Repositories DevTools

Rev

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

Rev 1356 Rev 1380
Line 115... Line 115...
115
Error ("No labels provided") if ( $#ARGV < 0 && !$opt_list );
115
Error ("No labels provided") if ( $#ARGV < 0 && !$opt_list );
116
Error ("Too many labels provided") if ( $#ARGV > 0);
116
Error ("Too many labels provided") if ( $#ARGV > 0);
117
Error ("Conflicting options. Clone and Label") if ( $opt_clone && $opt_label );
117
Error ("Conflicting options. Clone and Label") if ( $opt_clone && $opt_label );
118
Error ("Conflicting options. Rename and Label") if ( $opt_rename && $opt_label );
118
Error ("Conflicting options. Rename and Label") if ( $opt_rename && $opt_label );
119
$label = $ARGV[0];
119
$label = $ARGV[0];
-
 
120
 
-
 
121
#
-
 
122
#   Process user label specification
-
 
123
#   May in the form SVN::Path::Tag
-
 
124
#
120
$label =~ s~^SVN::~~ if $label;
125
$label =~ s~^SVN::~~ if $label;
-
 
126
if ( $label =~ m~(.+)::(.+)~ )
-
 
127
{
-
 
128
    my $sourcePath = $1;
-
 
129
    my $tag = $2;
-
 
130
 
-
 
131
    #
-
 
132
    #   Sanity test of sourcePath
-
 
133
    #
-
 
134
    Error ("Invalid use of a peg: $label")
-
 
135
        if ( $sourcePath =~ m~\@\d+$~ );
-
 
136
 
-
 
137
    #
-
 
138
    #   Remove anything after a ttb (truck, tags, branch) element
-
 
139
    #   This will be the root of the package within the repo
-
 
140
    #
-
 
141
    if (  $sourcePath =~ m~(.*)/((tags|branches|trunk)(/|$)(.*))~ )
-
 
142
    {
-
 
143
        Error ("Source Path has insufficient items")
-
 
144
            if ( $1 eq '' );
-
 
145
 
-
 
146
        Error ("SourcePath contains invalid items after '$3': '$5'")
-
 
147
            if ( ($3 eq 'tags' || $3 eq 'trunk') && $5 ne '' );
-
 
148
 
-
 
149
        Error ("SourcePath must contain items after 'branches'")
-
 
150
            if ( $3 eq 'branches' && $5 eq '');
-
 
151
 
-
 
152
        $label = $1 . '/tags/' . $tag;
-
 
153
    }
-
 
154
    else
-
 
155
    {
-
 
156
        Error ("Source Path does not contain tags or trunk or branches component");
-
 
157
    }
-
 
158
Verbose ("Tag: $label");
-
 
159
}
121
 
160
 
122
#
161
#
123
#   Locate package and workspace roots
162
#   Locate package and workspace roots
124
#
163
#
125
LocateRoots ();
164
LocateRoots ();
Line 288... Line 327...
288
    #
327
    #
289
    #   Backtrack label so that we clone the tag source, not the tag
328
    #   Backtrack label so that we clone the tag source, not the tag
290
    #
329
    #
291
    if ( $ws_label_old =~ m~/tags/~ )
330
    if ( $ws_label_old =~ m~/tags/~ )
292
    {
331
    {
-
 
332
        my $tag = $label;
-
 
333
        $tag = 'tags/' . $tag unless ( $tag =~ m~^tags/~ );
293
        $ws_label_old = $session->backTrackSvnLabel( 'tags/' . $label, savedevbranch => 1);
334
        $ws_label_old = $session->backTrackSvnLabel( $tag, savedevbranch => 1);
294
        Verbose2 ("Tag back tracked to: $ws_label_old");
335
        Verbose2 ("Tag back tracked to: $ws_label_old");
295
        $ws_label_old = $pkg_root . '/' . $ws_label_old;
336
        $ws_label_old = $pkg_root . '/' . $ws_label_old;
296
    }
337
    }
297
 
338
 
298
    $session->SvnCopy (
339
    $session->SvnCopy (