Subversion Repositories DevTools

Rev

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

Rev 1329 Rev 1403
Line 1... Line 1...
1
########################################################################
1
########################################################################
2
# Copyright (C) 1998-2008 ERG Limited, All rights reserved
2
# Copyright (C) 1998-2012 Vix Technology, All rights reserved
3
#
3
#
4
# Module name   : jats_svnrelease.pl
4
# Module name   : jats_svnrelease.pl
5
# Module type   : Jats Utility
5
# Module type   : Jats Utility
6
# Compiler(s)   : Perl
6
# Compiler(s)   : Perl
7
# Environment(s): Jats
7
# Environment(s): Jats
Line 50... Line 50...
50
my @opt_spec;                               # Labels used as a base for the view
50
my @opt_spec;                               # Labels used as a base for the view
51
my $opt_dpkg = 1;                           # Transfer built package to dpkg_archive
51
my $opt_dpkg = 1;                           # Transfer built package to dpkg_archive
52
my $opt_copy = 0;                           # Copy built package to user
52
my $opt_copy = 0;                           # Copy built package to user
53
my $opt_reuse = 0;                          # Re-user view if it exists
53
my $opt_reuse = 0;                          # Re-user view if it exists
54
my $opt_viewname;                           # View Name
54
my $opt_viewname;                           # View Name
55
my $opt_extract;                            # Just create a static view
55
my $opt_extract = 0;                        # Just create a static view
56
my $opt_extract_files;                      # Just extract files to user - no view
56
my $opt_extract_files;                      # Just extract files to user - no view
-
 
57
my $opt_devModeStr;                         # Development mode string
-
 
58
my $opt_devMode = '';                       # Development mode (cleaned up)
57
my $opt_delete = 0;                         # Just delete the view. 2 to force
59
my $opt_delete = 0;                         # Just delete the view. 2 to force
58
my @opt_build;                              # build files to use (kludge)
60
my @opt_build;                              # build files to use (kludge)
59
my $opt_test;                               # Test the build process - no copy
61
my $opt_test;                               # Test the build process - no copy
60
my $opt_cache;                              # Cache external packages
62
my $opt_cache;                              # Cache external packages
61
my $opt_keep = 0;                           # Keep view if successful
63
my $opt_keep = 0;                           # Keep view if successful
Line 85... Line 87...
85
#   Globals
87
#   Globals
86
#
88
#
87
my $VIEWDIR_ROOT;                           # Root of the static view
89
my $VIEWDIR_ROOT;                           # Root of the static view
88
my $VIEWDIR;                                # Absolute path to the view
90
my $VIEWDIR;                                # Absolute path to the view
89
my $VIEWPATH;                               # Path relative to clearcase
91
my $VIEWPATH;                               # Path relative to clearcase
-
 
92
my $view_prefix     = "${USER}_";           # Default WorkSpace prefix
90
my $user_cwd;
93
my $user_cwd;                               # Initial User Directory
91
my $error = 0;
94
my $error = 0;                              # Build Error Flag/Counter
92
my $label_count = 0;                        # Number of labels to create the view
95
my $label_count = 0;                        # Number of labels to create the view
93
my @label_not_pegged;                       # List of unpegged labels
96
my @label_not_pegged;                       # List of unpegged labels
-
 
97
my @messageText;                            # Messages to be displayed AFTER extraction
-
 
98
my $workSpace;                              # Path to created workspace (or extact)
-
 
99
my $svnSession;                             # Primary Subversion Session
-
 
100
my $noReleaseWs = 0;                        # Do not officially release from this
-
 
101
my $checkDelta = 1;                         # Check Diffs between Tag and Head
-
 
102
                                            #   0 - Don't do anything
-
 
103
                                            #   1 - Warn about diffs
-
 
104
                                            #   2 - Error if diffs
-
 
105
my $traceBack = 2;                          # Trace Back error control. As above
94
 
106
 
-
 
107
#
95
my $view_prefix     = "${USER}_";
108
#   Data about the package-version
-
 
109
#
-
 
110
my $srcPathPkg;                             # Root of the package
-
 
111
my $devBranch;                              # Development Branch - within the package
-
 
112
my $devBranchPeg;                           # May be pegged
-
 
113
my $devBranchHead;                          # Revision of the HEAD of the development branch
-
 
114
my $tagLabel;                               # Label in 'tags'
-
 
115
my $tagPeg;                                 # May be pegged
-
 
116
my $tagLabelBranch;                         # Tagged from this branch: Discovered
-
 
117
my $tagLabelBranchPeg;                      # Tagged from this branch at this peg: Discovered
-
 
118
my $ttbType;                                # trunk, tags or branches
-
 
119
my $urlType;                                # 'jats' or 'url'
-
 
120
my $initialUrl;                             # Initial URL of target
96
 
121
 
97
#-------------------------------------------------------------------------------
122
#-------------------------------------------------------------------------------
98
# Function        : Mainline Entry Point
123
# Function        : Mainline Entry Point
99
#
124
#
100
# Description     :
125
# Description     : Main entry point
101
#
126
#
102
# Inputs          :
127
# Inputs          : ARGV[]      - See documentation below
103
#
128
#
104
 
129
 
105
#
130
#
106
#   Alter some option defaults if we are creating a view within a sandbox
131
#   Alter some option defaults if we are creating a view within a sandbox
107
#
132
#
Line 113... Line 138...
113
 
138
 
114
#
139
#
115
#   Parse the user options
140
#   Parse the user options
116
#
141
#
117
my $result = GetOptions (
142
my $result = GetOptions (
118
                "help:+"        => \$opt_help,              # flag, multiple use allowed
143
                'help:+'        => \$opt_help,                  # flag, multiple use allowed
119
                "manual:3"      => \$opt_help,              # flag
144
                'manual:3'      => \$opt_help,                  # flag
120
                "v|verbose:+"     => \$opt_verbose,           # flag, multiple use allowed
145
                'v|verbose:+'   => \$opt_verbose,               # flag, multiple use allowed
121
                "label=s"       => \@opt_spec,              # Array of build specs
146
                'label=s'       => \@opt_spec,                  # Array of build specs
122
                "view=s"        => \$opt_viewname,          # String
147
                'view=s'        => \$opt_viewname,              # String
123
                "dpkg!"         => \$opt_dpkg,              # [no]flag
148
                'dpkg!'         => \$opt_dpkg,                  # [no]flag
124
                "copy!"         => \$opt_copy,              # [no]flag
149
                'copy!'         => \$opt_copy,                  # [no]flag
125
                "reuse!"        => \$opt_reuse,             # [no]flag
150
                'reuse!'        => \$opt_reuse,                 # [no]flag
126
                "extract"       => \$opt_extract,           # flag
151
                'extract:+'     => \$opt_extract,               # flag
127
                "extractfiles"  => \$opt_extract_files,     # flag
152
                'extractfiles'  => \$opt_extract_files,         # flag
128
                "delete:+"      => \$opt_delete,            # flag
153
                'delete:+'      => \$opt_delete,                # flag
129
                "build=s"       => \@opt_build,             # An array of build
154
                'build=s'       => \@opt_build,                 # An array of build
130
                "test!"         => \$opt_test,              # [no]flag
155
                'test!'         => \$opt_test,                  # [no]flag
131
                "cache"         => \$opt_cache,             # flag
156
                'cache'         => \$opt_cache,                 # flag
132
                "keep!"         => \$opt_keep,              # [no]flag
157
                'keep!'         => \$opt_keep,                  # [no]flag
133
                "beta!"         => \$opt_beta,              # [no]flag
158
                'beta!'         => \$opt_beta,                  # [no]flag
134
                "merge"         => \$opt_merge,             # [no]flag
159
                'merge'         => \$opt_merge,                 # [no]flag
135
                "path=s"        => \$opt_path,              # string
160
                'path=s'        => \$opt_path,                  # string
136
                "runtests!"     => \$opt_runtests,          # [no]flag
161
                'runtests!'     => \$opt_runtests,              # [no]flag
137
                "branch=s"      => \$opt_branch,            # String
162
                'branch=s'      => \$opt_branch,                # String
138
                "mkbranch=s"    => \$opt_branch,            # String
163
                'mkbranch=s'    => \$opt_branch,                # String
139
                "prodOnly"      => \$opt_prod_build,        # flag
164
                'prodOnly'      => \$opt_prod_build,            # flag
140
                "debugOnly"     => \$opt_debug_build,       # flag
165
                'debugOnly'     => \$opt_debug_build,           # flag
141
                "root=s"        => \$GBE_VIEWBASE,          # string
166
                'root=s'        => \$GBE_VIEWBASE,              # string
142
                "prefix!"       => \$opt_prefix,            # flag
167
                'prefix!'       => \$opt_prefix,                # flag
143
                "tag=s"         => \$opt_tag,               # string
168
                'tag=s'         => \$opt_tag,                   # string
-
 
169
                'devMode=s'     => \$opt_devModeStr,            # string
144
                );
170
                );
145
 
171
 
146
                #
172
                #
147
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
173
                #   UPDATE THE DOCUMENTATION AT THE END OF THIS FILE !!!
148
                #
174
                #
Line 153... Line 179...
153
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
179
pod2usage(-verbose => 0, -message => "Version: $VERSION")  if ($opt_help == 1  || ! $result);
154
pod2usage(-verbose => 1)  if ($opt_help == 2 );
180
pod2usage(-verbose => 1)  if ($opt_help == 2 );
155
pod2usage(-verbose => 2)  if ($opt_help > 2 );
181
pod2usage(-verbose => 2)  if ($opt_help > 2 );
156
 
182
 
157
InitFileUtils();
183
InitFileUtils();
158
 
-
 
159
#
184
#
160
#   Configure the error reporting process now that we have the user options
185
#   Configure the error reporting process now that we have the user options
161
#
186
#
162
ErrorConfig( 'name'    => 'SVNRELEASE',
187
ErrorConfig( 'name'    => 'SVNRELEASE',
163
             'verbose' => $opt_verbose );
188
             'verbose' => $opt_verbose );
