##// END OF EJS Templates
replace os.stat with os.lstat in some where.
Vadim Gelfer -
r2448:b77a2ef6 default
parent child Browse files
Show More
@@ -471,7 +471,7 b' class dirstate(object):'
471 # check the common case first
471 # check the common case first
472 if type_ == 'n':
472 if type_ == 'n':
473 if not st:
473 if not st:
474 st = os.stat(self.wjoin(fn))
474 st = os.lstat(self.wjoin(fn))
475 if size >= 0 and (size != st.st_size
475 if size >= 0 and (size != st.st_size
476 or (mode ^ st.st_mode) & 0100):
476 or (mode ^ st.st_mode) & 0100):
477 modified.append(fn)
477 modified.append(fn)
@@ -242,7 +242,7 b' class localrepository(object):'
242 raise repo.RepoError(_("unknown revision '%s'") % key)
242 raise repo.RepoError(_("unknown revision '%s'") % key)
243
243
244 def dev(self):
244 def dev(self):
245 return os.stat(self.path).st_dev
245 return os.lstat(self.path).st_dev
246
246
247 def local(self):
247 def local(self):
248 return True
248 return True
@@ -474,7 +474,7 b' def _readlock_file(pathname):'
474
474
475 def nlinks(pathname):
475 def nlinks(pathname):
476 """Return number of hardlinks for the given file."""
476 """Return number of hardlinks for the given file."""
477 return os.stat(pathname).st_nlink
477 return os.lstat(pathname).st_nlink
478
478
479 if hasattr(os, 'link'):
479 if hasattr(os, 'link'):
480 os_link = os.link
480 os_link = os.link
@@ -625,10 +625,10 b' else:'
625
625
626 def is_exec(f, last):
626 def is_exec(f, last):
627 """check whether a file is executable"""
627 """check whether a file is executable"""
628 return (os.stat(f).st_mode & 0100 != 0)
628 return (os.lstat(f).st_mode & 0100 != 0)
629
629
630 def set_exec(f, mode):
630 def set_exec(f, mode):
631 s = os.stat(f).st_mode
631 s = os.lstat(f).st_mode
632 if (s & 0100 != 0) == mode:
632 if (s & 0100 != 0) == mode:
633 return
633 return
634 if mode:
634 if mode:
@@ -162,7 +162,7 b' def nlinks(pathname):'
162 fh.Close()
162 fh.Close()
163 return res[7]
163 return res[7]
164 except pywintypes.error:
164 except pywintypes.error:
165 return os.stat(pathname).st_nlink
165 return os.lstat(pathname).st_nlink
166
166
167 def testpid(pid):
167 def testpid(pid):
168 '''return True if pid is still running or unable to
168 '''return True if pid is still running or unable to
General Comments 0
You need to be logged in to leave comments. Login now