Subversion Repositories DevTools

Rev

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

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