164
 
189
 
165
#
190
#
166
#   Validate user options
191
#   Validate user options
167
#   Use either -label or one command line argument
192
#   Use either -label or one command line argument
168
#
193
#
-
 
194
Error ("Cannot mix -extractfiles and -branch")
-
 
195
    if ( $opt_branch && $opt_extract_files );
169
Error ("Unexpected command line arguments present.","Cannot mix -label and command line label" )
196
Error ("Unexpected command line arguments present.","Cannot mix -label and command line label" )
170
    if ( $#opt_spec >= 0 && $#ARGV >= 0);
197
    if ( $#opt_spec >= 0 && $#ARGV >= 0);
171
 
198
 
172
push @opt_spec, @ARGV;
199
push @opt_spec, @ARGV;
173
 
200
 
174
unless(  @opt_spec  )
201
unless(  @opt_spec  )
175
{
202
{
176
    Error ("Need a view or a label. -help for options") if ( $opt_delete  && ! $opt_viewname );
203
    Error ("Need a workspace or a label. -help for options") if ( $opt_delete  && ! $opt_viewname );
177
    Error ("Need a label or URL. -help for options") unless $opt_delete;
204
    Error ("Need a Subversion Reference or URL. -help for options") unless $opt_delete;
-
 
205
}
-
 
206
 
-
 
207
#   Determine extraction mode
-
 
208
#       Working- Default
-
 
209
#               Extract point on development branch were tag was taken
-
 
210
#               Update build files
-
 
211
#               Warn about files that have changed
-
 
212
#
-
 
213
#       Tag   - Extract point on development branch were tag was taken
-
 
214
#               Update build files
-
 
215
#               Error if tag is not the tip
-
 
216
#
-
 
217
#       Tip   - Extact tip of the development branch
-
 
218
#               Warn about files that have changed between head and tagPoint
-
 
219
#
-
 
220
#       Exact - What the user specified
-
 
221
#               May be a tag and thus not usable
-
 
222
#
-
 
223
if ( $opt_devModeStr )
-
 
224
{
-
 
225
    if ( $opt_devModeStr =~ m/^(Tip)|(BranchTip)$/i) {
-
 
226
        $opt_devMode = 'tip';
-
 
227
        $checkDelta = 1;
-
 
228
        $noReleaseWs = 1;
-
 
229
    } elsif ( $opt_devModeStr =~ m/^(Tag)|(TagPoint)$/i) {
-
 
230
        $opt_devMode = 'tag';
-
 
231
        $checkDelta = 2;
-
 
232
        $checkDelta = 1 if ( $opt_branch );
-
 
233
        $noReleaseWs = 0;
-
 
234
    } elsif ( $opt_devModeStr =~ m/^(Work)|(Working)$/i) {
-
 
235
        $opt_devMode = '';
-
 
236
        $checkDelta = 1;
-
 
237
        $noReleaseWs = 0;
-
 
238
    } elsif ( $opt_devModeStr =~ m/^Exact$/i) {
-
 
239
        $opt_devMode = 'exact';
-
 
240
        $checkDelta = 1;
-
 
241
        $noReleaseWs = 0;
-
 
242
        Error ('Cannot mix -branch and -devMode=' . $opt_devModeStr ) if ( $opt_branch );
-
 
243
    } elsif ( $opt_devModeStr =~ m/^escrow$/i) {
-
 
244
        # JATS internal use only. Not advertised
-
 
245
        $opt_devMode = 'exact';
-
 
246
        $checkDelta = 0;
-
 
247
        $noReleaseWs = 0;
-
 
248
        $traceBack = 1;
-
 
249
        Error ('Cannot mix -branch and -devMode=' . $opt_devModeStr ) if ( $opt_branch );
-
 
250
    } else {
-
 
251
        Error ("Unknown development mode: $opt_devModeStr");
-
 
252
    }
178
}
253
}
179
 
254
 
180
#
255
#
181
#   Convert label with embedded VCS information into a 'normal' form.
256
#   The buildtool works in a known environment
182
#   Form:
-
 
183
#       SVN::<URL>
-
 
184
#
257
#
185
foreach ( @opt_spec )
258
if ( $GBE_ABT )
186
{
259
{
187
    s~^SVN::~~;
-
 
188
    Error ("Label contains invalid Version Control Identifier: $_")
260
    $noReleaseWs = 0;       # Can always release
189
        if ( m~^(.+)::.+~ );
261
    $checkDelta = 0;        # Do not care. Often expected to have changes.
190
    Verbose ("Clean URL: $_");
262
    $traceBack = 2;         # Must check traceback. Validate RM data
191
}
263
}
192
 
264
 
193
#
265
#
194
#   Limit the user to ONE label/tag/
266
#   Limit the user to ONE label/tag/
195
#   Reason: Under Subversion its not possible to 'pinch' files from another
267
#   Reason: Under Subversion its not possible to 'pinch' files from another
196
#           package. Don't need to create a workspace with multiple labels
268
#           package. Don't need to create a workspace with multiple labels
197
#
269
#
198
#           It was a bad practice under clearcase
270
#           It was a bad practice under clearcase
199
#
271
#
200
#
-
 
201
if ( $#opt_spec >= 1 )
272
if ( $#opt_spec >= 1 )
202
{
273
{
203
    Error ("Multiple labels not supported",
274
    Error ("Multiple labels not supported",
204
           "Use one label to describe a package" );
275
           "Use one label to describe a package" );
205
}
276
}
-
 
277
parseSubversionRef($opt_spec[0]);
-
 
278
Error ("INTERNAL: initialUrl not set") unless ( $initialUrl );
-
 
279
Error ("Cannot interprete the URL or Subversion Reference: $opt_spec[0]") unless ( $srcPathPkg  );
206
 
280
 
207
#
281
#
208
#   Check branch and tags names
282
#   Check branch name
209
#
283
#
210
if ( $opt_branch )
284
if ( $opt_branch )
211
{
285
{
212
#    Error ("Branch Name cannot start with '-'") if ( $opt_branch =~ m/^-/ );
-
 
213
    $opt_branch = SvnIsaSimpleLabel($opt_branch);
286
    $opt_branch = SvnIsaSimpleLabel($opt_branch);
214
}
287
}
215
 
288
 
216
#
289
#
217
#   User has specified both debug and production
290
#   User has specified both debug and production
Line 224... Line 297...
224
}
297
}
225
 
298
 
226
#
299
#
227
#   User has requested test mode
300
#   User has requested test mode
228
#       - Don't copy
301
#       - Don't copy
229
#       - Don't packgae
302
#       - Don't package
230
#
303
#
231
if ( $opt_test )
304
if ( $opt_test )
232
{
305
{
233
    $opt_dpkg = 0;
306
    $opt_dpkg = 0;
234
    $opt_copy = 0;
307
    $opt_copy = 0;
Line 244... Line 317...
244
$user_cwd = getcwd;
317
$user_cwd = getcwd;
245
 
318
 
246
Error ("USER name not determined" )
319
Error ("USER name not determined" )
247
    unless ( $USER );
320
    unless ( $USER );
248
 
321
 
249
 
-
 
250
#
322
#
251
#   Clean up the view root directory
323
#   Clean up the view root directory
252
#
324
#
253
$VIEWDIR_ROOT = Realpath($GBE_VIEWBASE) || $GBE_VIEWBASE;
325
$VIEWDIR_ROOT = Realpath($GBE_VIEWBASE) || $GBE_VIEWBASE;
254
 
326
 
Line 258... Line 330...
258
#
330
#
259
#   Remove any user name from the front of the view name
331
#   Remove any user name from the front of the view name
260
#   Simplifies the deletion process as the user can provide
332
#   Simplifies the deletion process as the user can provide
261
#   the directory name
333
#   the directory name
262
#
334
#
263
$view_prefix = "" unless ( $opt_prefix );
335
$view_prefix = '' unless ( $opt_prefix );
264
 
336
 
265
#
337
#
266
#   Create a class to describe the complete SVN label
338
#   Create a class to describe the complete SVN label
267
#   This will parse the label and create a number of nice elements
339
#   This will parse the label and create a number of nice elements that will
-
 
340
#   be used in determing the name of the workspace
268
#
341
#
269
my $svn_label = NewSessionByUrl ( $opt_spec[0], 1 );
342
$svnSession = NewSessionByUrl ( $initialUrl, 1 );
-
 
343
#DebugDumpData("New Session", $svnSession );
-
 
344
 
-
 
345
#
-
 
346
#   Test for a pegged label
-
 
347
#
-
 
348
push @label_not_pegged, $svnSession->Full
-
 
349
    unless ( $svnSession->Peg );
270
 
350
 
271
#
351
#
272
#   Setup user specified workspace
352
#   Setup user specified workspace
273
#   Include the user name to ensure that the view name is unique-ish
353
#   Include the user name to ensure that the view name is unique-ish
274
#   Keep the name as short as possible as some compilers display a fixed
354
#   Keep the name as short as possible as some compilers display a fixed
Line 283... Line 363...
283
        unless ( $opt_viewname =~ m~^[0-9a-z]([-.:0-9a-z_]*[0-9a-z])?$~i )
363
        unless ( $opt_viewname =~ m~^[0-9a-z]([-.:0-9a-z_]*[0-9a-z])?$~i )
284
}
364
}
285
else
365
else
286
{
366
{
287
    #
367
    #
288
    #   Create a view name based on the provide 'label'
368
    #   Create a view name based on the provide URL or SVN Reference
289
    #   Unless creating a branch. Branch name will be appended later
369
    #   Unless creating a branch. Branch name will be appended later
290
    #
370
    #
291
    if ( $svn_label->Type )
371
    if ( $svnSession->Type )
292
    {
372
    {
293
        $opt_viewname = $svn_label->Path;
373
        $opt_viewname = $svnSession->Path;
294
        $opt_viewname .= '_' . ($svn_label->Version || 'trunk') unless $opt_branch;
374
        $opt_viewname .= '_' . ($svnSession->Version || 'trunk') unless $opt_branch;
295
 
375
 
296
        #
376
        #
297
        #   Tags and Branches 'should' include the package name
377
        #   Tags and Branches 'should' include the package name
298
        #   This will lead to a duplication of the package name
378
        #   This will lead to a duplication of the package name
299
        #   ie: aaaaa/package/tags/package_version
379
        #   ie: aaaaa/package/tags/package_version
Line 304... Line 384...
304
            Verbose ("Removed duplicate package name: $1 from $opt_viewname");
384
            Verbose ("Removed duplicate package name: $1 from $opt_viewname");
305
        }
385
        }
306
    }
386
    }
307
    else
387
    else
308
    {
388
    {
309
        $opt_viewname = $svn_label->Path;
389
        $opt_viewname = $svnSession->Path;
310
        $bad_label_name = 1;
390
        $bad_label_name = 1;
311
    }
391
    }
312
 
392
 
313
    #
393
    #
314
    #   If creating a branch, then insert the branch name
394
    #   Append information to indicate the exact type of the WorkSpace
315
    #   into the workspace name
395
    #   Normally mutually exclusive
316
    #
396
    #
-
 
397
    $opt_viewname .= '_Tip' if ( $opt_devMode eq 'tip' );
-
 
398
    $opt_viewname .= '_Tag' if ( $opt_devMode eq 'tag' );
-
 
399
    $opt_viewname .= '_Exact' if ( $opt_devMode eq 'exact' );
317
    $opt_viewname .= '_' . $opt_branch if ( $opt_branch );
400
    $opt_viewname .= '_' . $opt_branch if ( $opt_branch );
318
    
401
    
319
    #
402
    #
320
    #   Create a simple dir name
403
    #   Create a simple dir name
321
    #       Remove path sep characters and replace with _
404
    #       Remove path sep characters and replace with _
Line 358... Line 441...
358
}
441
}
359
else
442
else
360
{
443
{
361
    $opt_path = '';
444
    $opt_path = '';
362
}
445
}
-
 
