Commits

Anonymous committed 0928c5e

Implement Better Diff Viewing

  • Participants
  • Parent commits f9a3b28

Comments (0)

Files changed (1)

lib/Padre/Plugin/HG.pm

 use Padre::Plugin::HG::ProjectCommit;
 use Padre::Plugin::HG::ProjectClone;
 use Padre::Plugin::HG::UserPassPrompt;
+use Padre::Plugin::HG::DiffView;
 my %projects;
 our $VERSION = '0.01';
 our @ISA     = 'Padre::Plugin';
 		'Add'		    => sub {$self->vcs_add},
 		'Clone'		    => sub {$self->show_project_clone},
 		'Commit...' 	    => sub { $self->show_commit_list},
+		'Diff...' 	    => sub { $self->show_diff},
 	];
 }
 
 	my $command = eval "qq\0$VCSCommand{diff} $path\0";
 	return $main->error('File not in a $VCS Project', "Padre $VCS" ) if not $self->_project_root($path);
 	my $result = $self->vcs_execute($command, $dir);
-	use Padre::Wx::Dialog::Text;
-	Padre::Wx::Dialog::Text->show($main, "$VCS Diff of $path", $result);
-	return;
+	return $result;
 }
 
 =pod
 
 =pod
 
+=head2 show_diff
+
+ Displays a list of all the files that are awaiting commiting. It will include
+ not added and deleted files adding and removing them as required. 
+
+=cut
+sub show_diff
+{	
+	my ($self, $file, $path) = @_;
+	my $main = Padre->ide->wx->main;
+	 $self->{project_path} = $self->_project_root($file);
+        my $full_path = File::Spec->catdir(($path,$file));
+	return $main->error("Not a $VCS Project") if ! $self->{project_path} ;
+ 
+	my $obj = Padre::Plugin::HG::DiffView->showList($self,$full_path );	
+	$obj = undef;
+
+}
+
+=pod
+
 =head2 show_project_clone
 
  Dialog for project cloning