Subversion Repositories DevTools

Rev

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

Rev 6276 Rev 7217
Line 1124... Line 1124...
1124
{
1124
{
1125
    my ($self, $test) = @_;
1125
    my ($self, $test) = @_;
1126
    my @path;
1126
    my @path;
1127
    my $path = $self->{WS};
1127
    my $path = $self->{WS};
1128
    my $found;
1128
    my $found;
-
 
1129
    my $rv;
1129
 
1130
 
1130
    Debug ("SvnLocateWsRoot");
1131
    Debug ("SvnLocateWsRoot");
1131
    Error ("SvnLocateWsRoot: No Workspace") unless ( $path  );
1132
    Error ("SvnLocateWsRoot: No Workspace") unless ( $path  );
1132
    Verbose2 ("SvnLocateWsRoot: Start in $path");
1133
    Verbose2 ("SvnLocateWsRoot($test): Start in $path");
1133
 
1134
 
1134
    #
1135
    #
1135
    #   Validate the source path
1136
    #   Validate the source path
1136
    #
1137
    #
1137
    if ( SvnValidateWs ($self, 'SvnLocateWsRoot', $test) )
1138
    $rv = SvnValidateWs ($self, 'SvnLocateWsRoot', $test);
-
 
1139
    if ( $test && $rv )
1138
    {
1140
    {
-
 
1141
        Verbose2("SvnLocateWsRoot: Invalid path: $rv");
1139
        return undef;
1142
        return undef;
1140
    }
1143
    }
1141
 
1144
 
1142
    #
1145
    #
1143
    #   Under Subversion 1.7 the process is a lot easier
1146
    #   Under Subversion 1.7 the process is a lot easier
Line 2270... Line 2273...
2270
        }
2273
        }
2271
    }
2274
    }
2272
 
2275
 
2273
    #
2276
    #
2274
    #   Return 0 to keep on going
2277
    #   Return 0 to keep on going
-
 
2278
    return 0;
-
 
2279
}
-
 
2280
 
-
 
2281
#-------------------------------------------------------------------------------
-
 
2282
# Function        :  
-
 
2283
#
-
 
2284
# Description     : Examine the current workspace and exact information about its
-
 
2285
#                   parent.
-
 
2286
#                   
-
 
2287
#                   Does not extract the entire log history - just the last copyfrom
-
 
2288
#
-
 
2289
# Inputs          : $self
-
 
2290
#
-
 
2291
# Returns         : Nothing
-
 
2292
#                   Will add {InfoWsExtra} to the session handle
-
 
2293
#
-
 
2294
sub getWsExtraInfo
-
 
2295
{
-
 
2296
    my $self = shift;
-
 
2297
 
-
 
2298
    #
-
 
2299
    #   Determine the source of the merge
-
 
2300
    #   Create a hash entry to store working data
-
 
2301
    # 
-
 
2302
    $self->{btData} = {};
-
 
2303
    $self->SvnCmd ( 'log', '-v', '--xml', '--stop-on-copy', '--limit', '1', '-r0:HEAD', $self->{InfoWs}{Path}
-
 
2304
                    , { 'process' => \&ProcessWsExtraInfo,
-
 
2305
                         }
-
 
2306
                        );
-
 
2307
 
-
 
2308
    # Grab the first entry of the log array - should only be one
-
 
2309
    #
-
 
2310
    $self->{InfoWsExtra} = $self->{btData}{Data}[0];
-
 
2311
    delete $self->{btData};
-
 
2312
}
-
 
2313
 
-
 
2314
#-------------------------------------------------------------------------------
-
 
2315
# Function        : ProcessWsExtraInfo
-
 
2316
#
-
 
2317
# Description     :
-
 
2318
#                   Parse
-
 
2319
#                       <logentry
-
 
2320
#                          revision="24272">
-
 
2321
#                       <author>bivey</author>
-
 
2322
#                       <date>2005-07-25T15:45:35.000000Z</date>
-
 
2323
#                       <paths>
-
 
2324
#                       <path
-
 
2325
#                          prop-mods="false"
-
 
2326
#                          text-mods="false"
-
 
2327
#                          kind="dir"
-
 
2328
#                          copyfrom-path="/enqdef/branches/Stockholm"
-
 
2329
#                          copyfrom-rev="24271"
-
 
2330
#                          action="A">/enqdef/tags/enqdef_24.0.1.sls</path>
-
 
2331
#                       </paths>
-
 
2332
#                       <msg>COTS/enqdef: Tagged by Jats Svn Import</msg>
-
 
2333
#                       </logentry>
-
 
2334
#
-
 
2335
# Inputs          : 
-
 
2336
#
-
 
2337
# Returns         : 
-
 
2338
#
-
 
2339
sub  ProcessWsExtraInfo
-
 
2340
{
-
 
2341
    my ($self, $line ) = @_;
-
 
2342
    my $data = $self->{btData};
-
 
2343
    $data->{Mode} = '' unless ( defined $data->{Mode} );
-
 
2344
    return unless ( $line );
-
 
2345
#print "----- ($data->{Mode}) $line\n";
-
 
2346
 
-
 
2347
    if ( $line =~ m~^<logentry~ ) {
-
 
2348
        $data->{Item} = ();
-
 
2349
        $data->{Mode} = 'A';
-
 
2350
 
-
 
2351
    } elsif ( ($line =~ s~\s*(.+?)="(.*)">(.*)</path>$~~) && ($data->{Mode} eq 'A') ) {
-
 
2352
        #
-
 
2353
        #   Last entry has two items
-
 
2354
        #       Attribute
-
 
2355
        #       Data Item
-
 
2356
        #
-
 
2357
        $data->{Item}->{$1} = $2;
-
 
2358
        $data->{Item}->{target} = $3;
-
 
2359
 
-
 
2360
    } elsif ( ($line =~ m~\s*(.*?)="(.*)"~) && ($data->{Mode} eq 'A') ) {
-
 
2361
        #
-
 
2362
        #   Attribute
-
 
2363
        #
-
 
2364
        $data->{Item}->{$1} = $2;
-
 
2365
 
-
 
2366
    } elsif ( $line =~ m~</logentry~ ) {
-
 
2367
        $data->{Mode} = '';
-
 
2368
        if ( exists $data->{Item}->{'copyfrom-path'} )
-
 
2369
        {
-
 
2370
            #DebugDumpData("Data", $data->{Item});
-
 
2371
            push @{$data->{Data}}, $data->{Item};
-
 
2372
        }
-
 
2373
    }
-
 
2374
 
-
 
2375
    #
-
 
2376
    #   Return 0 to keep on going
2275
    return 0;
2377
    return 0;
2276
}
2378
}
2277
 
2379
 
2278
#------------------------------------------------------------------------------
2380
#------------------------------------------------------------------------------
2279
1;
2381
1;