Subversion Repositories DevTools

Rev

Rev 1302 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1302 Rev 1306
Line 217... Line 217...
217
    if ( $module_name =~ m~^/~ )
217
    if ( $module_name =~ m~^/~ )
218
    {
218
    {
219
        push @errors, "Module must not start with a '/'"
219
        push @errors, "Module must not start with a '/'"
220
    }
220
    }
221
 
221
 
222
 
-
 
223
    if ( @errors )
222
    if ( @errors )
224
    {
223
    {
225
        $self->{getDiffError} = join ('<br>', @errors);
224
        $self->{getDiffError} = join ('<br>', @errors);
226
        return $Codestriker::OK;
225
        return $Codestriker::OK;
227
    }
226
    }
Line 235... Line 234...
235
        $directory = $1;
234
        $directory = $1;
236
    } else {
235
    } else {
237
        $directory = $module_name;
236
        $directory = $module_name;
238
    }
237
    }
239
 
238
 
-
 
239
    #
-
 
240
    #   Detect mode of operation
-
 
241
    #       1) Two known revisions - simple (start and end specified)
-
 
242
    #       2) Revision to HEAD - simple (only start specified)
-
 
243
    #       3) Empty to Specified-Revision - tricky (only end specified)
-
 
244
    #       4) Error - detected before here (no start or end)
-
 
245
    #
-
 
246
    my $start_url;
-
 
247
    my $end_url;
-
 
248
 
-
 
249
    my $moduleRoot = $module_name;
-
 
250
    $moduleRoot =~ s~/trunk$~~;
-
 
251
    $moduleRoot =~ s~/branches/.*~~;
-
 
252
    $moduleRoot =~ s~/tags/.*~~;
-
 
253
 
-
 
254
    if ( ! $start_tag )
-
 
255
    {
-
 
256
        #
-
 
257
        #   Dummy start: Root of the empty repository
-
 
258
        #
-
 
259
        my $repoName = $module_name;
-
 
260
        $repoName =~ s~[/\\].*~~;
-
 
261
        $start_url = $repoName . '@0';
-
 
262
    }
-
 
263
    elsif ( $start_tag =~ m~^\d+$~ )
-
 
264
    {
-
 
265
        #
-
 
266
        #   Pegged version
-
 
267
        #
-
 
268
        $start_url = $module_name  . '@' . $start_tag;
-
 
269
    }
-
 
270
    else
-
 
271
    {
-
 
272
        #
-
 
273
        #   Tagged version
-
 
274
        #
-
 
275
        $start_url =  join ('/', $moduleRoot, 'tags', $start_tag);
-
 
276
    }
-
 
277
 
-
 
278
    if ( ! $end_tag )
-
 
279
    {
-
 
280
        #
-
 
281
        #   Dummy end: Head of the branch
-
 
282
        #
-
 
283
        $end_url = $module_name;
-
 
284
    }
-
 
285
    elsif ( $end_tag =~ m~^\d+$~ )
-
 
286
    {
-
 
287
        #
-
 
288
        #   Pegged version
-
 
289
        #
-
 
290
        $end_url = $module_name  . '@' . $end_tag;
-
 
291
    }
-
 
292
    else
-
 
293
    {
-
 
294
        #
-
 
295
        #   Tagged version
-
 
296
        #
-
 
297
        $end_url =  join ('/', $moduleRoot, 'tags', $end_tag);
-
 
298
    }
-
 
299
 
-
 
300
 
-
 
301
 
240
    # Execute the diff command.
302
    # Execute the diff command.
241
    my $read_stdout_data;
303
    my $read_stdout_data;
242
    my $read_stdout_fh = new FileHandle;
304
    my $read_stdout_fh = new FileHandle;
243
    open($read_stdout_fh, '>', \$read_stdout_data);
305
    open($read_stdout_fh, '>', \$read_stdout_data);
244
 
306
 
Line 253... Line 315...
253
    push @args, '--non-interactive';
315
    push @args, '--non-interactive';
254
    push @args, '--no-auth-cache';
316
    push @args, '--no-auth-cache';
255
    push @args, '--trust-server-cert';
317
    push @args, '--trust-server-cert';
256
    push @args, @{ $self->{userCmdLine} };
318
    push @args, @{ $self->{userCmdLine} };
257
 
319
 
258
    if ( $start_tag =~ m~^\d+$~ )
-
 
259
    {
-
 
260
        my $rtag = $start_tag;
-
 
261
        $rtag .= (':' . $end_tag) if $end_tag;
-
 
262
        push @args, '-r';
-
 
263
        push @args, $rtag;
-
 
264
        push @args, '--old';
320
    push @args, '--old';
265
        push @args, $self->{repository_url};
321
    push @args, join ('/', $self->{repository_url},$start_url);
266
        push @args, $module_name;
-
 
267
    }
-
 
268
    else
-
 
269
    {
-
 
270
        my $clean_module_name = $module_name;
-
 
271
        $clean_module_name =~ s~/trunk$~~;
-
 
272
        $clean_module_name =~ s~/branches/.*~~;
-
 
273
        $clean_module_name =~ s~/tags/.*~~;
-
 
274
        push @args, '--old';
322
    push @args, '--new';
275
        push @args, join ('/', $self->{repository_url}, $clean_module_name, 'tags', $start_tag);
323
    push @args, join ('/', $self->{repository_url}, $end_url);
276
 
324
 
277
        if ( $end_tag )
-
 
278
        {
-
 
279
            push @args, '--new';
-
 
280
            push @args, join ('/', $self->{repository_url}, $clean_module_name, 'tags', $end_tag);
-
 
281
        }
-
 
282
        else
-
 
283
        {
-
 
284
            push @args, '--new';
-
 
285
            push @args, join ('/', $self->{repository_url}, $module_name);
-
 
286
        }
-
 
287
    }
325
 
288
    Codestriker::execute_command($read_stdout_fh, $stderr_fh,
326
    Codestriker::execute_command($read_stdout_fh, $stderr_fh,
289
                                 $Codestriker::svn, @args);
327
                                 $Codestriker::svn, @args);
290
 
328
 
291
    my $rv = open($read_stdout_fh, '<', \$read_stdout_data);
329
    my $rv = open($read_stdout_fh, '<', \$read_stdout_data);
292
    if ( $rv ) {
330
    if ( $rv ) {