Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable TortoiseHgOverlayServer: use posixfile and friends from mercurial

Changeset a85a8e8a85b9

Parent d0dd303c1547

by Adrian Buehlmann

Changes to one file · Browse files at a85a8e8a85b9 Showing diff from parent d0dd303c1547 Diff from another changeset...

 
43
44
45
 
46
47
48
 
57
58
59
60
 
61
62
63
64
65
66
67
 
68
69
70
 
353
354
355
356
 
357
358
359
360
361
362
 
 
 
363
364
365
 
43
44
45
46
47
48
49
 
58
59
60
 
61
62
63
 
 
 
 
 
64
65
66
67
 
350
351
352
 
353
354
355
356
 
 
 
357
358
359
360
361
362
@@ -43,6 +43,7 @@
 demandimport.ignore.append('win32com.shell')  demandimport.enable()  from mercurial import ui, error +from mercurial.windows import posixfile, unlink, rename  from tortoisehg.util.i18n import agettext as _  from tortoisehg.util import thread2, paths, shlib, version   @@ -57,14 +58,10 @@
  def setfile(self, name):   oname = name + '.old'   try: - os.unlink(oname) + rename(name, oname)   except:   pass - try: - os.rename(name, oname) - except: - pass - self.file = open(name, 'wb') + self.file = posixfile(name, 'wb')   self.msg('%s, Version %s' % (APP_TITLE, version.version()))   self.msg('Logging to file started')   @@ -353,13 +350,13 @@
  for r in sorted(roots):   tfn = os.path.join(r, '.hg', 'thgstatus')   try: - f = open(tfn, 'rb') + f = posixfile(tfn, 'rb')   e = f.readline()   f.close()   if not e.startswith('@@noicons'): - os.remove(tfn) - except (IOError, OSError): - print "IOError or OSError while trying to remove %s" % tfn + unlink(tfn) + except (IOError, OSError), e: + logger.msg("Error while trying to remove %s (%s)" % (tfn, e))   pass   if notifypaths:   shlib.shell_notify(list(notifypaths))