Dulwich.io dulwich / 697e093
Make dul-daemon a trivial wrapper around server functionality. Dave Borowitz authored 9 years ago Jelmer Vernooij committed 9 years ago
3 changed file(s) with 22 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
3838
3939 * dulwich.pack.write_pack_index_v{1,2} now take a file-like object
4040 rather than a filename. (Jelmer Vernooij)
41
42 * Make dul-daemon a trivial wrapper around server functionality.
43 (Dave Borowitz)
4144
4245
4346 0.6.0 2010-05-22
1616 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
1717 # MA 02110-1301, USA.
1818
19 import sys
20 from dulwich.log_utils import default_logging_config
21 from dulwich.repo import Repo
22 from dulwich.server import DictBackend, TCPGitServer
19 from dulwich.server import main
2320
24 if __name__ == "__main__":
25 if len(sys.argv) > 1:
26 gitdir = sys.argv[1]
27 else:
28 gitdir = "."
29
30 default_logging_config()
31 backend = DictBackend({"/": Repo(gitdir)})
32 server = TCPGitServer(backend, 'localhost')
33 server.serve_forever()
21 if __name__ == '__main__':
22 main()
5757 extract_capabilities,
5858 extract_want_line_capabilities,
5959 )
60 from dulwich.repo import (
61 Repo,
62 )
6063
6164
6265 logger = log_utils.getLogger(__name__)
707710 def handle_error(self, request, client_address):
708711 logger.exception('Exception happened during processing of request '
709712 'from %s', client_address)
713
714
715 def main(argv=sys.argv):
716 """Entry point for starting a TCP git server."""
717 if len(argv) > 1:
718 gitdir = argv[1]
719 else:
720 gitdir = '.'
721
722 log_utils.default_logging_config()
723 backend = DictBackend({'/': Repo(gitdir)})
724 server = TCPGitServer(backend, 'localhost')
725 server.serve_forever()