Mercurial > hg
comparison mercurial/bundlerepo.py @ 38165:2ce60954b1b7
py3: wrap tempfile.mkdtemp() to use bytes path
This also flips the default to use a bytes path on Python 3.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 26 May 2018 12:20:36 +0900 |
parents | 0664be4f0c1f |
children | 6104b203bec8 |
comparison
equal
deleted
inserted
replaced
38164:aac4be30e250 | 38165:2ce60954b1b7 |
---|---|
13 | 13 |
14 from __future__ import absolute_import | 14 from __future__ import absolute_import |
15 | 15 |
16 import os | 16 import os |
17 import shutil | 17 import shutil |
18 import tempfile | |
19 | 18 |
20 from .i18n import _ | 19 from .i18n import _ |
21 from .node import nullid | 20 from .node import nullid |
22 | 21 |
23 from . import ( | 22 from . import ( |
268 def __init__(self, ui, repopath, bundlepath): | 267 def __init__(self, ui, repopath, bundlepath): |
269 self._tempparent = None | 268 self._tempparent = None |
270 try: | 269 try: |
271 localrepo.localrepository.__init__(self, ui, repopath) | 270 localrepo.localrepository.__init__(self, ui, repopath) |
272 except error.RepoError: | 271 except error.RepoError: |
273 self._tempparent = tempfile.mkdtemp() | 272 self._tempparent = pycompat.mkdtemp() |
274 localrepo.instance(ui, self._tempparent, 1) | 273 localrepo.instance(ui, self._tempparent, 1) |
275 localrepo.localrepository.__init__(self, ui, self._tempparent) | 274 localrepo.localrepository.__init__(self, ui, self._tempparent) |
276 self.ui.setconfig('phases', 'publish', False, 'bundlerepo') | 275 self.ui.setconfig('phases', 'publish', False, 'bundlerepo') |
277 | 276 |
278 if repopath: | 277 if repopath: |