mercurial/util.py
changeset 13313 0c493e5ce8e9
parent 13282 c01eea6c455b
parent 13305 035684c6b69a
child 13316 d119403fd266
equal deleted inserted replaced
13304:e4b02eb825b1 13313:0c493e5ce8e9
   916                 else:
   916                 else:
   917                     # nlinks() may behave differently for files on Windows
   917                     # nlinks() may behave differently for files on Windows
   918                     # shares if the file is open.
   918                     # shares if the file is open.
   919                     fd = open(f)
   919                     fd = open(f)
   920                     nlink = nlinks(f)
   920                     nlink = nlinks(f)
       
   921                     if nlink < 1:
       
   922                         nlink = 2 # force mktempcopy (issue1922)
   921                     fd.close()
   923                     fd.close()
   922             except (OSError, IOError), e:
   924             except (OSError, IOError), e:
   923                 if e.errno != errno.ENOENT:
   925                 if e.errno != errno.ENOENT:
   924                     raise
   926                     raise
   925                 nlink = 0
   927                 nlink = 0