Permalink
Browse files

it will now parse the repo name

  • Loading branch information...
1 parent d8a99df commit 694d36c41947d783cfb8e9b2e0a0e86eb3b3cd5a @schacon committed Aug 9, 2009
Showing with 15 additions and 4 deletions.
  1. +11 −1 dulwich/agitmemnon.py
  2. +4 −3 dulwich/server.py
View
@@ -109,8 +109,9 @@ def fetch_objects(self, determine_wants, graph_walker, progress):
def get_refs(self):
"""Get dictionary with all refs."""
+ print self.repo_name
ret = {}
- refs = self.get_super('Repositories', 'fuzed') # TODO: dont hardcode the repo
+ refs = self.get_super('Repositories', self.repo_name)
for x in refs:
for col in x.columns:
if len(col.value) == 40:
@@ -119,12 +120,21 @@ def get_refs(self):
ret['HEAD'] = col.value
return ret
+ def set_args(self, args):
+ rname = args[0]
+ if rname[0] == '/':
+ rname = rname[1:len(rname)]
+ if rname.endswith('.git'):
+ rname = rname.replace('.git','')
+ self.repo_name = rname
+
class AgitmemnonBackend(Backend):
def __init__(self):
self.repo = Agitmemnon()
self.fetch_objects = self.repo.fetch_objects
self.get_refs = self.repo.get_refs
+ self.set_args = self.repo.set_args
#a = Agitmemnon()
View
@@ -95,9 +95,10 @@ def apply_pack(self, refs, read):
class Handler(object):
"""Smart protocol command handler base class."""
- def __init__(self, backend, read, write):
+ def __init__(self, backend, read, write, args):
self.backend = backend
self.proto = Protocol(read, write)
+ self.backend.set_args(args)
def capabilities(self):
return " ".join(self.default_capabilities())
@@ -231,8 +232,8 @@ def handle(self):
cls = ReceivePackHandler
else:
return
-
- h = cls(self.server.backend, self.rfile.read, self.wfile.write)
+
+ h = cls(self.server.backend, self.rfile.read, self.wfile.write, args)
h.handle()

0 comments on commit 694d36c

Please sign in to comment.