=== modified file '__init__.py' --- __init__.py 2007-11-02 14:35:21 +0000 +++ __init__.py 2007-11-05 12:14:04 +0000 @@ -363,6 +363,52 @@ register_command(cmd_svn_branching_scheme) +class SvnLogChangedPath(object): + pass + + +class cmd_svn_log(Command): + takes_args = ['url'] + takes_options = [ + Option('path', type=str), + Option('from_revnum', type=int), + Option('to_revnum', type=int), + Option('limit', type=int), + ] + encoding_type = 'exact' + hidden = True + + def run(self, url=None, path=None, from_revnum=None, to_revnum=None, limit=None): + from bzrlib.plugins.svn.transport import SvnRaTransport + import cPickle as pickle + log_data = [] + def rcvr(orig_paths, rev, author, date, message, pool): + if orig_paths is None: + new_orig_paths = None + else: + new_orig_paths = {} + for key, value in orig_paths.items(): + new_value = SvnLogChangedPath() + new_value.copyfrom_path = value.copyfrom_path + new_value.action = value.action + new_value.copyfrom_rev = value.copyfrom_rev + new_orig_paths[key] = new_value + rev_data = { + 'orig_paths': new_orig_paths, + 'rev': rev, + 'author': author, + 'date': date, + 'message': message + } + log_data.append(rev_data) + transport = SvnRaTransport(url) + transport.get_log(path, from_revnum, to_revnum, limit, True, True, rcvr) + pickle.dump(log_data, self.outf) + + +register_command(cmd_svn_log) + + def test_suite(): from unittest import TestSuite import tests === modified file 'logwalker.py' --- logwalker.py 2007-10-23 18:18:20 +0000 +++ logwalker.py 2007-11-05 12:24:06 +0000 @@ -129,14 +129,28 @@ if self.saved_revnum % 1000 == 0: self.db.commit() + import sys + import subprocess + import cPickle as pickle + try: try: while self.saved_revnum < to_revnum: - pool = Pool() - self._get_transport().get_log("/", self.saved_revnum, - to_revnum, self._limit, True, - True, rcvr, pool) - pool.destroy() + pipe = subprocess.Popen( + [sys.argv[0], "svn-log", self.url, "--path", "/", + "--from_revnum", str(self.saved_revnum), + "--to_revnum", str(to_revnum), + "--limit", str(self._limit)], stdout=subprocess.PIPE) + stdout, stderr = pipe.communicate() + log_data = pickle.loads(stdout) + for log_entry in log_data: + log_entry['pool'] = None + rcvr(**log_entry) + #pool = Pool() + #self._get_transport().get_log("/", self.saved_revnum, + # to_revnum, self._limit, True, + # True, rcvr, pool) + #pool.destroy() finally: pb.finished() except SubversionException, (_, num):