mercurial/util.py
changeset 14004 97ed99d1f419
parent 13985 26335a817dd0
child 14007 d764463b433e
equal deleted inserted replaced
14003:ba734ff5cadd 14004:97ed99d1f419
   204         return r
   204         return r
   205     finally:
   205     finally:
   206         try:
   206         try:
   207             if inname:
   207             if inname:
   208                 os.unlink(inname)
   208                 os.unlink(inname)
   209         except:
   209         except OSError:
   210             pass
   210             pass
   211         try:
   211         try:
   212             if outname:
   212             if outname:
   213                 os.unlink(outname)
   213                 os.unlink(outname)
   214         except:
   214         except OSError:
   215             pass
   215             pass
   216 
   216 
   217 filtertable = {
   217 filtertable = {
   218     'tempfile:': tempfilter,
   218     'tempfile:': tempfilter,
   219     'pipe:': pipefilter,
   219     'pipe:': pipefilter,
   405 def copyfile(src, dest):
   405 def copyfile(src, dest):
   406     "copy a file, preserving mode and atime/mtime"
   406     "copy a file, preserving mode and atime/mtime"
   407     if os.path.islink(src):
   407     if os.path.islink(src):
   408         try:
   408         try:
   409             os.unlink(dest)
   409             os.unlink(dest)
   410         except:
   410         except OSError:
   411             pass
   411             pass
   412         os.symlink(os.readlink(src), dest)
   412         os.symlink(os.readlink(src), dest)
   413     else:
   413     else:
   414         try:
   414         try:
   415             shutil.copyfile(src, dest)
   415             shutil.copyfile(src, dest)
   554     try:
   554     try:
   555         s2 = os.stat(p2)
   555         s2 = os.stat(p2)
   556         if s2 == s1:
   556         if s2 == s1:
   557             return False
   557             return False
   558         return True
   558         return True
   559     except:
   559     except OSError:
   560         return True
   560         return True
   561 
   561 
   562 _fspathcache = {}
   562 _fspathcache = {}
   563 def fspath(name, root):
   563 def fspath(name, root):
   564     '''Get name in the case stored in the filesystem
   564     '''Get name in the case stored in the filesystem