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