/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 breezy/git/server.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
from .mapping import (
33
33
    default_mapping,
 
34
    decode_git_path,
34
35
    )
35
36
from .object_store import (
36
37
    BazaarObjectStore,
58
59
 
59
60
    def open_repository(self, path):
60
61
        # FIXME: More secure path sanitization
61
 
        transport = self.transport.clone(path.decode('utf-8').lstrip("/"))
 
62
        transport = self.transport.clone(decode_git_path(path).lstrip("/"))
62
63
        trace.mutter('client opens %r: %r', path, transport)
63
64
        return BzrBackendRepo(transport, self.mapping)
64
65
 
90
91
            have = self.object_store.find_common_revisions(graph_walker)
91
92
            if wants is None:
92
93
                return
 
94
            shallows = getattr(graph_walker, 'shallow', frozenset())
93
95
            if isinstance(self.object_store, BazaarObjectStore):
94
96
                return self.object_store.generate_pack_contents(
95
 
                    have, wants, progress, get_tagged=get_tagged, lossy=True)
 
97
                    have, wants, shallow=shallows,
 
98
                    progress=progress, get_tagged=get_tagged, lossy=True)
96
99
            else:
97
 
                return self.object_store.generate_pack_contents(
98
 
                    have, wants, progress)
 
100
                if shallows:
 
101
                    return self.object_store.generate_pack_contents(
 
102
                        have, wants, shallow=shallows, progress=progress)
 
103
                else:
 
104
                    return self.object_store.generate_pack_contents(
 
105
                        have, wants, progress=progress)
99
106
 
100
107
 
101
108
class BzrTCPGitServer(TCPGitServer):
163
170
 
164
171
def serve_git_receive_pack(transport, host=None, port=None, inet=False):
165
172
    if not inet:
166
 
        raise errors.BzrCommandError(
 
173
        raise errors.CommandError(
167
174
            "git-receive-pack only works in inetd mode")
168
175
    backend = BzrBackend(transport)
169
176
    sys.exit(serve_command(ReceivePackHandler, backend=backend))
171
178
 
172
179
def serve_git_upload_pack(transport, host=None, port=None, inet=False):
173
180
    if not inet:
174
 
        raise errors.BzrCommandError(
 
181
        raise errors.CommandError(
175
182
            "git-receive-pack only works in inetd mode")
176
183
    backend = BzrBackend(transport)
177
184
    sys.exit(serve_command(UploadPackHandler, backend=backend))