446
$workSpace = $VIEWDIR . $opt_path;
-
 
447
Verbose( "workSpace : $workSpace" );
363
 
448
 
364
#
449
#
365
#   If the view currently exists then it will be deleted if allowed
450
#   If the view currently exists then it will be deleted if allowed
366
#
451
#
367
delete_view()
452
delete_view()
Line 371... Line 456...
371
#   If the user is simply deleting the view then all has been done
456
#   If the user is simply deleting the view then all has been done
372
#
457
#
373
exit 0
458
exit 0
374
    if ( $opt_delete );
459
    if ( $opt_delete );
375
 
460
 
376
 
-
 
377
#
461
#
378
#   Ensure that the label is present within the specified VOB
462
#   Ensure that the label is present within the specified Repository
379
#
463
#
380
Verbose("Ensure Labels can be found in a Repository");
464
Verbose("Ensure Labels can be found in a Repository");
381
Verbose ("Testing label: ". $svn_label->Full );
465
Verbose ("Testing label: ". $svnSession->Full );
382
$label_count++;
466
$label_count++;
383
 
467
 
384
$svn_label->SvnValidateTarget (
468
$svnSession->SvnValidateTarget (
385
                    'cmd'    => 'SvnRelease',
469
                    'cmd'    => 'SvnRelease',
386
                    'target' => $svn_label->Full,
470
                    'target' => $svnSession->Full,
387
                    'require' => 1,
471
                    'require' => 1,
388
                    );
472
                    );
-
 
473
 
389
#
474
#
-
 
475
#   If the user did not provide a peg then examine
-
 
476
#   the 'tag' in the repo and determine when it was created
-
 
477
#   This will not work to well if the user is allowed to move the tag
-
 
478
#
-
 
479
unless ( $svnSession->Peg() )
-
 
480
{
-
 
481
    $svnSession->SvnInfo( $svnSession->Full, 'InfoRepo' );
-
 
482
    my $peg = $svnSession->{'InfoRepo'}{'Last Changed Rev'};
-
 
483
 
-
 
484
    $svnSession->{'PEG'} = '@' . $peg;
-
 
485
    if ( $tagLabel ) {
-
 
486
        $tagPeg = $peg;
-
 
487
    } elsif ( $devBranch ) {
-
 
488
        $devBranchPeg = $peg;
-
 
489
    }
-
 
490
}
-
 
491
#debugDumpRefInfo('Get Peg');
-
 
492
 
-
 
493
#
-
 
494
#   Trace back from the tag to the point at which it was copied
-
 
495
#   This should be the same as the user provided development branch
-
 
496
#   but it may not be the same if the user is changing the branch
-
 
497
#
-
 
498
if ( $tagLabel && $traceBack )
-
 
499
{
-
 
500
    my $btData;
-
 
501
    my $labelBranch = $svnSession->backTrackSvnLabel(
-
 
502
                            join ('@', $tagLabel, $tagPeg)
-
 
503
                          , 'data' => \$btData
-
 
504
                          , 'onlysimple' => 0,
-
 
505
                          , 'printdata' => 0 );
-
 
506
    $svnSession->{SavedBackTrack} = $btData;
-
 
507
    unless ( $btData->{isaBranch} )
-
 
508
    {
-
 
509
        Warning("Cannot trace package label back to a development branch");
-
 
510
    }
-
 
511
    else
-
 
512
    {
-
 
513
        Error ("INTERNAL: Cannot parse result of backTrackSvnLabel: $labelBranch")
-
 
514
            unless ($btData->{devBranch} =~ m~^(.*)@(\d+)$~);
-
 
515
        $tagLabelBranch = $1;
-
 
516
        $tagLabelBranchPeg = $2;
-
 
517
 
-
 
518
        #
-
 
519
        #   Verify that the Development Branch matches that provided by the user
-
 
520
        #
-
 
521
        if ( $devBranch && ($devBranch ne $tagLabelBranch) )
-
 
522
        {
-
 
523
            # If the user is creating a branch, then allow this mismatch
-
 
524
            #
-
 
525
            unless ( $opt_branch && ($devBranch =~ m~/$opt_branch$~) )
-
 
526
            {
-
 
527
                my @msgText;
-
 
528
                push ( @msgText,
-
 
529
                        "The package Tag was not taken from the development branch",
-
 
530
                        "Development Branch: $devBranch\@$tagPeg",
-
 
531
                        "Tag traced back to: $tagLabelBranch\@$tagLabelBranchPeg" );
-
 
532
                if ( $traceBack == 1) {
-
 
533
                    push @messageText, @msgText;
390
#   Test for a pegged label
534
                } else {
-
 
535
                    Error ( @msgText );
-
 
536
                }
-
 
537
            }
-
 
538
        }
-
 
539
        $devBranchPeg = $tagLabelBranchPeg unless ( $devBranchPeg );
-
 
540
 
-
 
541
        #   Ensure that the TAG has not been modified since it was taken
-
 
542
        #   The extraction algorithm assumes that the tag directory is
-
 
543
        #   immutable.
-
 
544
        #
-
 
545
        #   The build daemon will actually modify the build file during
-
 
546
        #   a ripple - this is catered for.
-
 
547
        #
-
 
548
        #   If other files have been modifed then it should be an error
-
 
549
        #
-
 
550
        if ( $btData->{changeSets} > 1 )
-
 
551
        {
-
 
552
            Error ("Tag has been modified since created") if ( $GBE_ABT );
-
 
553
            Warning ("Tag has been modified since created");
-
 
554
            $noReleaseWs = 1;
-
 
555
        }
-
 
556
    }
-
 
557
}
-
 
558
#debugDumpRefInfo('BackTrack Label');
-
 
559
 
-
 
560
#
-
 
561
#   Examine the HEAD of the development branch and determine if there
-
 
562
#   have been any changes since the tag was taken
391
#
563
#
-
 
564
determineChangedFiles();
-
 
565
 
-
 
566
################################################################################
-
 
567
#   Create a workspace based on the tag
-
 
568
#   It will be back tracked to the branch that was tagged:
-
 
569
#       - Ripple build tags look better in version tree
-
 
570
#       - User can develop in the workspace as its not linked to an immutable 'tags'
-
 
571
#
-
 
572
#   So far we have:
-
 
573
#       $initialUrl         - Url to the version that the user specified
-
 
574
#       $initialUrlBranch   - Url to the branch from which the initialUrl was taken
-
 
575
#                             Iff based on a Tag
-
 
576
#       $urlDevBranchHead   - Head of the Development Branch
-
 
577
#
-
 
578
 
-
 
579
$initialUrl = substr( $initialUrl, 1 + length($srcPathPkg));
-
 
580
 
-
 
581
my $initialUrlBranch;
-
 
582
if ( $tagLabelBranch )
-
 
583
{
-
 
584
    $initialUrlBranch  = $tagLabelBranch;
-
 
585
    $initialUrlBranch .= '@' . $tagLabelBranchPeg;
-
 
586
}
-
 
587
 
-
 
588
my $urlDevBranchHead;
-
 
589
if ( $devBranch )
-
 
590
{
-
 
591
    $urlDevBranchHead  = $devBranch;
-
 
592
}
-
 
593
else
-
 
594
{
392
push @label_not_pegged, $svn_label->Full
595
    $urlDevBranchHead  = $tagLabelBranch;
-
 
596
}
-
 
597
 
-
 
598
#
-
 
599
#   Debug information
-
 
600
#
-
 
601
if ( IsVerbose(1) ) {
-
 
602
    debugDumpRefInfo('Creating workspaces');
393
    unless ( $svn_label->Peg );
603
    Verbose ('------------');
-
 
604
    Verbose ("initialUrl       :", $initialUrl);
-
 
605
    Verbose ("initialUrlBranch :", $initialUrlBranch );
-
 
606
    Verbose ("urlDevBranchHead :", $urlDevBranchHead );
-
 
607
    Verbose ("opt_viewname     :", $opt_viewname );
-
 
608
#    DebugDumpData("svn_label", $svnSession );
-
 
609
}
394
 
