Show More
@@ -12,8 +12,8 of the GNU General Public License, incor | |||||
12 |
|
12 | |||
13 | from node import hex, nullid, short |
|
13 | from node import hex, nullid, short | |
14 | from i18n import _ |
|
14 | from i18n import _ | |
15 | import changegroup, util, os, struct, bz2, tempfile, mdiff |
|
15 | import changegroup, util, os, struct, bz2, tempfile, shutil, mdiff | |
16 | import localrepo, changelog, manifest, filelog, revlog |
|
16 | import repo, localrepo, changelog, manifest, filelog, revlog | |
17 |
|
17 | |||
18 | class bundlerevlog(revlog.revlog): |
|
18 | class bundlerevlog(revlog.revlog): | |
19 | def __init__(self, opener, indexfile, bundlefile, |
|
19 | def __init__(self, opener, indexfile, bundlefile, | |
@@ -153,7 +153,13 class bundlefilelog(bundlerevlog, filelo | |||||
153 |
|
153 | |||
154 | class bundlerepository(localrepo.localrepository): |
|
154 | class bundlerepository(localrepo.localrepository): | |
155 | def __init__(self, ui, path, bundlename): |
|
155 | def __init__(self, ui, path, bundlename): | |
|
156 | self._tempparent = None | |||
|
157 | try: | |||
156 | localrepo.localrepository.__init__(self, ui, path) |
|
158 | localrepo.localrepository.__init__(self, ui, path) | |
|
159 | except repo.RepoError: | |||
|
160 | self._tempparent = tempfile.mkdtemp() | |||
|
161 | tmprepo = localrepo.instance(ui,self._tempparent,1) | |||
|
162 | localrepo.localrepository.__init__(self, ui, self._tempparent) | |||
157 |
|
163 | |||
158 | if path: |
|
164 | if path: | |
159 | self._url = 'bundle:' + path + '+' + bundlename |
|
165 | self._url = 'bundle:' + path + '+' + bundlename | |
@@ -252,6 +258,8 class bundlerepository(localrepo.localre | |||||
252 | tempfile = getattr(self, 'tempfile', None) |
|
258 | tempfile = getattr(self, 'tempfile', None) | |
253 | if tempfile is not None: |
|
259 | if tempfile is not None: | |
254 | os.unlink(tempfile) |
|
260 | os.unlink(tempfile) | |
|
261 | if self._tempparent: | |||
|
262 | shutil.rmtree(self._tempparent, True) | |||
255 |
|
263 | |||
256 | def instance(ui, path, create): |
|
264 | def instance(ui, path, create): | |
257 | if create: |
|
265 | if create: |
General Comments 0
You need to be logged in to leave comments.
Login now