comparison hgext/extdiff.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 daafaff4e5be
children c303d65d2e34
comparison
equal deleted inserted replaced
38164:aac4be30e250 38165:2ce60954b1b7
69 69
70 import os 70 import os
71 import re 71 import re
72 import shutil 72 import shutil
73 import stat 73 import stat
74 import tempfile 74
75 from mercurial.i18n import _ 75 from mercurial.i18n import _
76 from mercurial.node import ( 76 from mercurial.node import (
77 nullid, 77 nullid,
78 short, 78 short,
79 ) 79 )
208 modadd = mod_a | add_a | mod_b | add_b 208 modadd = mod_a | add_a | mod_b | add_b
209 common = modadd | rem_a | rem_b 209 common = modadd | rem_a | rem_b
210 if not common: 210 if not common:
211 return 0 211 return 0
212 212
213 tmproot = tempfile.mkdtemp(prefix='extdiff.') 213 tmproot = pycompat.mkdtemp(prefix='extdiff.')
214 try: 214 try:
215 if not opts.get('patch'): 215 if not opts.get('patch'):
216 # Always make a copy of node1a (and node1b, if applicable) 216 # Always make a copy of node1a (and node1b, if applicable)
217 dir1a_files = mod_a | rem_a | ((mod_b | add_b) - add_a) 217 dir1a_files = mod_a | rem_a | ((mod_b | add_b) - add_a)
218 dir1a = snapshot(ui, repo, dir1a_files, node1a, tmproot, 218 dir1a = snapshot(ui, repo, dir1a_files, node1a, tmproot,