Subversion Repositories DevTools

Rev

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

Rev 385 Rev 1329
Line 82... Line 82...
82
                'packagebase=s' => \$opt_packagebase,       # String
82
                'packagebase=s' => \$opt_packagebase,       # String
83
                'branch'        => \$opt_branch,            # Flag
83
                'branch'        => \$opt_branch,            # Flag
84
                'list'          => \$opt_list,              # Flag
84
                'list'          => \$opt_list,              # Flag
85
                'author=s'      => \$opt_author,            # String
85
                'author=s'      => \$opt_author,            # String
86
                'date=s'        => \$opt_date,              # String
86
                'date=s'        => \$opt_date,              # String
87
                'allowlocal!'   => \$opt_complexTag,        # [no]aaaaaa
87
                'allowlocalmods!'   => \$opt_complexTag,    # [no]aaaaaa
88
                );
88
                );
89
 
89
 
90
                #
90
                #
91
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
91
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
92
                #
92
                #
Line 218... Line 218...
218
    Error ("Cannot tag a Workspace based on a 'tag'",
218
    Error ("Cannot tag a Workspace based on a 'tag'",
219
           "You should be working in a branch",
219
           "You should be working in a branch",
220
           "WorkSpace: $session->{WSURL}" )
220
           "WorkSpace: $session->{WSURL}" )
221
        if ( !$opt_branch && (($session->WsType) eq 'tags') );
221
        if ( !$opt_branch && (($session->WsType) eq 'tags') );
222
 
222
 
-
 
223
    #
-
 
224
    #   The label operation *should* be a server side operation only
-
 
225
    #   If the user has commited chaages, but not yet updated the local
-
 
226
    #   workspace, then subversion will do a client side copy
-
 
227
    #   This is not good.
-
 
228
    #       If the 'tags' area is not writable then we get a cryptic message
-
 
229
    #       If the 'tags' area is writable then we commit the changes twice
-
 
230
    #
-
 
231
    #   Solution - ensure that the Workspace is upto date
-
 
232
    #              This is done within SvnCopyWs
-
 
233
    #
-
 
234
 
223
    $session->SvnCopyWs (
235
    $session->SvnCopyWs (
224
                   target => $ws_label,
236
                   target => $ws_label,
225
                   'allowLocalMods' => $opt_complexTag,
237
                   'allowLocalMods' => $opt_complexTag,
226
                   'noswitch' => 1,
238
                   'noswitch' => 1,
227
                   'replace' => $opt_replace ? 1 : 0,
239
                   'replace' => $opt_replace ? 1 : 0,
Line 245... Line 257...
245
    #   Calculate the label name to delete
257
    #   Calculate the label name to delete
246
    #
258
    #
247
    my $ws_label = make_src_label( $pkg_root, $label );
259
    my $ws_label = make_src_label( $pkg_root, $label );
248
    $session->SvnDelete ( 'target' => $ws_label,
260
    $session->SvnDelete ( 'target' => $ws_label,
249
                          'comment' => $opt_comment ? $opt_comment : 'Deleted by Jats Svnlabel',
261
                          'comment' => $opt_comment ? $opt_comment : 'Deleted by Jats Svnlabel',
250
                          'noerror' => 1 );
262
                          'noerror' => 0 );
251
    $opr_done = 1;
263
    $opr_done = 1;
252
}
264
}
253
 
265
 
254
################################################################################
266
################################################################################
255
#
267
#
Line 301... Line 313...
301
#-------------------------------------------------------------------------------
313
#-------------------------------------------------------------------------------
302
# Function        : make_src_label
314
# Function        : make_src_label
303
#
315
#
304
# Description     : Create a source label ( tag or branch )
316
# Description     : Create a source label ( tag or branch )
305
#
317
#
306
#                   Calculateion may be bypassed in the global $src_label
318
#                   Calculation may be bypassed in the global $src_label
307
#                   is specified.
319
#                   is specified.
308
#
320
#
309
# Inputs          : $base
321
# Inputs          : $base
310
#                   $name           - May contain hint
322
#                   $name           - May contain hint
311
#                                     Prefixed with 'tags/' or 'branches/'
323
#                                     Prefixed with 'tags/' or 'branches/'
Line 313... Line 325...
313
# Returns         : Full label
325
# Returns         : Full label
314
#
326
#
315
sub make_src_label
327
sub make_src_label
316
{
328
{
317
    return $src_label if ( $src_label );
329
    return $src_label if ( $src_label );
318
 
-
 
319
    my ($base, $name) = @_;
330
    my ($base, $name) = @_;
320
    my $result = $name;
331
    my $result = $name;
321
    unless ( $name =~ m~(^branches/)|(^tags)~ )
332
    unless ( $name =~ m~(^branches/)|(^tags)|(^trunk\@)~ )
322
    {
333
    {
323
        $result = ($opt_branch ? 'branches/' : 'tags/' ) . $name;
334
        $result = ($opt_branch ? 'branches/' : 'tags/' ) . $name;
324
    }
335
    }
325
    return $base . '/' . $result;
336
    return $base . '/' . $result;
326
}
337
}