Show More
@@ -25,8 +25,29 b' urlreq = util.urlreq' | |||||
25 |
|
25 | |||
26 | CB_MANIFEST_FILE = b'clonebundles.manifest' |
|
26 | CB_MANIFEST_FILE = b'clonebundles.manifest' | |
27 |
|
27 | |||
|
28 | ||||
28 | def get_manifest(repo): |
|
29 | def get_manifest(repo): | |
29 | return repo.vfs.tryread(CB_MANIFEST_FILE) |
|
30 | """get the bundle manifest to be served to a client from a server""" | |
|
31 | raw_text = repo.vfs.tryread(CB_MANIFEST_FILE) | |||
|
32 | entries = [e.split(b' ', 1) for e in raw_text.splitlines()] | |||
|
33 | ||||
|
34 | new_lines = [] | |||
|
35 | for e in entries: | |||
|
36 | url = alter_bundle_url(repo, e[0]) | |||
|
37 | if len(e) == 1: | |||
|
38 | line = url + b'\n' | |||
|
39 | else: | |||
|
40 | line = b"%s %s\n" % (url, e[1]) | |||
|
41 | new_lines.append(line) | |||
|
42 | return b''.join(new_lines) | |||
|
43 | ||||
|
44 | ||||
|
45 | def alter_bundle_url(repo, url): | |||
|
46 | """a function that exist to help extension and hosting to alter the url | |||
|
47 | ||||
|
48 | This will typically be used to inject authentication information in the url | |||
|
49 | of cached bundles.""" | |||
|
50 | return url | |||
30 |
|
51 | |||
31 |
|
52 | |||
32 | @attr.s |
|
53 | @attr.s |
General Comments 0
You need to be logged in to leave comments.
Login now