610
 
395
#
611
#
396
#   If we are only extracting files then ...
612
#   If we are only extracting files then ...
397
#
613
#
398
if ( $opt_extract_files )
614
if ( $opt_extract_files )
399
{
615
{
-
 
616
    Warning(@messageText );
400
    extract_files_from_view();
617
    extract_files_from_view();
401
    exit (0);
618
    exit (0);
402
}
619
}
403
 
620
 
404
#
621
#
405
#   Create a new workspace
622
#   Create a new workspace
-
 
623
#       This is not done if the user is reusing an existing workspace
-
 
624
#       AND the existing workspace exists.
406
#
625
#
407
if (! -d $VIEWDIR || ! $opt_reuse )
626
if (! -d $VIEWDIR || ! $opt_reuse )
408
{
627
{
409
    Message( "Create the workspace" . ($GBE_SANDBOX ? " in a SANDBOX" : ""));
628
    Message( "Create the workspace" . ($GBE_SANDBOX ? " in a SANDBOX" : ''));
410
 
629
 
-
 
630
    my $branch;
-
 
631
    my $view_tag;
-
 
632
    my $update_tagsChanges;
-
 
633
    if ( $opt_devMode eq 'tip' ) {
-
 
634
        $view_tag =  $urlDevBranchHead;
-
 
635
    } elsif ( $opt_devMode eq 'exact' ) {
411
    my $view_tag = $svn_label->Full;
636
        $view_tag =  $initialUrl;
-
 
637
    } else {
-
 
638
        $view_tag = $initialUrlBranch || $initialUrl;
-
 
639
        $update_tagsChanges = 1;
-
 
640
    }
-
 
641
    Message ("Creating Workspace based on: $view_tag");
-
 
642
    $view_tag = $svnSession->FullPath() . '/' .$view_tag;
-
 
643
    Verbose("Creating Workspace:", $view_tag);
-
 
644
    
412
    #
645
    #
413
    #   If a branch is required ...
646
    #   If a branch is required ...
414
 
-
 
415
    #   If the branch exists, then use it
-
 
416
    #   If the branch does not exist, then create it
647
    #   Ensure that the branch is NOT in the Repository
417
    #       Copy the source to the branch
-
 
418
    #       Check it out
-
 
419
    #
648
    #
420
    if ( $opt_branch )
649
    if ( $opt_branch )
421
    {
650
    {
422
        Verbose ("Test branch existence");
-
 
423
        #
-
 
424
        #   Create the name of the branch
-
 
425
        #   Will be based on the current package
-
 
426
        #
-
 
427
        my $branch = $svn_label->BranchName($opt_branch, 'branches' );
651
        $branch = $svnSession->BranchName($opt_branch, 'branches' );
428
        my $rv = $svn_label->SvnValidateTarget (
652
        $svnSession->SvnValidateTarget (
429
                        'cmd'    => 'SvnRelease',
653
                        'cmd'    => 'SvnRelease: Validate Branch',
430
                        'target' => $branch,
654
                        'target' => $branch,
431
                        'test' => 1,
655
                        'available' => 1,
432
                        );
656
                        );
433
 
-
 
434
        if ( $rv )
-
 
435
        {
-
 
436
            #
-
 
437
            #   The named branch exists
-
 
438
            #   Use it in place of the users named version
-
 
439
            #   This mimics the clearcase behaviour
-
 
440
            #   Assumes that it is a project branch
-
 
441
            #
-
 
442
            Warning ("Specified branch \"$opt_branch\" exists",
-
 
443
                     "It will be used as the base for this Workspace",
-
 
444
                     "The workspace will conatin the current HEAD of this branch");
-
 
445
 
-
 
446
            #
-
 
447
            #   Setup the base of the Workspace
-
 
448
            #   It will be based on the branch
-
 
449
            #
-
 
450
            $view_tag = $branch;
-
 
451
        }
-
 
452
        else
-
 
453
        {
-
 
454
            #
-
 
455
            #   Branch does not exist
-
 
456
            #   Create it be copying the base view
-
 
457
            #
-
 
458
            $view_tag = $svn_label->SvnCopy (
-
 
459
                            'old' => $view_tag,
-
 
460
                            'new' => $branch,
-
 
461
                            'comment' => 'Created by Jats SvnRelease branch request',
-
 
462
                            'replace' => 0 );
-
 
463
 
-
 
464
            $view_tag = SvnPath2Url($view_tag);
-
 
465
            
-
 
466
        }
-
 
467
    }
657
    }
468
 
658
    
469
    #
659
    #
470
    #   Create the workspace
660
    #   Create the workspace
471
    #
661
    #
472
    $svn_label->SvnCo ( $view_tag, $VIEWDIR . $opt_path );
662
    $svnSession->SvnCo ( $view_tag, $workSpace );
473
    Error ("Cannot locate the created Workspace")
663
    Error ("Cannot locate the created Workspace")
474
        unless ( -d $VIEWDIR . $opt_path);
664
        unless ( -d $workSpace);
-
 
665
    importTagChanges()
-
 
666
        if ($update_tagsChanges);
-
 
667
 
-
 
668
    #
-
 
669
    #   If we need to create a branch then
-
 
670
    #       Copy the WS to URL
-
 
671
    #       Switch to new URL
-
 
672
    #   The bulk of the copy will be done on the server-side
-
 
673
    #   and not over the network. This is  good.
-
 
674
    #
-
 
675
    if ( $opt_branch )
-
 
676
    {
-
 
677
        #
-
 
678
        #   Branch does not exist
-
 
679
        #   Create it be copying the base view
-
 
680
        #
-
 
681
        Message ("Creating branch: $opt_branch");
-
 
682
        my $branch_tag = $svnSession->SvnCopy (
-
 
683
                        'old' => $workSpace,
-
 
684
                        'new' => $branch,
-
 
685
                        'comment' => 'Created by Jats SvnRelease branch request',
-
 
686
                        'replace' => 0 );
-
 
687
 
-
 
688
        Verbose ("Switching to new branch: $opt_branch");
-
 
689
        $branch_tag = SvnPath2Url($branch_tag);
-
 
690
        $svnSession->SvnSwitch ($branch_tag,
-
 
691
                               $workSpace,
-
 
692
                               '--NoPrint' );
-
 
693
    }
475
 
694
 
476
    #
695
    #
477
    #   Create a local package archive
696
    #   Create a local package archive
478
    #   May be needed for multipackage builds and it will prevent JATS from
697
    #   May be needed for multipackage builds and it will prevent JATS from
479
    #   finding any outside the view
698
    #   finding any outside the view
480
    #
699
    #
481
    mkdir ( $VIEWDIR . '/local_dpkg_archive')
700
    mkdir ( $VIEWDIR . '/local_dpkg_archive')
482
        unless ($GBE_SANDBOX);
701
        unless ($GBE_SANDBOX);
-
 
702
 
-
 
703
    #
-
 
704
    #   Display messages AFTER the extraction text
-
 
705
    #   Will ensure that the user has a chance to see them
-
 
706
    #
-
 
707
    Warning(@messageText );
-
 
708
    
483
}
709
}
484
 
710
 
485
#   Place a tag-file in the user-specified source path
711
#   Place a tag-file in the user-specified source path
486
#   This will be used by the build-tool to locate the 'source-path' of the
712
#   This will be used by the build-tool to locate the 'source-path' of the
487
#   view, primarily for determining metrics.
713
#   view, primarily for determining metrics.
488
#
714
#
489
#   Calculate where the dynmaic view will be
715
#   Calculate where the dynamic view will be
490
#   This differ between UNIX/WINDOWS
716
#   This differ between UNIX/WINDOWS
491
#
717
#
492
if ( $GBE_ABT)
718
if ( $GBE_ABT)
493
{
719
{
494
    Message( "Create Build tagfile");
720
    Message("Create Build tagfile");
495
    my $cpath = $VIEWDIR . $opt_path;
721
    TouchFile ( "$workSpace/.jats.packageroot" )
496
    if ( -d $cpath )
722
        if ( -d $workSpace )
497
    {
-
 
498
        TouchFile ( "$cpath/.jats.packageroot" );
-
 
499
    }
-
 
500
}
723
}
501
 
724
 
502
#
725
#
503
#   Locate the JATS build files within the populated view
726
#   Locate the JATS build files within the populated view
504
#
727
#
505
chdir ($VIEWDIR) or Error( "Cannot chdir to $VIEWDIR");
728
chdir ($VIEWDIR) or Error("Cannot chdir to $VIEWDIR");
506
Message( "Locating build files");
729
Message( "Locating build files");
507
 
730
 
508
my $bscanner = BuildFileScanner( $VIEWDIR, 'build.pl', '--LocateAll' );
731
my $bscanner = BuildFileScanner( $VIEWDIR, 'build.pl', '--LocateAll' );
509
$bscanner->scan();
732
$bscanner->scan();
510
my @build_list = $bscanner->getInfo();
733
my @build_list = $bscanner->getInfo();
511
foreach my $be ( @build_list )
734
foreach my $be ( @build_list )
512
{
735
{
513
    Message( DisplayPath ("Build file: $be->{dir} Name: $be->{file}"));
736
    Message(DisplayPath ("Build file: $be->{dir} Name: $be->{file}"));
514
}
737
}
515
 
738
 
