Rev 1942: Support get-locations. in file:///data/jelmer/bzr-svn/trunk/

Jelmer Vernooij jelmer at samba.org
Mon Oct 6 19:08:21 BST 2008


At file:///data/jelmer/bzr-svn/trunk/

------------------------------------------------------------
revno: 1942
revision-id: jelmer at samba.org-20081006180819-xmg0tentjcatnogl
parent: jelmer at samba.org-20081006180017-xc4pccyxn44vy23w
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-10-06 20:08:19 +0200
message:
  Support get-locations.
modified:
  server.py                      server.py-20081006150454-t45tvwmbhpesdh7d-1
  subvertpy/subvertpy/server.py  server.py-20081006143330-f9p0l7eih6izgoct-1
=== modified file 'server.py'
--- a/server.py	2008-10-06 17:22:35 +0000
+++ b/server.py	2008-10-06 18:08:19 +0000
@@ -85,6 +85,9 @@
         finally:
             self.branch.repository.unlock()
 
+    def rev_proplist(self, revnum):
+        return {}
+
     def update(self, editor, revnum, target_path, recurse=True):
         editor.set_target_revision(revnum)
         root = editor.open_root()
@@ -94,6 +97,11 @@
 
     def check_path(self, path, revnum):
         return NODE_DIR
+
+    def get_locations(self, path, peg_revnum, revnums):
+        if path.strip() in ("trunk", ""):
+            return dict([(rev, path) for rev in revnums])
+        raise NotImplementedError
     
 
 class BzrServerBackend(ServerBackend):

=== modified file 'subvertpy/subvertpy/server.py'
--- a/subvertpy/subvertpy/server.py	2008-10-06 18:00:17 +0000
+++ b/subvertpy/subvertpy/server.py	2008-10-06 18:08:19 +0000
@@ -52,6 +52,9 @@
     def rev_proplist(self, revnum):
         raise NotImplementedError(self.rev_proplist)
 
+    def get_locations(self, path, peg_revnum, revnums):
+        raise NotImplementedError(self.get_locations)
+
 
 MAJOR_VERSION = 1
 MINOR_VERSION = 2
@@ -169,6 +172,14 @@
         else:
             self.send_success()
 
+    def get_locations(self, path, peg_revnum, revnums):
+        self.send_ack()
+        locations = self.repo_backend.get_locations(path, peg_revnum, revnums)
+        for rev, path in locations.items():
+            self.send_msg([rev, path])
+        self.send_msg(literal("done"))
+        self.send_success()
+
     def update(self, rev, target, recurse, depth=None, send_copyfrom_param=True):
         self.send_ack()
         while True:
@@ -240,6 +251,7 @@
             "commit": commit,
             "rev-proplist": rev_proplist,
             "rev-prop": rev_prop,
+            "get-locations": get_locations,
             # FIXME: get-dated-rev
             # FIXME: get-file
             # FIXME: get-dir
@@ -247,7 +259,6 @@
             # FIXME: switch
             # FIXME: status
             # FIXME: diff
-            # FIXME: get-locations
             # FIXME: get-file-revs
             # FIXME: replay
     }




More information about the bazaar-commits mailing list