/[Sack]/trunk/bin/storableedit.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/storableedit.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 37 by dpavlin, Wed Sep 23 23:10:50 2009 UTC revision 44 by dpavlin, Thu Sep 24 12:48:08 2009 UTC
# Line 45  use Term::ReadLine; Line 45  use Term::ReadLine;
45    
46  use lib 'lib';  use lib 'lib';
47  use Sack::Digest;  use Sack::Digest;
48  our $digest_opened = 0;  sub undigest {
 sub unshard {  
49          my ( $o, $v ) = @_;          my ( $o, $v ) = @_;
50          return $v unless $o->{path}->[0] =~ m{#};          my $k = $o->{path}->[0] || return $v;
51          $digest_opened ||= Sack::Digest->open(0);          return $v unless $k =~ m{#};
52  #       warn "### ",$o->{path}->[0], " $v\n";  #       warn "## $k = $v\n";
53          Sack::Digest->from_int($v);          Sack::Digest->undigest_node_k_v(0, $k, $v);
54  }  }
55    
56  sub new {  sub new {
# Line 364  sub show_hash { Line 363  sub show_hash {
363          foreach my $ky (sort keys %$data) {          foreach my $ky (sort keys %$data) {
364                  my $tt=scalar($data->{$ky});                  my $tt=scalar($data->{$ky});
365                  $tt=substr($tt, 0, $textlimit).'...' if (($textlimit) && (length($tt)>$textlimit));                  $tt=substr($tt, 0, $textlimit).'...' if (($textlimit) && (length($tt)>$textlimit));
366                  print '  ', $o->unshard($ky), ' => ', $tt, "\n";                  print '  ', $o->undigest($ky), ' => ', $tt, "\n";
367          } continue {          } continue {
368                  $i++;                  $i++;
369          }          }

Legend:
Removed from v.37  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26