Rev 599: Merge 0.4. in file:///data/jelmer/bzr-svn/revprops/
Jelmer Vernooij
jelmer at samba.org
Sun Dec 9 22:49:20 GMT 2007
At file:///data/jelmer/bzr-svn/revprops/
------------------------------------------------------------
revno: 599
revision-id:jelmer at samba.org-20071209224920-5b1zd0635l2o7end
parent: jelmer at samba.org-20071206205301-wwv6y7t0ksunz34w
parent: jelmer at samba.org-20071209224848-8j0c45o59ytw7mlg
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: revprops
timestamp: Sun 2007-12-09 23:49:20 +0100
message:
Merge 0.4.
modified:
logwalker.py logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
------------------------------------------------------------
revno: 579.1.226
revision-id:jelmer at samba.org-20071209224848-8j0c45o59ytw7mlg
parent: jelmer at samba.org-20071209220239-tsbyak73lxr5yo9r
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2007-12-09 23:48:48 +0100
message:
Expose ability to fetch custom revprops.
modified:
logwalker.py logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
------------------------------------------------------------
revno: 579.1.225
revision-id:jelmer at samba.org-20071209220239-tsbyak73lxr5yo9r
parent: jelmer at samba.org-20071206175113-m0ayc56h3u3wi5s5
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2007-12-09 23:02:39 +0100
message:
Use 1.5 interface by default for get_log, add compatibility with 1.4.
modified:
logwalker.py logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
=== modified file 'logwalker.py'
--- a/logwalker.py 2007-11-05 15:11:22 +0000
+++ b/logwalker.py 2007-12-09 22:48:48 +0000
@@ -82,8 +82,9 @@
pb = ui.ui_factory.nested_progress_bar()
- def rcvr(orig_paths, rev, author, date, message, pool):
- pb.update('fetching svn revision info', rev, to_revnum)
+ def rcvr(log_entry, pool):
+ pb.update('fetching svn revision info', log_entry.revision, to_revnum)
+ orig_paths = log_entry.changed_paths
if orig_paths is None:
orig_paths = {}
for p in orig_paths:
@@ -93,9 +94,9 @@
self.db.execute(
"replace into changed_path (rev, path, action, copyfrom_path, copyfrom_rev) values (?, ?, ?, ?, ?)",
- (rev, p.strip("/"), orig_paths[p].action, copyfrom_path, orig_paths[p].copyfrom_rev))
+ (log_entry.revision, p.strip("/"), orig_paths[p].action, copyfrom_path, orig_paths[p].copyfrom_rev))
- self.saved_revnum = rev
+ self.saved_revnum = log_entry.revision
if self.saved_revnum % 1000 == 0:
self.db.commit()
@@ -105,7 +106,7 @@
pool = Pool()
self._get_transport().get_log("/", self.saved_revnum,
to_revnum, self._limit, True,
- True, rcvr, pool)
+ True, [], rcvr, pool)
pool.destroy()
finally:
pb.finished()
=== modified file 'transport.py'
--- a/transport.py 2007-12-06 20:53:01 +0000
+++ b/transport.py 2007-12-09 22:49:20 +0000
@@ -325,10 +325,36 @@
@convert_svn_error
@needs_busy
- def get_log(self, path, from_revnum, to_revnum, *args, **kwargs):
+ def get_log(self, path, from_revnum, to_revnum, limit, discover_changed_paths,
+ strict_node_history, revprops, rcvr, pool=None):
self.mutter('svn log %r:%r %r' % (from_revnum, to_revnum, path))
+ if hasattr(svn.ra, 'get_log2'):
+ return svn.ra.get_log2(self._ra, [self._request_path(path)],
+ from_revnum, to_revnum, limit, discover_changed_paths,
+ strict_node_history, False,
+ revprops, rcvr, pool)
+
+ class LogEntry:
+ def __init__(self, changed_paths, rev, author, date, message):
+ self.changed_paths = changed_paths
+ self.revprops = {}
+ if svn.core.SVN_PROP_REVISION_AUTHOR in revprops:
+ self.revprops[svn.core.SVN_PROP_REVISION_AUTHOR] = author
+ if svn.core.SVN_PROP_REVISION_LOG in revprops:
+ self.revprops[svn.core.SVN_PROP_REVISION_LOG] = message
+ if svn.core.SVN_PROP_REVISION_DATE in revprops:
+ self.revprops[svn.core.SVN_PROP_REVISION_DATE] = date
+ # FIXME: Check other revprops
+ # FIXME: Handle revprops is None
+ self.revision = rev
+ self.has_children = None
+
+ def rcvr_convert(orig_paths, rev, author, date, message, pool):
+ rcvr(LogEntry(orig_paths, rev, author, date, message), pool)
+
return svn.ra.get_log(self._ra, [self._request_path(path)],
- from_revnum, to_revnum, *args, **kwargs)
+ from_revnum, to_revnum, limit, discover_changed_paths,
+ strict_node_history, rcvr_convert, pool)
def _open_real_transport(self):
if self._backing_url != self.svn_url:
More information about the bazaar-commits
mailing list