Subversion Repositories DevTools

Rev

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

Rev 1329 Rev 1403
Line 272... Line 272...
272
    #
272
    #
273
    #   Save the current workspace - with its modified build file
273
    #   Save the current workspace - with its modified build file
274
    #
274
    #
275
    Verbose ("Apply new label to package: $tag_label");
275
    Verbose ("Apply new label to package: $tag_label");
276
    $session->SvnCopyWs (
276
    $session->SvnCopyWs (
277
               'target'   => $session->BranchName($tag_label, 'tags' ),
277
               'target'         => $session->BranchName($tag_label, 'tags' ),
278
               'modified' => $opt_ofile,
278
               'modified'       => $opt_ofile,
279
               'noswitch' => 1,
279
               'noswitch'       => 1,
280
               'replace'  => 0,
280
               'replace'        => 0,
281
               'comment'  => 'Created by Jats SaveBuild',
281
               'comment'        => 'Created by Jats SaveBuild',
-
 
282
               'noupdatecheck'  => 2,
282
               );
283
               );
283
    Message ("Repository Ref: " . $session->RmRef);
284
    Message ("Repository Ref: " . $session->RmRef);
-
 
285
    Message ("Vcs Tag       : " . $session->SvnTag);
284
 
286
 
285
    #
287
    #
286
    #   Update the svn:author of the workspace rather than 'buildadm'
288
    #   Update the svn:author of the workspace rather than 'buildadm'
-
 
289
    #   Allow badly configured repos. Don't fail if can't update the author
287
    #
290
    #
288
    Verbose ("Author: $author");
291
    Verbose ("Author: $author");
289
    $session->setRepoProperty('svn:author', $author);
292
    $session->setRepoProperty('svn:author', $author, 1);
290
 
293
 
291
    if ( $opt_isa_wip )
294
    if ( $opt_isa_wip )
292
    {
295
    {
-
 
296
        Verbose( 'Is a WIP');
-
 
297
        Verbose( '$session->WsType: ', $session->WsType);
-
 
298
        Verbose( '$opt_baselabel: ', $opt_baselabel);
293
        #
299
        #
294
        #   If the build is based on a WIP, then we can delete the
300
        #   If the build is based on a WIP then we can delete the WIP
-
 
301
        #   tag under the following conditions:
295
        #   WIP if its based on a branch. If its a TAG, then only delete it if
302
        #       It is a true tag - and not a 'peg'
296
        #   the LABEL is a true WIP and not an existing tag.
303
        #       It is a true WIP - and not a copy of another label
-
 
304
        #                          ie: Ends in .WIP - with possible peg
297
        #
305
        #
298
        if ( $session->WsType eq 'branches' || $opt_baselabel =~ m/\.WIP(\@\d+)?$/)
306
        if ( $opt_baselabel =~ m~(.+)::(.+)~ )
299
        {
307
        {
-
 
308
            my $baseTag = $2;
-
 
309
            if ( $baseTag =~ m~\.WIP(\@\d+)?$~)
-
 
310
            {
300
            $session->SvnDelete(
311
                $session->SvnDelete(
301
                    'target'  => $session->FullWs,
312
                        'target'  => $session->FullPath . '/tags/' . $baseTag,
302
                    'comment' => ["Deleted by Jats SaveBuild","Replaced by: $tag_label"],
313
                        'comment' => ["Deleted by Jats SaveBuild","Replaced by: $tag_label"],
303
                    'noerror' => 1,
314
                        'noerror' => 1,
304
                     );
315
                         );
-
 
316
            }
-
 
317
            else
-
 
318
            {
-
 
319
                Message ("WIP not deleted.","Will not delete WIPS of this type:" . $opt_baselabel );
-
 
320
            }
305
        }
321
        }
306
        else
322
        else
307
        {
323
        {
308
            Message ("WIP not deleted.","Will not delete WIPS based on a :" . $session->WsType );
324
            Message ("WIP not deleted.","Cannot parse baselabel: " . $opt_baselabel );
309
        }
325
        }
310
    }
326
    }
311
 
327
 
312
    #
328
    #
313
    #   Write the label out to the specified file so that the user
329
    #   Write the label out to the specified file so that the user
Line 321... Line 337...
321
        $data->setProperty('Label', $tag_label);
337
        $data->setProperty('Label', $tag_label);
322
        $data->setProperty('WipLabel', $opt_baselabel) if $opt_isa_wip;
338
        $data->setProperty('WipLabel', $opt_baselabel) if $opt_isa_wip;
323
        $data->setProperty('PackageName', $opt_pname);
339
        $data->setProperty('PackageName', $opt_pname);
324
        $data->setProperty('PackageVersion', $opt_pversion);
340
        $data->setProperty('PackageVersion', $opt_pversion);
325
        $data->setProperty('subversion.tag', $session->RmRef);
341
        $data->setProperty('subversion.tag', $session->RmRef);
326
        $data->setProperty('VCS.tag', 'SVN::' . $session->RmRef);
342
        $data->setProperty('VCS.tag', 'SVN::' . $session->SvnTag);
327
 
343
 
328
        $data->Dump('InfoFile') if ($opt_verbose);
344
        $data->Dump('InfoFile') if ($opt_verbose);
329
        $data->store( $opt_infofile );
345
        $data->store( $opt_infofile );
330
    }
346
    }
331
}
347
}