/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

Default to using global user id rather than making one up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
from bzrlib.plugins.git import (
32
32
    get_rich_root_format,
33
 
    lazy_check_versions,
34
33
    )
35
34
 
 
35
class cmd_git_serve(Command):
 
36
    """Provide access to a Bazaar branch using the git protocol.
 
37
 
 
38
    This command is experimental and doesn't do much yet.
 
39
    """
 
40
    takes_options = [
 
41
        Option('directory',
 
42
               short_name='d',
 
43
               help='serve contents of directory',
 
44
               type=unicode)
 
45
    ]
 
46
 
 
47
    def run(self, directory=None):
 
48
        lazy_check_versions()
 
49
        from dulwich.server import TCPGitServer
 
50
        from bzrlib.plugins.git.server import BzrBackend
 
51
        from bzrlib.trace import warning
 
52
        import os
 
53
 
 
54
        warning("server support in bzr-git is experimental.")
 
55
 
 
56
        if directory is None:
 
57
            directory = os.getcwd()
 
58
 
 
59
        backend = BzrBackend(directory)
 
60
 
 
61
        server = TCPGitServer(backend, 'localhost')
 
62
        server.serve_forever()
 
63
 
 
64
 
36
65
class cmd_git_import(Command):
37
66
    """Import all branches from a git repository.
38
67
 
144
173
        try:
145
174
            if sha1 is not None:
146
175
                try:
147
 
                    obj = object_store[str(sha1)]
 
176
                    obj = object_store[sha1]
148
177
                except KeyError:
149
178
                    raise BzrCommandError("Object not found: %s" % sha1)
150
179
                if pretty: