--- a/mercurial/dirstate.py Tue Sep 03 15:50:59 2013 -0500
+++ b/mercurial/dirstate.py Tue Sep 03 17:06:19 2013 -0400
@@ -801,12 +801,9 @@
mexact = match.exact
dirignore = self._dirignore
checkexec = self._checkexec
- checklink = self._checklink
copymap = self._copymap
lastnormaltime = self._lastnormaltime
- lnkkind = stat.S_IFLNK
-
# We need to do full walks when either
# - we're listing all clean files, or
# - match.traversedir does something, because match.traversedir should
@@ -827,20 +824,14 @@
if not st and state in "nma":
dadd(fn)
elif state == 'n':
- # The "mode & lnkkind != lnkkind or self._checklink"
- # lines are an expansion of "islink => checklink"
- # where islink means "is this a link?" and checklink
- # means "can we check links?".
mtime = int(st.st_mtime)
if (size >= 0 and
((size != st.st_size and size != st.st_size & _rangemask)
or ((mode ^ st.st_mode) & 0100 and checkexec))
- and (mode & lnkkind != lnkkind or checklink)
or size == -2 # other parent
or fn in copymap):
madd(fn)
- elif ((time != mtime and time != mtime & _rangemask)
- and (mode & lnkkind != lnkkind or checklink)):
+ elif time != mtime and time != mtime & _rangemask:
ladd(fn)
elif mtime == lastnormaltime:
# fn may have been changed in the same timeslot without
--- a/mercurial/localrepo.py Tue Sep 03 15:50:59 2013 -0500
+++ b/mercurial/localrepo.py Tue Sep 03 17:06:19 2013 -0400
@@ -1557,7 +1557,7 @@
for f in modified:
if ctx2.flags(f) == 'l':
d = ctx2[f].data()
- if len(d) >= 1024 or '\n' in d or util.binary(d):
+ if d == '' or len(d) >= 1024 or '\n' in d or util.binary(d):
self.ui.debug('ignoring suspect symlink placeholder'
' "%s"\n' % f)
continue
--- a/mercurial/parsers.c Tue Sep 03 15:50:59 2013 -0500
+++ b/mercurial/parsers.c Tue Sep 03 17:06:19 2013 -0400
@@ -330,7 +330,7 @@
* this. */
if (PyDict_SetItem(map, k, dirstate_unset) == -1)
goto bail;
- mode = 0, size = -1, mtime = -1;
+ mtime = -1;
}
putbe32(mode, p);
putbe32(size, p + 4);
--- a/mercurial/pure/parsers.py Tue Sep 03 15:50:59 2013 -0500
+++ b/mercurial/pure/parsers.py Tue Sep 03 17:06:19 2013 -0400
@@ -100,11 +100,11 @@
# systems with a granularity of 1 sec). This commonly happens
# for at least a couple of files on 'update'.
# The user could change the file without changing its size
- # within the same second. Invalidate the file's stat data in
+ # within the same second. Invalidate the file's mtime in
# dirstate, forcing future 'status' calls to compare the
- # contents of the file. This prevents mistakenly treating such
- # files as clean.
- e = (e[0], 0, -1, -1) # mark entry as 'unset'
+ # contents of the file if the size is the same. This prevents
+ # mistakenly treating such files as clean.
+ e = (e[0], e[1], e[2], -1)
dmap[f] = e
if f in copymap:
--- a/tests/test-symlink-placeholder.t Tue Sep 03 15:50:59 2013 -0500
+++ b/tests/test-symlink-placeholder.t Tue Sep 03 17:06:19 2013 -0400
@@ -41,6 +41,13 @@
a (no-eol)
$ hg --config extensions.n=$TESTTMP/nolink.py st --debug
+Empty placeholder:
+
+ $ rm b
+ $ touch b
+ $ hg --config extensions.n=$TESTTMP/nolink.py st --debug
+ ignoring suspect symlink placeholder "b"
+
Write binary data to the placeholder:
>>> open('b', 'w').write('this is a binary\0')