[Bps-public-commit] Shipwright branch, master, updated. de95b78ad369f60dfa57af399e272266845dd9b4
? sunnavy
sunnavy at bestpractical.com
Mon May 24 03:39:09 EDT 2010
The branch, master has been updated
via de95b78ad369f60dfa57af399e272266845dd9b4 (commit)
from 929e7a1d32dc27943fad9ba0e5a7f8d876b63ee5 (commit)
Summary of changes:
lib/Shipwright/Backend/Git.pm | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit de95b78ad369f60dfa57af399e272266845dd9b4
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon May 24 15:39:38 2010 +0800
update git backend's delete and move
diff --git a/lib/Shipwright/Backend/Git.pm b/lib/Shipwright/Backend/Git.pm
index 8a82227..6fe47e6 100644
--- a/lib/Shipwright/Backend/Git.pm
+++ b/lib/Shipwright/Backend/Git.pm
@@ -288,9 +288,14 @@ sub commit {
sub delete {
my $self = shift;
- $self->fs_backend->delete(@_);
my %args = @_;
- $self->commit( comment => 'delete ' . $args{path} );
+ my $path = $args{path};
+ $path =~ s!^/!!;
+ my $cwd = getcwd;
+ chdir $self->local_dir or return;
+ run_cmd( [ $ENV{'SHIPWRIGHT_GIT'}, 'rm', '-rf', $path ] );
+ chdir $cwd;
+ $self->commit( comment => 'delete ' . $path );
}
=item move
@@ -299,10 +304,16 @@ sub delete {
sub move {
my $self = shift;
- $self->fs_backend->move(@_);
my %args = @_;
my $path = $args{path};
+ $path =~ s!^/!!;
my $new_path = $args{new_path};
+ $new_path =~ s!^/!!;
+ my $cwd = getcwd;
+
+ chdir $self->local_dir or return;
+ run_cmd( [ $ENV{'SHIPWRIGHT_GIT'}, 'mv', $path, $new_path ] );
+ chdir $cwd;
$self->commit( comment => "move $path to $new_path" );
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list