[Bps-public-commit] Config-GitLike branch, master, updated. 1.00-26-g91a5cb5

spang at bestpractical.com spang at bestpractical.com
Wed Aug 19 08:58:39 EDT 2009


The branch, master has been updated
       via  91a5cb5c712a37635fbc09e013efe0031605dab7 (commit)
       via  1707a80eec66c09d8aaf8f2d62a89301c95c75cb (commit)
      from  fcd8cd419e0efebb4480865e57deef05fbf44371 (commit)

Summary of changes:
 Changes               |    4 +++-
 MANIFEST.SKIP         |    1 +
 lib/Config/GitLike.pm |   12 +++++++-----
 t/t1300-repo-config.t |    2 +-
 4 files changed, 12 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit 1707a80eec66c09d8aaf8f2d62a89301c95c75cb
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Aug 19 13:12:27 2009 +0100

    Small cleanups and comments

diff --git a/lib/Config/GitLike.pm b/lib/Config/GitLike.pm
index c8911f1..520a9cf 100644
--- a/lib/Config/GitLike.pm
+++ b/lib/Config/GitLike.pm
@@ -409,9 +409,9 @@ sub cast {
     );
 
     use constant {
-        BOOL_TRUE_REGEX => qr/^(?:true|yes|on|-?0*1)$/i,
+        BOOL_TRUE_REGEX  => qr/^(?:true|yes|on|-?0*1)$/i,
         BOOL_FALSE_REGEX => qr/^(?:false|no|off|0*)$/i,
-        NUM_REGEX => qr/^-?[0-9]*\.?[0-9]*[kmg]?$/,
+        NUM_REGEX        => qr/^-?[0-9]*\.?[0-9]*[kmg]?$/,
     };
 
     if (defined $args{as} && $args{as} eq 'bool-or-int') {
@@ -719,11 +719,13 @@ sub group_set {
         die "Invalid section name $section\n"
             if $self->_invalid_section_name($section);
 
+        # if the subsection to write contains unescaped \ or ", escape them
+        # automatically
         my $unescaped_subsection;
         if ( defined $subsection ) {
             $unescaped_subsection = $subsection;
-            $subsection =~ s!\\!\\\\!g;
-            $subsection =~ s!"!\\"!g;
+            $subsection =~ s{\\}{\\\\}g;
+            $subsection =~ s{"}{\\"}g;
         }
 
         $args{value} = $self->cast(
diff --git a/t/t1300-repo-config.t b/t/t1300-repo-config.t
index 6a10054..3e588cd 100644
--- a/t/t1300-repo-config.t
+++ b/t/t1300-repo-config.t
@@ -1537,7 +1537,7 @@ while ( my ( $k, $v ) = each %special_in_value ) {
     }
 }
 
-# special chars in subsection
+# special chars in subsection, particularly auto-escaping \ and " on set
 my %special_in_subsection =
   ( backslash => "\\", doublequote => q{"} );
 

commit 91a5cb5c712a37635fbc09e013efe0031605dab7
Author: Christine Spang <spang at bestpractical.com>
Date:   Wed Aug 19 13:49:47 2009 +0100

    Checking in changes prior to tagging of version 1.02.  Changelog diff is:
    
    diff --git a/Changes b/Changes
    index 0974748..773278e 100644
    --- a/Changes
    +++ b/Changes
    @@ -1,6 +1,8 @@
    -1.02 - UNRELEASED
    +1.02 - 2009-08-19
    
     * Bugfixes and extra tests for escaped \ and " in subsections (sunnavy)
    +* win32 fixes (sunnavy)
    +* auto-escape \ and " in subsections on set (sunnavy)
    
     1.01 - 2009-08-11

diff --git a/Changes b/Changes
index 0974748..773278e 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
-1.02 - UNRELEASED
+1.02 - 2009-08-19
 
 * Bugfixes and extra tests for escaped \ and " in subsections (sunnavy)
+* win32 fixes (sunnavy)
+* auto-escape \ and " in subsections on set (sunnavy)
 
 1.01 - 2009-08-11
 
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 23f4756..69ff982 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -12,3 +12,4 @@ pm_to_blib
 inc/.author
 xt
 MANIFEST.SKIP
+cover_db/
diff --git a/lib/Config/GitLike.pm b/lib/Config/GitLike.pm
index 520a9cf..e5d8767 100644
--- a/lib/Config/GitLike.pm
+++ b/lib/Config/GitLike.pm
@@ -7,7 +7,7 @@ use Scalar::Util qw(openhandle);
 use Fcntl qw(O_CREAT O_EXCL O_WRONLY);
 use 5.008;
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 
 
 has 'confname' => (

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list