Read about our upcoming Code of Conduct on this issue

Commit e029e907 authored by Steve Borho's avatar Steve Borho
Browse files

sync: use tempfile.mktemp() to generate unique bundle file names

parent 9c6ac7db874c
......@@ -8,6 +8,7 @@
import os
import re
import tempfile
import urlparse
from PyQt4.QtCore import *
......@@ -600,9 +601,7 @@ class SyncWidget(QWidget):
for badchar in (':', '*', '\\', '?', '#'):
bfile = bfile.replace(badchar, '')
bfile = bfile.replace('/', '_')
bfile = os.path.join(qtlib.gettempdir(), bfile) + '.hg'
if os.path.exists(bfile):
os.unlink(bfile)
bfile = tempfile.mktemp('.hg', bfile+'_', qtlib.gettempdir())
self.finishfunc = finished
cmdline = ['--repository', self.repo.root, 'incoming',
'--bundle', bfile]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment