[SCM] Debian packaging of libconfig-model-perl branch, master, updated. debian/2.021-2-5-g58578e0

Dominique Dumont dod at debian.org
Fri Jul 13 12:25:09 UTC 2012


The following commit has been merged in the master branch:
commit 49040e74d1272385c7735f08139722dd76cca9bf
Author: Dominique Dumont <dod at debian.org>
Date:   Fri Jul 13 14:01:46 2012 +0200

    use patch from upstream to fix unsaved changes (Closes: #681353)

diff --git a/debian/patches/fix-unsaved-changes b/debian/patches/fix-unsaved-changes
new file mode 100644
index 0000000..d96ef35
--- /dev/null
+++ b/debian/patches/fix-unsaved-changes
@@ -0,0 +1,59 @@
+--- a/lib/Config/Model/ListId.pm
++++ b/lib/Config/Model/ListId.pm
+@@ -234,6 +234,7 @@
+     if ($ok or $check eq 'no') {
+         $self->_store($to, $moved) ;
+         $moved->index_value($to) ;
++        $self->notify_change(note => "moved from index $from to $to") ;
+         my $imode = $self->instance->get_data_mode ;
+         $self->set_data_mode( $to, $imode ) ;
+     }
+--- a/lib/Config/Model/HashId.pm
++++ b/lib/Config/Model/HashId.pm
+@@ -280,6 +280,8 @@
+         delete $self->{warning_hash}{$from} ;
+         # update index_value attribute in moved objects
+         $self->{data}{$to}->index_value($to) ;
++        
++        $self->notify_change(note => "rename key from $from to $to");
+ 
+         # data_mode is preset or layered or user. Actually only user
+         # mode makes sense here
+@@ -343,6 +345,9 @@
+     } else {
+         unshift @$list , $key_to_move ;
+     }
++
++    $self->notify_change(note => "moved key $key_to_move after $ref_key") ;
++
+ }
+ 
+ 
+@@ -363,9 +368,13 @@
+         if ($list->[$idx] eq $key) {
+             $list->[$idx]   = $list->[$idx-1];
+             $list->[$idx-1] = $key ;
++            $self->notify_change(note => "moved up key $key") ;
+             last ;
+         }
+     }
++
++    # notify_change is placed in the loop so the notification
++    # is not sent if the user tries to move up idx 0
+ }
+ 
+ 
+@@ -386,9 +395,13 @@
+         if ($list->[$idx] eq $key) {
+             $list->[$idx]   = $list->[$idx+1];
+             $list->[$idx+1] = $key ;
++            $self->notify_change(note => "moved down key $key") ;
+             last ;
+         }
+     }
++
++    # notify_change is placed in the loop so the notification
++    # is not sent if the user tries to move past last idx
+ }
+ 
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 86db5a1..7a362b7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
 fix-race-condition-dependency-check
 add_dh_config