516
#
739
#
517
#   If we are extracting the view then we are done
740
#   If we are extracting the view then we are done
518
#   Display useful information for the user
741
#   Display useful information for the user
Line 523... Line 746...
523
    Warning ("No build files found" )   if ( $#build_list < 0 );
746
    Warning ("No build files found" )   if ( $#build_list < 0 );
524
    Warning( "Multiple build files found" )if ( $#build_list > 0 );
747
    Warning( "Multiple build files found" )if ( $#build_list > 0 );
525
    Message ("Not all labels are pegged") if ( @label_not_pegged  );
748
    Message ("Not all labels are pegged") if ( @label_not_pegged  );
526
    Message ("All labels are pegged") unless ( @label_not_pegged  );
749
    Message ("All labels are pegged") unless ( @label_not_pegged  );
527
    Message ("Badly formed label name" ) if ( $bad_label_name );
750
    Message ("Badly formed label name" ) if ( $bad_label_name );
-
 
751
    Message ("Development Mode: $opt_devModeStr") if ( $opt_devModeStr );
528
    Message ("Development Sandbox") if ( $GBE_SANDBOX );
752
    Message ("Development Sandbox") if ( $GBE_SANDBOX );
-
 
753
    Message ("Cannot release from this workspace") if ($noReleaseWs);
529
 
754
 
530
    exit 0;
755
    exit 0;
531
}
756
}
532
 
757
 
533
Error ("No build files found")  if ( $#build_list < 0 );
758
Error ("No build files found")  if ( $#build_list < 0 );
Line 571... Line 796...
571
push @elist, "Package built from multiple labels" unless ( $label_count == 1 );
796
push @elist, "Package built from multiple labels" unless ( $label_count == 1 );
572
push @elist, "Package built from an unpegged label" if ( @label_not_pegged  );
797
push @elist, "Package built from an unpegged label" if ( @label_not_pegged  );
573
push @elist, "Package built with multiple build files" if ( scalar @build_list > 1 );
798
push @elist, "Package built with multiple build files" if ( scalar @build_list > 1 );
574
push @elist, "Package from a reused view" if ( $opt_reuse && ! $opt_beta );
799
push @elist, "Package from a reused view" if ( $opt_reuse && ! $opt_beta );
575
push @elist, "Package from a development sandbox" if ( $GBE_SANDBOX );
800
push @elist, "Package from a development sandbox" if ( $GBE_SANDBOX );
-
 
801
push @elist, "Package from a development workspace" if ($noReleaseWs);
576
push @elist, "View contains a branch" if ( $opt_branch );
802
push @elist, "View contains a branch" if ( $opt_branch );
577
push @elist, "User has specified build files" if ( $#opt_build > 0 );
803
push @elist, "User has specified build files" if ( $#opt_build > 0 );
578
push @elist, "Badly formed label name" if ( $bad_label_name );
804
push @elist, "Badly formed label name" if ( $bad_label_name );
579
 
805
 
580
if ( @elist )
806
if ( @elist )
Line 671... Line 897...
671
 
897
 
672
}
898
}
673
Error ("Package not transferred")
899
Error ("Package not transferred")
674
    if ( $error );
900
    if ( $error );
675
 
901
 
676
chdir ($user_cwd) or Error( "Cannot chdir to $$user_cwd");
902
chdir ($user_cwd) or Error( "Cannot chdir to $user_cwd");
677
 
903
 
678
#
904
#
679
#   Delete the view
905
#   Delete the view
680
#
906
#
681
if ( ! $opt_reuse && ! $error && ! $opt_keep )
907
if ( ! $opt_reuse && ! $error && ! $opt_keep )
Line 716... Line 942...
716
        }
942
        }
717
    }
943
    }
718
    else
944
    else
719
    {
945
    {
720
        #
946
        #
721
        #   If the view physically exists then attempt to phyically remove it
947
        #   If the view physically exists then attempt to physically remove it
722
        #
948
        #
723
        if ( -d $VIEWDIR )
949
        if ( -d $VIEWDIR )
724
        {
950
        {
725
            #
951
            #
726
            #   Determine if there are any checked out files in the view
952
            #   Determine if there are any checked out files in the view
727
            #
953
            #
728
            Message("Remove the view: $VIEWDIR");
954
            Message("Remove the view: $VIEWDIR");
729
            Verbose("Look for checked out files");
955
            Verbose("Look for checked out files");
730
 
956
 
731
 
957
 
732
            SvnRmView ('path'     => $VIEWDIR . $opt_path,
958
            SvnRmView ('path'     => $workSpace,
733
                       'force'    => $opt_delete > 1,
959
                       'force'    => ($opt_delete > 1) || ($opt_extract > 1),
734
                       'modified' => [ 'local_dpkg_archive' ] );
960
                       'modified' => [ 'local_dpkg_archive' ] );
735
        }
961
        }
736
        Error ("View was not deleted. Will Delete view directory")
962
        Error ("View was not deleted. Will Delete view directory")
737
            if ( -d $VIEWDIR . $opt_path );
963
            if ( -d $workSpace );
738
        RmDirTree( $VIEWDIR ) if $opt_path;
964
        RmDirTree( $VIEWDIR ) if $opt_path;
739
    }
965
    }
740
 
966
 
741
    Error ("View was not deleted")
967
    Error ("View was not deleted")
742
        if ( -d $VIEWDIR );
968
        if ( -d $VIEWDIR );
Line 787... Line 1013...
787
        }
1013
        }
788
 
1014
 
789
        #
1015
        #
790
        #   When used to copy file from within a clearcase dynamic view the
1016
        #   When used to copy file from within a clearcase dynamic view the
791
        #   files may not actually exist. This will generate an error later
1017
        #   files may not actually exist. This will generate an error later
792
        #   so check for existance of file file now.
1018
        #   so check for existence of file file now.
793
        #
1019
        #
794
        return unless ( -e $_ );
1020
        return unless ( -e $_ );
795
 
1021
 
796
        #
1022
        #
797
        #   Have been chdir'ed to the source directory
1023
        #   Have been chdir'ed to the source directory
Line 873... Line 1099...
873
 
1099
 
874
#-------------------------------------------------------------------------------
1100
#-------------------------------------------------------------------------------
875
# Function        : extract_files_from_view
1101
# Function        : extract_files_from_view
876
#
1102
#
877
# Description     : This function will
1103
# Description     : This function will
878
#                       Create a dynamic view
-
 
879
#                       Copy all the files out of the view
1104
#                       Extract the files from the required source
880
#                       Delete the view
1105
#                       This is a simple operation under subversion
881
#
1106
#
882
#                   Its used in the creation of escrow directories
1107
#                   Its used in the creation of escrow directories
883
#
1108
#
884
# Inputs          : None
1109
# Inputs          : None
885
#                   All done via globals
1110
#                   All done via globals
Line 898... Line 1123...
898
    {
1123
    {
899
        Verbose "Delete Directory: $VIEWDIR\n";
1124
        Verbose "Delete Directory: $VIEWDIR\n";
900
        RmDirTree( $VIEWDIR );
1125
        RmDirTree( $VIEWDIR );
901
    }
1126
    }
902
 
1127
 
-
 
1128
    #
-
 
1129
    #   Determine URL to extract
-
 
1130
    #       work : Same as exact
-
 
1131
    #       exact: Use user provided tag
-
 
1132
    #              No need to backtrack to the branch and then
-
 
1133
    #              Update files
-
 
1134
    #
-
 
1135
    #       tag:   Don't update build files
-
 
1136
    #              This is different normal mode
-
 
1137
    #              Perhaps should change to be the same as exact - just extract
-
 
1138
    #              the user provided tag
-
 
1139
    #
-
 
1140
    #       tip:   Don't update build files
-
 
1141
    #
-
 
1142
    my $view_tag;
-
 
1143
    if ( $opt_devMode eq 'tip' ) {
-
 
1144
        $view_tag =  $urlDevBranchHead;
-
 
1145
    } elsif ( $opt_devMode eq 'tag' ) {
-
 
1146
        $view_tag = $initialUrlBranch;
-
 
1147
    } else {
-
 
1148
        $view_tag = $initialUrl;
-
 
1149
    }
-
 
1150
 
903
    $svn_label->SvnCo ( $svn_label->Full, $VIEWDIR, '--Export', '--NoPrint' );
1151
    $svnSession->SvnCo ( $svnSession->FullPath() . '/' . $view_tag,
-
 
1152
                        $VIEWDIR,
-
 
1153
                        'export' => 1,
-
 
1154
                        'print' => 0 );
904
 
1155
 
905
    #
1156
    #
906
    #   Count this files in the view
1157
    #   Count this files in the view
907
    #   Done so that its clear when we have a empty workspace
1158
    #   Done so that its clear when we have a empty workspace in escrow extractions
908
    #
1159
    #
909
    Verbose ("Examine View contents");
1160
    Verbose ("Examine View contents");
910
    count_files ( $VIEWDIR );
1161
    count_files ( $VIEWDIR );
911
    Message ("View files in: $VIEWDIR, Files: $copy_count" );
1162
    Message ("View files in: $VIEWDIR, Files: $copy_count" );
-
 
1163
}
-
 
1164
 
-
 
1165
#-------------------------------------------------------------------------------
-
 
1166
# Function        : importTagChanges
-
 
1167
#
-
 
1168
# Description     : import changes from a 'tag' into the target workspace
-
 
1169
#                   Use with a workspace as well as an exported target
-
 
1170
#
-
 
1171
# Background      :
-
 
1172
#   The workspace has been created on the branch from which the tag was taken
-
 
1173
#   BUT this may not be the same as the tag because:
-
 
1174
#       1) Developer is not respecting the use of tags
-
 
1175
#       2) The automated build system will place the rippled build files
-
 
1176
#          within the tag.
-
 
1177
#   The most effective way that I have found of getting the modified build
-
 
1178
#   files into the workspace is to:
-
 
1179
#       Parse the log of the tag
-
 
1180
#       Determine files that have been modified as a part of the tag
-
 
1181
#       export them into the workspace
-
 
1182
#
-
 
1183
#   If we are creating a workspace that we are about to branch, then
-
 
1184
#   we use 'switch' to copy in the new file
-
 
1185
#   Otherwise, use a 'co -export'. If we use a switch, then the files
-
 
1186
#   that have been switched in cannot be commit if changed as they will
-
 
