dirstate: fix call to os.lstat when st is None
authorVadim Gelfer <vadim.gelfer@gmail.com>
Tue, 13 Jun 2006 14:56:01 -0700
changeset 2429 6a8f7c3f7333
parent 2428 42b8a1ff46cf
child 2430 4ccd71b83d5e
dirstate: fix call to os.lstat when st is None
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Tue Jun 13 08:56:23 2006 -0700
+++ b/mercurial/dirstate.py	Tue Jun 13 14:56:01 2006 -0700
@@ -455,8 +455,7 @@
                 nonexistent = True
                 if not st:
                     try:
-                        f = self.wjoin(fn)
-                        st = os.lstat(f)
+                        st = os.lstat(self.wjoin(fn))
                     except OSError, inst:
                         if inst.errno != errno.ENOENT:
                             raise
@@ -472,7 +471,7 @@
             # check the common case first
             if type_ == 'n':
                 if not st:
-                    st = os.stat(fn)
+                    st = os.stat(self.wjoin(fn))
                 if size >= 0 and (size != st.st_size
                                   or (mode ^ st.st_mode) & 0100):
                     modified.append(fn)