Rev 1932: Override log for server. in file:///data/jelmer/bzr-svn/trunk/
Jelmer Vernooij
jelmer at samba.org
Mon Oct 6 16:22:58 BST 2008
At file:///data/jelmer/bzr-svn/trunk/
------------------------------------------------------------
revno: 1932
revision-id: jelmer at samba.org-20081006152256-iuk1jke9n0pzczp6
parent: jelmer at samba.org-20081006150838-386vjgt628jx7188
parent: jelmer at samba.org-20081006152216-2xcsvbuq68k0a3op
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-10-06 17:22:56 +0200
message:
Override log for server.
modified:
__init__.py __init__.py-20051008155114-eae558e6cf149e1d
server.py server.py-20081006150454-t45tvwmbhpesdh7d-1
subvertpy/.bzrignore bzrignore-20081002201329-yj9jf0hmrtdpfw0u-1
subvertpy/subvertpy/server.py server.py-20081006143330-f9p0l7eih6izgoct-1
------------------------------------------------------------
revno: 1925.1.16
revision-id: jelmer at samba.org-20081006152216-2xcsvbuq68k0a3op
parent: jelmer at samba.org-20081006151559-vkw073ooobfvynbz
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-10-06 17:22:16 +0200
message:
Allow overriding log from backend.
modified:
subvertpy/server.py server.py-20081006143330-f9p0l7eih6izgoct-1
------------------------------------------------------------
revno: 1925.1.15
revision-id: jelmer at samba.org-20081006151559-vkw073ooobfvynbz
parent: jelmer at samba.org-20081006150636-32n872ou19lq58n2
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-10-06 17:15:59 +0200
message:
Ignore dist directory.
modified:
.bzrignore bzrignore-20081002201329-yj9jf0hmrtdpfw0u-1
=== modified file '__init__.py'
--- a/__init__.py 2008-10-06 15:08:38 +0000
+++ b/__init__.py 2008-10-06 15:22:56 +0000
@@ -562,7 +562,7 @@
sys.stdout.write(data)
sys.stdout.flush()
server = SVNServer(BzrServerBackend(directory), sys.stdin.read,
- send_fn)
+ send_fn, self.outf)
server.serve()
else:
if port is None:
=== modified file 'server.py'
--- a/server.py 2008-10-06 15:08:38 +0000
+++ b/server.py 2008-10-06 15:22:56 +0000
@@ -33,6 +33,27 @@
config.set_user_option('svn_uuid', uuid)
return str(uuid)
+ def log(self, send_revision, target_path, start_rev, end_rev, changed_paths,
+ strict_node, limit):
+ i = 0
+ revno = start_rev
+ self.branch.repository.lock_read()
+ try:
+ # FIXME: check whether start_rev and end_rev actually exist
+ while revno != end_rev:
+ #TODO: Honor target_path, strict_node, changed_paths
+ if end_rev > revno:
+ revno+=1
+ else:
+ revno-=1
+ if limit != 0 and i == limit:
+ break
+ if revno != 0:
+ rev = self.branch.repository.get_revision(self.branch.get_rev_id(revno))
+ send_revision(revno, rev.committer, time.strftime("%Y-%m-%dT%H:%M:%S.00000Z", time.gmtime(rev.timestamp)), rev.message)
+ finally:
+ self.branch.repository.unlock()
+
class BzrServerBackend(ServerBackend):
=== modified file 'subvertpy/.bzrignore'
--- a/subvertpy/.bzrignore 2008-10-02 20:25:33 +0000
+++ b/subvertpy/.bzrignore 2008-10-06 15:15:59 +0000
@@ -1,2 +1,3 @@
build
_trial_temp
+dist
=== modified file 'subvertpy/subvertpy/server.py'
--- a/subvertpy/subvertpy/server.py 2008-10-06 15:06:36 +0000
+++ b/subvertpy/subvertpy/server.py 2008-10-06 15:22:16 +0000
@@ -36,6 +36,9 @@
def get_latest_revnum(self):
raise NotImplementedError(self.get_latest_revnum)
+ def log(self, send_revision, target_path, start_rev, end_rev, changed_paths,
+ strict_node, limit):
+ raise NotImplementedError(self.log)
SVN_MAJOR_VERSION = 1
@@ -76,29 +79,12 @@
def log(self, target_path, start_rev, end_rev, changed_paths,
strict_node, limit=None):
- def send_revision(revno, rev):
- self.send_msg([[], revno, [rev.committer],
- [time.strftime("%Y-%m-%dT%H:%M:%S.00000Z", time.gmtime(rev.timestamp))],
- [rev.message]])
+ def send_revision(revno, author, date, message):
+ self.send_msg([[], revno, [author], [date], [message]])
self.send_success([], "")
- revno = start_rev[0]
- i = 0
- self.branch.repository.lock_read()
- try:
- # FIXME: check whether start_rev and end_rev actually exist
- while revno != end_rev[0]:
- #TODO: Honor target_path, strict_node, changed_paths
- if end_rev[0] > revno:
- revno+=1
- else:
- revno-=1
- if limit != 0 and i == limit:
- break
- if revno != 0:
- send_revision(revno, self.branch.repository.get_revision(self.branch.get_rev_id(revno)))
- finally:
- self.branch.repository.unlock()
-
+ self.repo_backend.log(send_revision, target_path, start_rev[0],
+ end_rev[0],
+ changed_paths, strict_node, limit)
self.send_msg(literal("done"))
self.send_success()
More information about the bazaar-commits
mailing list