+fix-unsaved-changes
+test-fix-unsaved-changes
diff --git a/debian/patches/test-fix-unsaved-changes b/debian/patches/test-fix-unsaved-changes
new file mode 100644
index 0000000..f7daada
--- /dev/null
+++ b/debian/patches/test-fix-unsaved-changes
@@ -0,0 +1,113 @@
+--- a/t/hash_id_of_values.t
++++ b/t/hash_id_of_values.t
+@@ -3,7 +3,7 @@
+ use warnings FATAL => qw(all);
+ 
+ use ExtUtils::testlib;
+-use Test::More tests => 88;
++use Test::More tests => 94;
+ use Test::Memory::Cycle;
+ use Config::Model ;
+ use Test::Exception ;
+@@ -322,6 +322,7 @@
+ $inst->clear_changes ;
+ 
+ $oh ->swap(qw/z x/) ;
++is($inst->needs_save,1,"verify instance needs_save status after swap") ;
+ print scalar $inst->list_changes,"\n" if $trace ;
+ $inst->clear_changes ;
+ 
+@@ -333,12 +334,19 @@
+ eq_or_diff([$oh->fetch_all_indexes], [qw/x a z/],
+ 	 "check index order of ordered_hash after swap(a z)") ;
+ 
++$inst->clear_changes ;
+ $oh ->move_up(qw/a/) ;
++is($inst->needs_save,1,"verify instance needs_save status after move_up") ;
++print scalar $inst->list_changes,"\n" if $trace ;
++$inst->clear_changes ;
+ 
+ eq_or_diff([$oh->fetch_all_indexes], [qw/a x z/],
+ 	 "check index order of ordered_hash after move_up(a)") ;
+ 
+ $oh ->move_down(qw/x/) ;
++is($inst->needs_save,1,"verify instance needs_save status after move_down") ;
++print scalar $inst->list_changes,"\n" if $trace ;
++$inst->clear_changes ;
+ 
+ eq_or_diff([$oh->fetch_all_indexes], [qw/a z x/],
+ 	 "check index order of ordered_hash after move_down(x)") ;
+@@ -346,6 +354,10 @@
+ is($oh->fetch_with_id('x')->fetch, '2x',"Check copied value") ;
+ 
+ $oh->copy(qw/x d/) ;
++is($inst->needs_save,1,"verify instance needs_save status after copy") ;
++print scalar $inst->list_changes,"\n" if $trace ;
++$inst->clear_changes ;
++
+ eq_or_diff([$oh->fetch_all_indexes], [qw/a z x d/],
+ 	 "check index order of ordered_hash after copy(x d)") ;
+ is($oh->fetch_with_id('d')->fetch, '2x',"Check copied value") ;
+@@ -355,13 +367,20 @@
+ 	 "check index order of ordered_hash after copy(a e)") ;
+ is($oh->fetch_with_id('e')->fetch, '3a',"Check copied value") ;
+ 
++$inst->clear_changes ;
+ $oh->move_after('d') ;
+ eq_or_diff([$oh->fetch_all_indexes], [qw/d a z x e/],
+ 	 "check index order of ordered_hash after move_after(d)") ;
++is($inst->needs_save,1,"verify instance needs_save status after move_after") ;
++print scalar $inst->list_changes,"\n" if $trace ;
++$inst->clear_changes ;
+ 
+ $oh->move_after('d','z') ;
+ eq_or_diff([$oh->fetch_all_indexes], [qw/a z d x e/],
+ 	 "check index order of ordered_hash after move_after(d z)") ;
++is($inst->needs_save,1,"verify instance needs_save status after move_after") ;
++print scalar $inst->list_changes,"\n" if $trace ;
++$inst->clear_changes ;
+ 
+ $oh->move_after('d','e') ;
+ eq_or_diff([$oh->fetch_all_indexes], [qw/a z x e d/],
+--- a/t/array_id.t
++++ b/t/array_id.t
+@@ -12,7 +12,7 @@
+ use Config::Model::AnyId;
+ use Log::Log4perl qw(:easy :levels) ;
+ 
+-BEGIN { plan tests => 105; }
++BEGIN { plan tests => 107; }
+ 
+ use strict;
+ 
+@@ -246,7 +246,13 @@
+     $ol->fetch_with_id( $i++ )->fetch_element($e)->store($v);
+ }
+ 
++$inst->clear_changes ;
++
+ $ol->move( 3, 4 );
++is($inst->needs_save,1,"verify instance needs_save status after move") ;
++print scalar $inst->list_changes,"\n" if $trace ;
++$inst->clear_changes ;
++
+ is( $ol->fetch_with_id(3)->fetch_element('Z')->fetch,
+     undef, "check after move idx 3 in 4" );
+ is( $ol->fetch_with_id(4)->fetch_element('Z')->fetch,
+@@ -256,6 +262,10 @@
+ } ( 0 .. 4 );
+ 
+ $ol->swap( 0, 2 );
++is($inst->needs_save,1,"verify instance needs_save status after move") ;
++print scalar $inst->list_changes,"\n" if $trace ;
++$inst->clear_changes ;
++
+ is( $ol->fetch_with_id(0)->fetch_element('X')->fetch,
+     undef, "check after move idx 0 in 2" );
+ is( $ol->fetch_with_id(0)->fetch_element('Y')->fetch, 'Av',
+@@ -401,4 +411,4 @@
+ eq_or_diff( [ $pl->fetch_all_indexes ], [0] ,"check that only layered stuff was cleared");
+ is($pl->fetch_with_id(0)->fetch,'bar',"check that bar was moved from 1 to 0");
+ $pl->clear ;
+-memory_cycle_ok($model);
++memory_cycle_ok($model,"memory cycles");

-- 
Debian packaging of libconfig-model-perl



More information about the Pkg-perl-cvs-commits mailing list