/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to commands.py

Support 'bzr serve --git'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    lazy_check_versions,
34
34
    )
35
35
 
36
 
class cmd_git_serve(Command):
37
 
    """Provide access to a Bazaar branch using the git protocol.
38
 
 
39
 
    This command is experimental and doesn't do much yet.
40
 
    """
41
 
    takes_options = [
42
 
        Option('directory',
43
 
               short_name='d',
44
 
               help='serve contents of directory',
45
 
               type=unicode)
46
 
    ]
47
 
 
48
 
    def run(self, directory=None):
49
 
        lazy_check_versions()
50
 
        from dulwich.server import TCPGitServer
51
 
        from bzrlib.plugins.git.server import BzrBackend
52
 
        from bzrlib.trace import warning
53
 
        import os
54
 
 
55
 
        warning("server support in bzr-git is experimental.")
56
 
 
57
 
        if directory is None:
58
 
            directory = os.getcwd()
59
 
 
60
 
        backend = BzrBackend(directory)
61
 
 
62
 
        server = TCPGitServer(backend, 'localhost')
63
 
        server.serve_forever()
64
 
 
65
 
 
66
36
class cmd_git_import(Command):
67
37
    """Import all branches from a git repository.
68
38