Mercurial > hg-stable
comparison mercurial/filemerge.py @ 38198: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 | aac4be30e250 |
children | 6c8e3c847977 |
comparison
equal
deleted
inserted
replaced
38197:aac4be30e250 | 38198:2ce60954b1b7 |
---|---|
9 | 9 |
10 import contextlib | 10 import contextlib |
11 import os | 11 import os |
12 import re | 12 import re |
13 import shutil | 13 import shutil |
14 import tempfile | |
15 | 14 |
16 from .i18n import _ | 15 from .i18n import _ |
17 from .node import nullid, short | 16 from .node import nullid, short |
18 | 17 |
19 from . import ( | 18 from . import ( |
711 use them. | 710 use them. |
712 """ | 711 """ |
713 tmproot = None | 712 tmproot = None |
714 tmprootprefix = repo.ui.config('experimental', 'mergetempdirprefix') | 713 tmprootprefix = repo.ui.config('experimental', 'mergetempdirprefix') |
715 if tmprootprefix: | 714 if tmprootprefix: |
716 tmproot = tempfile.mkdtemp(prefix=tmprootprefix) | 715 tmproot = pycompat.mkdtemp(prefix=tmprootprefix) |
717 | 716 |
718 def maketempfrompath(prefix, path): | 717 def maketempfrompath(prefix, path): |
719 fullbase, ext = os.path.splitext(path) | 718 fullbase, ext = os.path.splitext(path) |
720 pre = "%s~%s" % (os.path.basename(fullbase), prefix) | 719 pre = "%s~%s" % (os.path.basename(fullbase), prefix) |
721 if tmproot: | 720 if tmproot: |