Changeset 7478


Ignore:
Timestamp:
08/23/09 03:23:38 (2 years ago)
Author:
waxhead
Message:

Big clean up of code.

  • removed VCI references.
  • removed system calls to svn
  • all methods should now use SVN::Class
  • waiting on SVN::Class 0.15 with patch for multiline commits then roll out the lib line.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Padre-Plugin-SVN-waxhead/lib/Padre/Plugin/SVN.pm

    r7432 r7478  
    1414use SVN::Class; 
    1515 
    16 #use Capture::Tiny  qw(capture_merged); 
    17 #use File::Basename (); 
    18 #use File::Spec; 
    19  
    20 #use VCI; 
    21  
    22 # because I need a change to commit 
    23  
    24 our $VERSION = '0.01'; 
     16our $VERSION = '0.02'; 
    2517our @ISA     = 'Padre::Plugin'; 
    2618 
     
    4840=head2 Configuring the SVN client for cached authentication. 
    4941 
    50 Becuase this module uses the installed SVN client actions that require authentication from the server will fail and leave Padre looking as though it's hung. 
    51  
    52 The way to address this is to run the svn client from the command line when asked for the login and password enter as required. 
    53  
    54 Once done you should now have your authentication details stored. 
     42Because this module uses the installed SVN client, actions that require authentication from the server will fail and leave Padre looking as though it has hung. 
     43 
     44The way to address this is to run the svn client from the command line when asked for the login and password details, enter as required. 
     45 
     46Once done you should now have your authentication details cached. 
    5547 
    5648More details can be found here: http://svnbook.red-bean.com/nightly/en/svn.serverconfig.netmodel.html#svn.serverconfig.netmodel.credcache 
     
    10395 
    10496sub padre_interfaces { 
    105     'Padre::Plugin' => 0.24; 
     97    'Padre::Plugin' => 0.43; 
    10698} 
    10799 
     
    178170    my ( $self, $path ) = @_; 
    179171    my $main   = Padre->ide->wx->main; 
    180 #   my $status = qx{svn status $path}; 
    181172 
    182173    my $file = svn_file( $path ); 
     
    237228    my ( $self, $path ) = @_; 
    238229    my $main   = Padre->ide->wx->main; 
    239     #my $out = qx{svn log $path}; 
     230     
    240231    my $file = svn_file($path); 
    241232    $self->{_busyCursor} = Wx::BusyCursor->new(); 
     
    277268    my ( $self, $path ) = @_; 
    278269    my $main   = Padre->ide->wx->main; 
    279     #my $status = qx{svn diff $path}; 
     270     
    280271    my $file = svn_file($path); 
    281272    #print $file->stderr; 
     
    305296        #my $doc = Padre::Document->new(); 
    306297        my $diff_str = join( "\n", @{$file->stdout} ); 
    307         $main->on_new(); 
     298        $main->new_document_from_string($diff_str); 
     299        #$main->on_new(); 
    308300        # get the last id created - assume new is created at the end 
    309         my @ids = $main->pageids; 
    310         my @docs = $main->documents; 
     301        #my @ids = $main->pageids; 
     302        #my @docs = $main->documents; 
    311303        #print "pageids: " . join( ",", @ids ) . "\n"; 
    312304        #print "docs: " . join( ",", @docs ) . "\n"; 
    313305        #print "last element is: " . $ids[-1] . "\n"; 
    314         my $doc = $docs[$ids[-1]]; 
    315         $doc->text_set($diff_str); 
     306        #my $doc = $docs[$ids[-1]]; 
     307        #$doc->text_set($diff_str); 
    316308        return 1; 
    317309    } 
     
    370362        # come after the $message. 
    371363        $file->commit_with_message($message); 
    372          
    373          
    374364         
    375365        my @commit = @{$file->stdout}; 
     
    382372        } 
    383373         
    384         #system qq(svn commit "$path" -m"$message"); 
     374         
    385375        $self->{_busyCursor} = undef; 
    386376    } 
     
    418408    my $msg = "$path scheduled to be added to " . $file->info->{_url}; 
    419409    $main->message( $msg ); 
    420      
    421     #system "svn add $path"; 
     410 
    422411    return; 
    423412} 
     
    432421} 
    433422 
    434  
    435 #sub vci { 
    436 #   my ($self, $path) = @_; 
    437 #   my $main = Padre->ide->wx->main; 
    438 #   # TODO: connect to SVN repo without this workaround 
    439 #   my @info = qx{svn info $path}; 
    440 #   if (not @info) { 
    441 #       $main->error("$path does not seem to be under SVN"); 
    442 #       return; 
    443 #   } 
    444 #   chomp @info; 
    445 #   my ($repo) = grep { $_ =~ /^Repository Root: / } @info; 
    446 #   $repo =~ s/^Repository Root:\s*//; 
    447 #   $main->message("'$repo'", "File"); 
    448 #   my $repository = VCI->connect(type => 'Svn', repo => $repo); 
    449 #   print "$repository\n"; 
    450 #   print "---\n"; 
    451 #   print $repository->projects, "\n"; 
    452 # 
    453 #   return; 
    454 #} 
    455 # 
    456  
    4574231; 
    458424 
Note: See TracChangeset for help on using the changeset viewer.