[Bps-public-commit] r10911 - svb/bin

jesse at bestpractical.com jesse at bestpractical.com
Thu Feb 21 22:30:42 EST 2008


Author: jesse
Date: Thu Feb 21 22:30:41 2008
New Revision: 10911

Modified:
   svb/bin/svb-history

Log:
the history tool will actually list history. (need to do something useful though)


Modified: svb/bin/svb-history
==============================================================================
--- svb/bin/svb-history	(original)
+++ svb/bin/svb-history	Thu Feb 21 22:30:41 2008
@@ -2,6 +2,11 @@
 use warnings;
 use strict;
 
+use SVN::Core;
+use SVN::Repos;
+use SVN::Fs;
+
+
 use SVB;
 
 my $regex;
@@ -21,9 +26,52 @@
 
 
 my @history;
+my @REVS;
 use YAML;
-SVN::Repos::history ($svb->handle->repo_handle->fs, $bug->storage_node,
-                         sub {push @history, [@_]}, 0, $svb->handle->repo_handle->fs->youngest_rev, 1);
+run($bug->storage_node);
+
+warn YAML::Dump(\@REVS);
+sub _log {
+    my( $paths, $rev, $author, $date, $msg, $pool) = @_;
+
+    my $data = { rev    => $rev, author => $author, date   => $date, msg    => $msg };
+
+    my $root = $svb->handle->repo_handle->fs()->revision_root($rev);
+
+    my $subpool = SVN::Pool->new($pool);
+    $data->{paths} = {
+        map {
+            $_ => {
+                action      => $paths->{$_}->action(),
+                copyfrom    => $paths->{$_}->copyfrom_path(),
+                copyfromrev => $paths->{$_}->copyfrom_rev(),
+                props => $root->node_proplist($_),
+                isdir => $root->check_path($_, $subpool) == $SVN::Node::dir,
+                },
+                $subpool->clear()
+            } keys %$paths
+    };
+
+    push @REVS, $data;
+}
+
+# XXX: stolen from svk::util
+sub run {
+    my $path  = shift;
+
+
+    my $pool  = SVN::Pool->new_default_sub;
+    my $fs    = $svb->handle->repo_handle->fs;
+    my $limit = 0;
+    my $rev   = $fs->youngest_rev();
+    my $root  = $fs->revision_root($rev);
+
+
+
+    my $head = $fs->youngest_rev();
+    my $endrev = 0;
+
+    $svb->handle->repo_handle->get_logs([$path], $rev, $endrev, 1, 0, sub { _log(@_) });
+}
 
-warn YAML::Dump(\@history);
-    
+1; 



More information about the Bps-public-commit mailing list