Show More
@@ -59,7 +59,7 b' bundletypes = {' | |||
|
59 | 59 | # hgweb uses this list to communicate its preferred type |
|
60 | 60 | bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN'] |
|
61 | 61 | |
|
62 | def writebundle(cg, filename, bundletype): | |
|
62 | def writebundle(cg, filename, bundletype, vfs=None): | |
|
63 | 63 | """Write a bundle file and return its filename. |
|
64 | 64 | |
|
65 | 65 | Existing files will not be overwritten. |
@@ -72,6 +72,9 b' def writebundle(cg, filename, bundletype' | |||
|
72 | 72 | cleanup = None |
|
73 | 73 | try: |
|
74 | 74 | if filename: |
|
75 | if vfs: | |
|
76 | fh = vfs.open(filename, "wb") | |
|
77 | else: | |
|
75 | 78 | fh = open(filename, "wb") |
|
76 | 79 | else: |
|
77 | 80 | fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg") |
@@ -112,6 +115,9 b' def writebundle(cg, filename, bundletype' | |||
|
112 | 115 | if fh is not None: |
|
113 | 116 | fh.close() |
|
114 | 117 | if cleanup is not None: |
|
118 | if filename and vfs: | |
|
119 | vfs.unlink(cleanup) | |
|
120 | else: | |
|
115 | 121 | os.unlink(cleanup) |
|
116 | 122 | |
|
117 | 123 | def decompressor(fh, alg): |
General Comments 0
You need to be logged in to leave comments.
Login now