1187
#   be within the 'tags' area.
-
 
1188
#
-
 
1189
# Inputs          : None
-
 
1190
#                   Globals
-
 
1191
#
-
 
1192
# Returns         : Error code
-
 
1193
#
-
 
1194
sub importTagChanges
-
 
1195
{
-
 
1196
    return unless ( $tagLabel );
-
 
1197
    my $data = $svnSession->{SavedBackTrack};
-
 
1198
    Error ("Internal: importTagChanges expects backtracking to have been performed")
-
 
1199
        unless (defined $data);
-
 
1200
 
-
 
1201
#    DebugDumpData("importTagChanges", $svnSession );
-
 
1202
#    DebugDumpData("Data", $data );
912
 
1203
 
-
 
1204
    #
-
 
1205
    #   Process the data from the backtrack log and determine the files
-
 
1206
    #   that we need to transfer.
-
 
1207
    #       Should only be one - but if the users have been bad
-
 
1208
    #       then there may be more.
-
 
1209
    #
-
 
1210
    if ( $data->{files} )
-
 
1211
    {
-
 
1212
        foreach my $srcFile ( reverse @{$data->{files}} )
-
 
1213
        {
-
 
1214
            Verbose("importTagChanges: $srcFile");
-
 
1215
            my $sfile = $svnSession->FullPath() . '/' . $srcFile;
-
 
1216
            if ( $opt_branch )
-
 
1217
            {
-
 
1218
                $srcFile =~ m~tags/.*?(/.*)@\d+~;
-
 
1219
                my $tfile = $1;
-
 
1220
                $svnSession->SvnSwitch ($sfile, $workSpace . $tfile);
-
 
1221
            }
-
 
1222
            else
-
 
1223
            {
-
 
1224
                $svnSession->SvnCo ($sfile, $workSpace,
-
 
1225
                                        'export' => 1,
-
 
1226
                                        'force' => 1,
-
 
1227
                                        'pretext' => 'Replacing ' );
-
 
1228
            }
-
 
1229
        }
-
 
1230
    }
-
 
1231
}
-
 
1232
 
-
 
1233
#-------------------------------------------------------------------------------
-
 
1234
# Function        : determineChangedFiles
-
 
1235
#
-
 
1236
# Description     : Display a list of files that have been changed between
-
 
1237
#                   the tagPoint and the head of the branch
-
 
1238
#
-
 
1239
# Inputs          : Only Globals
-
 
1240
#
-
 
1241
# Returns         : Will not return if changes are not allowed
-
 
1242
#
-
 
1243
sub determineChangedFiles
-
 
1244
{
-
 
1245
    my @msgText;
-
 
1246
 
-
 
1247
    #
-
 
1248
    #   No checking required
-
 
1249
    #   Skip the hard bit if running on a build machine
-
 
1250
    #
-
 
1251
    return unless ( $checkDelta );
-
 
1252
 
-
 
1253
    Debug ('determineChangedFiles');
-
 
1254
#debugDumpRefInfo('determineChangedFiles');
-
 
1255
 
-
 
1256
    #
-
 
1257
    #   Examine the HEAD of the development branch and determine if there
-
 
1258
    #   have been any changes since the tag was taken
-
 
1259
    #
-
 
1260
    #   Determine the Repo Revision for the HEAD of the devBranch
-
 
1261
    #
-
 
1262
    Error ("Internal: No devBranch calculated") unless ( $devBranch || $tagLabelBranch );
-
 
1263
 
-
 
1264
    my $basePeg = $tagLabelBranchPeg || $devBranchPeg;
-
 
1265
    my $baseBranch = $tagLabelBranch || $devBranch;
-
 
1266
    Error ("Internal logic. Expecting tagLabelBranchPeg or devBranchPeg to be defined") unless ( $basePeg );
-
 
1267
    Error ("Internal logic. Expecting tagLabelBranch or devBranch to be defined") unless ( $baseBranch );
-
 
1268
 
-
 
1269
    my $svn_check = NewSessionByUrl ( join( '/', $srcPathPkg, $baseBranch), 1 );
-
 
1270
    my $rv = $svn_check->SvnInfo( $svn_check->Full, 'InfoRepo' );
-
 
1271
    if ( $rv )
-
 
1272
    {
-
 
1273
        push (@msgText, "Cannot read information for the head of the development branch",
-
 
1274
                        "Branch may not exist: $baseBranch");
-
 
1275
    }
-
 
1276
    else
-
 
1277
    {
-
 
1278
        $devBranchHead = $svn_check->{'InfoRepo'}{'Last Changed Rev'};
-
 
1279
        Verbose2("devBranchHead: $devBranchHead");
-
 
1280
    #debugDumpRefInfo('Dev Branch Head');
-
 
1281
 
-
 
1282
 
-
 
1283
        #
-
 
1284
        #   If the Rev of the HEAD is greater than the point at which we
-
 
1285
        #   are interested then changes may have occured. Otherwise we know
-
 
1286
        #   that changes cannot have occured
-
 
1287
        #
-
 
1288
        if ( $devBranchHead <= $basePeg )
-
 
1289
        {
-
 
1290
            return;
-
 
1291
        }
-
 
1292
 
-
 
1293
        if ( $tagLabelBranchPeg )
-
 
1294
        {
-
 
1295
            push @msgText,  "Development Branch has changed since Tag was taken",
-
 
1296
                            "Head last changed in Rev: $devBranchHead",
-
 
1297
                            "Tag traced back to Rev  : $basePeg";
-
 
1298
        } else
-
 
1299
        {
-
 
1300
            push @msgText,  "Development Branch has changed since specified version",
-
 
1301
                            "Head last changed in Rev: $devBranchHead",
-
 
1302
                            "Specified branch Rev    : $basePeg";
-
 
1303
        }
-
 
1304
 
-
 
1305
 
-
 
1306
        my $diffBase = $svn_check->FullPath() . '/' . $baseBranch;
-
 
1307
        $svn_check->{tmp}{path_length} = length($diffBase);
-
 
1308
        $svn_check->{tmp}{count}  = 0;
-
 
1309
        @{$svn_check->{tmp}{files}}  = ();
-
 
1310
 
-
 
1311
        $rv = $svn_check->SvnCmd ( 'diff', '--summarize',
-
 
1312
                                   $diffBase,
-
 
1313
                                   '--revision', $basePeg . ':HEAD',
-
 
1314
                                   {
-
 
1315
                                        'process' => \&ProcessDiff,
-
 
1316
                                        'credentials' => 1,
-
 
1317
                                        'nosavedata' => 1,
-
 
1318
                                   }
-
 
1319
                                );
-
 
1320
        #
-
 
1321
        #   Prepare message to be displayed
-
 
1322
        #   Prepend text to the list of files
-
 
1323
        #
-
 
1324
 
-
 
1325
        $rv = $svn_check->{tmp}{count};
-
 
1326
        return unless ( $rv );
-
 
1327
        push (@msgText, "No files changed") unless ( $rv );
-
 
1328
        push (@msgText, "Changed file count: $rv") if ( $rv );
-
 
1329
        push (@msgText, "More than 10 files have changed. First 10 are:") if ( $rv > 10);
-
 
1330
        push (@msgText, @{$svn_check->{tmp}{files}} );
-
 
1331
    }
-
 
1332
 
-
 
1333
    if ( $checkDelta == 1) {
-
 
1334
        push @messageText, @msgText;
-
 
1335
    } else {
-
 
1336
        Error ( @msgText );
-
 
1337
    }
-
 
1338
}
-
 
1339
 
-
 
1340
sub ProcessDiff
-
 
1341
{
-
 
1342
    my $self = shift;
-
 
1343
    my $data = shift;
-
 
1344
 
-
 
1345
    #
-
 
1346
    #   Extract filename from line
-
 
1347
    #       First 8 chars are status
-
 
1348
    #       Remove WS path too
-
 
1349
    #
-
 
1350
    my $path_length = $self->{tmp}{path_length} + 1 + 8;
-
 
1351
    if ( length $data >= $path_length )
-
 
1352
    {
-
 
1353
        my $file = substr ( $data, $path_length );
-
 
1354
        push @{$self->{tmp}{files}}, '  Changed: ' .  $file
-
 
1355
            if ( $self->{tmp}{count}++ < 10 );
-
 
1356
    }
-
 
1357
 
-
 
1358
    return 0;
-
 
1359
}
-
 
1360
 
-
 
1361
#-------------------------------------------------------------------------------
-
 
1362
# Function        : parseSubversionRef
-
 
1363
#
-
 
1364
# Description     : Parse the user-provided Subversion Ref
-
 
1365
#
-
 
1366
#                   Convert label with embedded VCS information into a 'normal' form.
-
 
1367
#                   Form:
-
 
1368
#                       SVN::<SourcePath>::<Label>
-
 
1369
#                       SVN::<SourcePath>::<Peg>
-
 
1370
#                   
-
 
1371
#                   Allow optional 'SVN::' prefix
-
 
1372
#                   Allow Full or Symbolic URL
-
 
1373
#                       [SVN::]<SourcePath>::<Label>
-
 
1374
#                       [SVN::]<SourcePath>::<Peg>
-
 
1375
#                       [SVN::]<URL>
-
 
1376
#
-
 
1377
# Inputs          : $opt_spec               - User Provided Ref
-
 
1378
#
-
 
1379
# Returns         : Will not retirn on gross error
-
 
1380
#                   Values return in global variables
-
 
1381
#
-
 
1382
sub parseSubversionRef
-
 
