From: Andrew Chilton Date: Sat, 23 Jan 2010 12:42:59 +0000 (+1300) Subject: cil-d0b8bc09: All done X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=57e9a08d406cd6d4274ea51fca2d2a11412d170e;p=cil.git cil-d0b8bc09: All done --- diff --git a/issues/c_5fe9eaea.cil b/issues/c_5fe9eaea.cil new file mode 100644 index 0000000..4f42821 --- /dev/null +++ b/issues/c_5fe9eaea.cil @@ -0,0 +1,6 @@ +Issue: d0b8bc09 +CreatedBy: Andrew Chilton +Inserted: 2010-01-23T12:42:07 +Updated: 2010-01-23T12:42:17 + +All tabs and whitespace formatting tidied-up. diff --git a/issues/i_d0b8bc09.cil b/issues/i_d0b8bc09.cil index eea8759..d428594 100644 --- a/issues/i_d0b8bc09.cil +++ b/issues/i_d0b8bc09.cil @@ -1,9 +1,11 @@ Summary: Tidy up CIL.pm (and others) of formatting -Status: New +Status: Finished CreatedBy: Andrew Chilton AssignedTo: Andrew Chilton +Label: Milestone-v0.06 +Comment: 5fe9eaea Inserted: 2010-01-23T11:40:50 -Updated: 2010-01-23T11:41:50 +Updated: 2010-01-23T12:42:28 This includes: diff --git a/lib/CIL.pm b/lib/CIL.pm index b73de91..b1274eb 100644 --- a/lib/CIL.pm +++ b/lib/CIL.pm @@ -89,7 +89,7 @@ sub new { # save the settings for various bits of info foreach my $key ( keys %$defaults ) { # if we have been passed it in, use it, else use the default - $self->$key( $cfg->{$key} || $defaults->{$key} ); + $self->$key( $cfg->{$key} || $defaults->{$key} ); } return $self; } @@ -360,7 +360,7 @@ sub file_exists { sub dir_exists { my ($self, $dir) = @_; - return $self->vcs_revision + return $self->vcs_revision ? $self->vcs->dir_exists($self->vcs_revision, $dir) : -d $dir ; @@ -370,22 +370,22 @@ sub parse_cil_file { my ($self, $filename, $last_field) = @_; if ( $self->vcs_revision ) { - my $fh = $self->vcs->get_fh($self->vcs_revision, $filename); - CIL::Utils->parse_from_fh($fh, $last_field); + my $fh = $self->vcs->get_fh($self->vcs_revision, $filename); + CIL::Utils->parse_from_fh($fh, $last_field); } else { - CIL::Utils->parse_cil_file($filename, $last_field); + CIL::Utils->parse_cil_file($filename, $last_field); } } sub save { - my ($self, $filename, $data, @fields) = @_; + my ($self, $filename, $data, @fields) = @_; if ( $self->vcs_revision ) { confess "tried to ->save on alternate revision"; } else { - CIL::Utils->write_cil_file( $filename, $data, @fields ); + CIL::Utils->write_cil_file( $filename, $data, @fields ); } } diff --git a/lib/CIL/VCS/Git.pm b/lib/CIL/VCS/Git.pm index a601324..c082bc4 100644 --- a/lib/CIL/VCS/Git.pm +++ b/lib/CIL/VCS/Git.pm @@ -51,7 +51,7 @@ sub glob_rev { # only support globbing the last element my ($dir, $pattern) = $path =~ m{^([^\*]*/)([^/]*)$} - or croak "unsupported pattern '$path'"; + or croak "unsupported pattern '$path'"; $pattern =~ s{([\\\.])}{\\$1}g; $pattern =~ s{\*}{.*}g; my @match; @@ -59,9 +59,9 @@ sub glob_rev { for ( $self->git->command("ls-tree", $rev, $dir) ) { chomp; my ($blobid, $path) = m{([0-9a-f]{40})\s+(.*)} or die; - if ( $path =~ m{^\Q$dir\E$pattern$} ) { - push @match, $path; - } + if ( $path =~ m{^\Q$dir\E$pattern$} ) { + push @match, $path; + } } @match; }