Skip to content

Commit

Permalink
holy good god, it works!
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Aug 7, 2009
1 parent d6c90df commit 1e5b2d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions bin/agit-daemon
@@ -0,0 +1,10 @@
#!/usr/bin/python

import sys
from dulwich.server import TCPGitServer
from dulwich.agitmemnon import *

if __name__ == "__main__":
backend = AgitmemnonBackend()
server = TCPGitServer(backend, 'localhost')
server.serve_forever()
9 changes: 5 additions & 4 deletions dulwich/agitmemnon.py
Expand Up @@ -110,12 +110,13 @@ def fetch_objects(self, determine_wants, graph_walker, progress):
def get_refs(self):
"""Get dictionary with all refs."""
ret = {}
refs = a.get_super('Repositories', 'fuzed')
ret['HEAD'] = 'refs/heads/master' # TODO: fix this
refs = self.get_super('Repositories', 'fuzed') # TODO: dont hardcode the repo
for x in refs:
for col in x.columns:
if len(col.value) == 40:
ret['refs/' + x.name + '/' + col.name] = col.value
if x.name == 'heads' and col.name == 'master':
ret['HEAD'] = col.value
return ret

class AgitmemnonBackend(Backend):
Expand All @@ -126,7 +127,7 @@ def __init__(self):
self.get_refs = self.repo.get_refs


a = Agitmemnon()
#a = Agitmemnon()
#print a.get_object('7486f4075d2b9307d02e3905c69e28e456a51a32')[0].value
print a['7486f4075d2b9307d02e3905c69e28e456a51a32'].get_parents()
#print a['7486f4075d2b9307d02e3905c69e28e456a51a32'].get_parents()
#print a.get_object('7486f4075d2b9307d02e3905c69e28e456a51a32')

0 comments on commit 1e5b2d5

Please sign in to comment.