1383
{
-
 
1384
    my ($opt_spec) = @_;
-
 
1385
 
-
 
1386
    $opt_spec =~ s~^SVN::~~;
-
 
1387
    if ( $opt_spec =~ m~(.+)::(.+)~ )
-
 
1388
    {
-
 
1389
        my $sourcePath = $1;
-
 
1390
        my $label = $2;
-
 
1391
        $urlType = 'jats';
-
 
1392
 
-
 
1393
        #
-
 
1394
        #   Sanity test of sourcePath
-
 
1395
        #
-
 
1396
        Error ("Invalid use of a peg: $opt_spec[0]")
-
 
1397
            if ( $sourcePath =~ m~\@\d+$~ );
-
 
1398
 
-
 
1399
        #
-
 
1400
        #   Remove anything after a ttb (truck, tags, branch) element
-
 
1401
        #   This will be the root of the package within the repo
-
 
1402
        #
-
 
1403
        if (  $sourcePath =~ m~(.*)/((tags|branches|trunk)(/|$)(.*))~ )
-
 
1404
        {
-
 
1405
            Error ("Source Path has insufficient items")
-
 
1406
                if ( $1 eq '' );
-
 
1407
 
-
 
1408
            Error ("SourcePath contains invalid items after '$3': '$5'")
-
 
1409
                if ( ($3 eq 'tags' || $3 eq 'trunk') && $5 ne '' );
-
 
1410
 
-
 
1411
            Error ("SourcePath must contain items after 'branches'")
-
 
1412
                if ( $3 eq 'branches' && $5 eq '');
-
 
1413
 
-
 
1414
            $srcPathPkg = $1;
-
 
1415
            $ttbType = $3;
-
 
1416
            $devBranch = $3;
-
 
1417
            $devBranch .= '/' . $5 if ( $5 ne '' );
-
 
1418
        }
-
 
1419
        else
-
 
1420
        {
-
 
1421
            Error ("Source Path does not contain tags or trunk or branches component");
-
 
1422
        }
-
 
1423
 
-
 
1424
        #
-
 
1425
        #   Pull apart the 2nd argument
-
 
1426
        #   May be a raw peg - on the development branch
-
 
1427
        #   May be a tag and a peg
-
 
1428
        #
-
 
1429
        $initialUrl = $srcPathPkg;
-
 
1430
        if ( $label =~ m~^@*(\d+)$~ )
-
 
1431
        {
-
 
1432
            # Full numeric label - is a peg on the development branch
-
 
1433
            $devBranchPeg = $1;
-
 
1434
            $initialUrl .= '/' . $devBranch . '@' . $devBranchPeg;
-
 
1435
        }
-
 
1436
        elsif ( $label =~ m~^([^@]+)@(\d+)$~ )
-
 
1437
        {
-
 
1438
            $tagLabel = 'tags/' . $1;
-
 
1439
            $tagPeg = $2;
-
 
1440
            $initialUrl .= '/tags/' . $label;
-
 
1441
        
-
 
1442
        }
-
 
1443
        elsif ( $label !~ m~@~ )
-
 
1444
        {
-
 
1445
            $tagLabel = 'tags/' . $label;
-
 
1446
            $initialUrl .= '/tags/' . $label;
-
 
1447
        }
-
 
1448
        else
-
 
1449
        {
-
 
1450
            Error ("Subversion Tag badly formed: $label");
-
 
1451
        }
-
 
1452
    } elsif ($opt_spec =~ m~::~) {
-
 
1453
        Error ("Badly formed Subversion Reference: $opt_spec[0]");
-
 
1454
 
-
 
1455
    }
-
 
1456
    else
-
 
1457
    {
-
 
1458
        # Have a full URL and not a JATS enhanced spec
-
 
1459
        # Cannot determine the development branch and the tag
-
 
1460
        #
-
 
1461
        $urlType = 'url';
-
 
1462
        $initialUrl = $opt_spec;
-
 
1463
 
-
 
1464
        # Extact any peg
-
 
1465
        my $peg;
-
 
1466
        if ( $opt_spec =~ m~(.*)@(\d+)$~ )
-
 
1467
        {
-
 
1468
            $opt_spec = $1;
-
 
1469
            $peg = $2;
-
 
1470
        }
-
 
1471
 
-
 
1472
        if (  $opt_spec =~ m~(.*)/((tags|branches|trunk)(/|$)(.*))~ )
-
 
1473
        {
-
 
1474
            Error ("Subversion URL has insufficient items")
-
 
1475
                if ( $1 eq '' );
-
 
1476
            $srcPathPkg = $1;
-
 
1477
            $ttbType = $3;
-
 
1478
 
-
 
1479
            if ( $ttbType eq 'trunk' ) {
-
 
1480
                Error ("Subversion URL must NOT contain items after '$ttbType'")
-
 
1481
                    if ( $5 ne '' );
-
 
1482
                $devBranch = $2;
-
 
1483
                $devBranchPeg = $peg;
-
 
1484
 
-
 
1485
            } elsif ( $ttbType eq 'tags' ) {
-
 
1486
                Error ("Subversion URL must contain items after '$ttbType'")
-
 
1487
                    unless ( $5 ne '' );
-
 
1488
                $tagLabel = $2;
-
 
1489
                $tagPeg = $peg;
-
 
1490
 
-
 
1491
            } else {
-
 
1492
                Error ("Subversion URL must contain items after '$ttbType'")
-
 
1493
                    unless ( $5 ne '' );
-
 
1494
                $devBranch = $2;
-
 
1495
                $devBranchPeg = $peg;
-
 
1496
            }
-
 
1497
        }
-
 
1498
        else
-
 
1499
        {
-
 
1500
            Error ("Subversion URL does not contain tags or trunk or branches component");
-
 
1501
        }
-
 
1502
    }
-
 
1503
    #debugDumpRefInfo('First Parse');
-
 
1504
}
-
 
1505
 
-
 
1506
#-------------------------------------------------------------------------------
-
 
1507
# Function        : debugDumpRefInfo
-
 
1508
#
-
 
1509
# Description     : Dump the current Ref Information
-
 
1510
#
-
 
1511
# Inputs          : $text
-
 
1512
#
-
 
1513
# Returns         : 
-
 
1514
#
-
 
1515
sub debugDumpRefInfo
-
 
1516
{
-
 
1517
    Verbose0 ('-' x 40);
-
 
1518
    Verbose0 ('debugDumpRefInfo:' , @_ );
-
 
1519
    Verbose0 ('ttbType           :', $ttbType);
-
 
1520
    Verbose0 ('urlType           :', $urlType);
-
 
1521
    Verbose0 ('Base              :', $svnSession->FullPath() ) if $svnSession;
-
 
1522
    Verbose0 ('initialUrl        :', $initialUrl);
-
 
1523
    Verbose0 ('srcPathPkg        :', $srcPathPkg);
-
 
1524
    Verbose0 ('devBranch         :', $devBranch);
-
 
1525
    Verbose0 ('devBranchPeg      :', $devBranchPeg);
-
 
1526
    Verbose0 ('devBranchHead     :', $devBranchHead);
-
 
1527
    Verbose0 ('tagLabel          :', $tagLabel);
-
 
1528
    Verbose0 ('tagPeg            :', $tagPeg);
-
 
1529
    Verbose0 ('tagLabelBranch    :', $tagLabelBranch);
-
 
1530
    Verbose0 ('tagLabelBranchPeg :', $tagLabelBranchPeg);
913
}
1531
}
914
 
1532
 
915
#-------------------------------------------------------------------------------
1533
#-------------------------------------------------------------------------------
916
 
1534
 
917
 
1535
 
Line 940... Line 1558...
940
    -path=xxx          - Source Path
1558
    -path=xxx          - Source Path
941
    -view=xxx          - Modify the name of the created view
1559
    -view=xxx          - Modify the name of the created view
942
    -build=xxx         - Package Name to build
1560
    -build=xxx         - Package Name to build
943
    -root=xxx          - Root directory for generated view
1561
    -root=xxx          - Root directory for generated view
944
    -[mk]branch=xxx    - Will create a view with a branch rule
1562
    -[mk]branch=xxx    - Will create a view with a branch rule
945
    -tag=xxx           - Compatability. Not used
1563
    -tag=xxx           - Compatibility. Not used
946
    -extract           - Extract the view and exit
1564
    -extract           - Extract the view and exit
947
    -extractfiles      - Extract files, without a view
1565
    -extractfiles      - Extract files, without a view
-
 
1566
    -devMode=xxx       - Create Workspace suitable for development.(Tip,Tag,...)
948
    -cache             - Refresh local dpkg_archive cache
1567
    -cache             - Refresh local dpkg_archive cache
949
    -delete[=n]        - Remove any existing view and exit
1568
    -delete[=n]        - Remove any existing view and exit
950
    -debugOnly         - Make only the debug version
1569
    -debugOnly         - Make only the debug version
951
    -prodOnly          - Make only the production version
1570
    -prodOnly          - Make only the production version
952
    -[no]dpkg          - Transfer package into dpkg_archive
1571
    -[no]dpkg          - Transfer package into dpkg_archive
Line 955... Line 1574...
955
    -[no]test          - Test package build. Implies nocopy and nodpkg
1574
    -[no]test          - Test package build. Implies nocopy and nodpkg
956
    -[no]keep          - Keep the view after the build
1575
    -[no]keep          - Keep the view after the build
957
    -[no]beta          - Release a beta package
1576
    -[no]beta          - Release a beta package
958
    -[no]merge         - Merge packages into dpkg_archive
1577
    -[no]merge         - Merge packages into dpkg_archive
959
    -[no]runtests      - Run units tests. Default is runtests
1578
    -[no]runtests      - Run units tests. Default is runtests
960
    -[no]prefix        - Supress user prefix in view name. Default prefix is USER
1579
    -[no]prefix        - Suppress user prefix in view name. Default prefix is USER
961
 
1580
 
962
=head1 OPTIONS
1581
=head1 OPTIONS
963
 
1582
 
964
=over 8
1583
=over 8
965
 
1584
 
Line 975... Line 1594...
975
 
1594
 
976
Prints the manual page and exits.
1595
Prints the manual page and exits.
977
 
1596
 
978
=item B<-label> or B<-spec>
1597
=item B<-label> or B<-spec>
979
 
1598
 
980
The Subversion label to use as the base for the workspace.
1599
The Subversion label to use as the base for the workspace. The utility will
-
 
1600
accept the following forms of label identifier, each with an optional 'SVN::' prefix.
-
 
1601
 
-
 
1602
=over 4
-
 
1603
 
-
 
1604
=item Full URL
-
 
1605
 
-
 
1606
This form is identified by the complete lack of the '::' subfield delimiter. The
-
 
1607
URL is used as provided. It is not modified.
-
 
1608
 
-
 
1609
 Eg: AUPERASVN01/DPG_SWBASE/daf_utils_math/tags/daf_utils_math_3.2.1@12345
-
 
1610
 Eg: https://auperasvn01.aupera.erggroup.com/svn/DPG_SWBASE/daf_utils_math/tags/daf_utils_math_3.2.1@12345
-
 
1611
 
-
 
1612
 
-
 
1613
=item SourcePath::Tag
-
 
1614
 
-
 
1615
The SourcePath component is used to calculate the root of the package directory.
-
 
1616
The source path is then caclulated assuming that the 'Tag' exists within a
-
 
1617
'/tags' subdirectory of the root of the package.
-
 
1618
 
-
 
1619
This is the form preferred by Release Manager and the VIX build system.
-
 
1620
 
-
 
1621
 Eg: AUPERASVN01/DPG_SWBASE/daf_utils_math/trunk::daf_utils_math_3.2.1@12345
-
 
1622
 
-
 
1623
=item SourcePath::Peg
981
 
1624
 
-
 
1625
A special case of of the 'SourcePath::Tag' form is invoked if the 'Tag' component
-
 
1626
is numeric. It will be treated as a peg of the Base Path.
-
 
1627
 
982
Eg: DPG_SWBASE/daf_utils_math/tags/3.2.1@12345
1628
 Eg: AUPERASVN01/DPG_SWBASE/daf_utils_math/trunk::12345
-
 
1629
 
-
 
1630
=back
983
 
1631
 
984
=item B<-view name>
1632
=item B<-view name>
985
 
1633
 
986
Specified an alternate view name and tag to be used. This option does not provide the
1634
Specified an alternate view name and tag to be used. This option does not provide the
987
full name of the view.
1635
full name of the view.
Line 995... Line 1643...
995
This allows a user to provide a view path when deleting a view.
1643
This allows a user to provide a view path when deleting a view.
996
 
1644
 
997
=item B<-path=xxx>
1645
=item B<-path=xxx>
998
 
1646
 
999
Specifies the source path to the root of the extracted file tree. This option is
1647
Specifies the source path to the root of the extracted file tree. This option is
1000
not mandatory and is only used to mnaintain toolset compatability woth other
1648
not mandatory and is only used to maintain toolset compatibility with other
1001
,similar, tools.
1649
,similar, tools.
1002
 
1650
 
1003
If provided, then the Workspace will be created within the named subdirectory
1651
If provided, then the Workspace will be created within the named subdirectory
1004
tree within the base of the view.
1652
tree within the base of the view.
1005
 
1653
 
Line 1010... Line 1658...
1010
This is useful if the extracted view contains multiple build files
1658
This is useful if the extracted view contains multiple build files
1011
 
1659
 
1012
This option may be used multiple times.
1660
This option may be used multiple times.
1013
 
1661
 
1014
There are two forms in which the build target can be specified. It can be
1662
There are two forms in which the build target can be specified. It can be
1015
specified as a full package name and vesrion, or as a package name and the
1663
specified as a full package name and version, or as a package name and the
1016
project suffix.
1664
project suffix.
1017
 
1665
 
1018
By default the program will assume that there is only one build file in the
1666
By default the program will assume that there is only one build file in the
1019
view and will not build if multiple files are present, unless the package to be
1667
view and will not build if multiple files are present, unless the package to be
1020
built can be resolved.
1668
built can be resolved.
Line 1032... Line 1680...
1032
jats-lib (cr) package. The version of the packages will not be considered.
1680
jats-lib (cr) package. The version of the packages will not be considered.
1033
 
1681
 
1034
=item B<-root=xxx>
1682
=item B<-root=xxx>
1035
 
1683
 
1036
This option allows the location of the generated view to be specified on the
1684
This option allows the location of the generated view to be specified on the
1037
command line. It overides the value of GBE_VIEWBASE.
1685
command line. It overrides the value of GBE_VIEWBASE.
1038
 
1686
 
1039
If the comamnd is invoked within a development sandbox, then the default
1687
If the command is invoked within a development sandbox, then the default
1040
location will be the root directory of the development sandbox.
1688
location will be the root directory of the development sandbox.
1041
 
1689
 
1042
=item B<-branch=xxx or -mkbranch=xxx>
1690
=item B<-branch=xxx or -mkbranch=xxx>
1043
 
1691
 
1044
This option will create a workspace associated with a branch within the
1692
This option will create a workspace associated with a branch within the
Line 1056... Line 1704...
1056
replaced with a unique name based on the users name and the current date time.
1704
replaced with a unique name based on the users name and the current date time.
1057
 
1705
 
1058
=item B<-tag=text>
1706
=item B<-tag=text>
1059
 
1707
 
1060
This option is not used.
1708
This option is not used.
1061
It is present to maintain compatability with the buildtool interface.
1709
It is present to maintain compatibility with the buildtool interface.
1062
 
1710
 
1063
=item B<-extract>
1711
=item B<-extract>
1064
 
1712
 
1065
With this option the view is created and the left in place. The user may then
1713
With this option the view is created and the left in place. The user may then
1066
access the files within the view. The view should not be used for a
1714
access the files within the view. The view should not be used for a
1067
production release.
1715
production release.
1068
 
1716
 
1069
=item B<-extractfiles>
1717
=item B<-extractfiles>
1070
 
1718
 
1071
With this option the utility will create a dynamic view and transfer files from
1719
With this option the utility will create a dynamic view and transfer files from
1072
the view to the user's tararget. The dynamic view is then removed.
1720
the view to the user's target. The dynamic view is then removed.
1073
 
1721
 
1074
This command is intended to simplify the process of creating an escrow.
1722
This command is intended to simplify the process of creating an escrow.
1075
 
1723
 
-
 
1724
=item B<-devMode=mode>
-
 
1725
 
-
 
1726
This option controls the exact form of the Workspace create. The svnRelease
-
 
1727
command supports the following modes (default is working):
-
 
1728
 
-
 
1729
=over 4
-
 
1730
 
-
 
1731
=item   Tag or TagPoint
-
 
1732
 
-
 
1733
The workspace will contain the point on the packages development branch from
-
 
1734
which the specified tag was copied.
-
 
1735
 
-
 
1736
The extraction process will highlight file differences between the specified tag
-
 
1737
and the tip. If any differences are found then these will be treated as an error.
-
 
1738
 
-
 
1739
The user B<should> resolve this error by selecting, in Release Manager, a
-
 
1740
version of the package based on the tip of the Development Branch.
-
 
1741
 
-
 
1742
This is the preferred Development Mode for working on a package as it provides
-
 
1743
checks to ensure that the Meta Data held in Release Manager is consistient.
-
 
1744
 
-
 
1745
=item   Work or Working
-
 
1746
 
-
 
1747
The workspace will contain the point on the packages development branch from
-
 
1748
which the specified tag was copied.
-
 
1749
 
-
 
1750
The extraction process will highlight file differences between the specified tag
-
 
1751
and the tip of the Development Branch. Unlike the 'Tag' Mode, such differences
-
 
1752
are not treated as an error.
-
 
1753
 
-
 
1754
This mode of WorkSpace has several features and constraints:
-
 
1755
 
-
 
1756
=over 4
-
 
1757
 
-
 
1758
=item *
-
 
1759
 
-
 
1760
The build files from the 'tagged' version will be transferred into the
-
 
1761
WorkSpace. These will be seen as modified files.
-
 
1762
 
-
 
1763
=item *
-
 
1764
 
-
 
1765
This style of workspace can be converted into a 'Tip' style through the use of the
-
 
1766
Subversion 'update' command.
-
 
1767
 
-
 
1768
=item *
-
 
1769
 
-
 
1770
If there have been changes to the Development Branch, then it not be possible to
-
 
1771
'commit' the workspace. It may need to be branched first.
-
 
1772
 
-
 
1773
=back
-
 
1774
 
-
 
1775
=item Tip or BranchTip
-
 
1776
 
-
 
1777
The workspace will contain the 'tip' of the Packages Development Branch.
-
 
1778
 
-
 
1779
The extraction process will highlight file differences between the specified tag
-
 
1780
and the tip.
-
 
1781
 
-
 
1782
=item Exact
-
 
1783
 
-
 
1784
The workspace will be directly based on the Tag or URL provided by the user.
-
 
1785
 
-
 
1786
The resultant workspace may not be suitable for development.
-
 
1787
 
-
 
1788
The extraction process will highlight file differences between the specified tag
-
 
1789
and the tip of any associated Development Branch.
-
 
1790
 
-
 
1791
=back
-
 
1792
 
-
 
1793
The four extraction points are shouwn in the following image:
-
 
1794
 
-
 
1795
     /branches/...    /tags/...
-
 
1796
            v            v
-
 
1797
            |
-
 
1798
        +---+---+
-
 
1799
  [Tag] | Work  |    +-------+
-
 
1800
        +---+---+----+ Exact |
-
 
1801
            |        +-------+
-
 
1802
        +---+---+
-
 
1803
        |       |
-
 
1804
        +---+---+
-
 
1805
            |
-
 
1806
        +---+---+
-
 
1807
        |  Tip  |
-
 
1808
        +---+---+
-
 
1809
 
1076
=item B<-cache>
1810
=item B<-cache>
1077
 
1811
 
1078
Forces external packages to be placed in the local dpkg_archive cache.
1812
Forces external packages to be placed in the local dpkg_archive cache.
1079
 
1813
 
1080
The normal operation is to copy the packages, only if they do not already exist
1814
The normal operation is to copy the packages, only if they do not already exist