##// END OF EJS Templates
dirstate: ignore stat data for files that were updated too recently...
Alexis S. L. Carvalho -
r6326:af3f26b6 default
parent child Browse files
Show More
@@ -10,7 +10,7 b' of the GNU General Public License, incor'
10 10 from node import nullid
11 11 from i18n import _
12 12 import struct, os, bisect, stat, strutil, util, errno, ignore
13 import cStringIO, osutil
13 import cStringIO, osutil, sys
14 14
15 15 _unknown = ('?', 0, 0, 0)
16 16 _format = ">cllll"
@@ -66,6 +66,12 b' class dirstate(object):'
66 66 elif name == '_checkexec':
67 67 self._checkexec = util.checkexec(self._root)
68 68 return self._checkexec
69 elif name == '_limit':
70 try:
71 self._limit = int(self._ui.config('ui', 'limit', 1))
72 except ValueError:
73 self._limit = 1
74 return self._limit
69 75 else:
70 76 raise AttributeError, name
71 77
@@ -335,6 +341,11 b' class dirstate(object):'
335 341 def write(self):
336 342 if not self._dirty:
337 343 return
344 st = self._opener("dirstate", "w", atomictemp=True)
345 if self._limit > 0:
346 limit = util.fstat(st).st_mtime - self._limit
347 else:
348 limit = sys.maxint
338 349 cs = cStringIO.StringIO()
339 350 copymap = self._copymap
340 351 pack = struct.pack
@@ -343,10 +354,11 b' class dirstate(object):'
343 354 for f, e in self._map.iteritems():
344 355 if f in copymap:
345 356 f = "%s\0%s" % (f, copymap[f])
357 if e[3] > limit and e[0] == 'n':
358 e = (e[0], 0, -1, -1, 0)
346 359 e = pack(_format, e[0], e[1], e[2], e[3], len(f))
347 360 write(e)
348 361 write(f)
349 st = self._opener("dirstate", "w", atomictemp=True)
350 362 st.write(cs.getvalue())
351 363 st.rename()
352 364 self._dirty = self._dirtypl = False
@@ -3,10 +3,10 b' 4 files updated, 0 files merged, 0 files'
3 3 creating branch a
4 4 creating branch b
5 5 we shouldn't have anything but n state here
6 n 644 2 bar
7 n 644 3 baz
8 n 644 3 foo
9 n 644 2 quux
6 n 0 -1 bar
7 n 0 -1 baz
8 n 0 -1 foo
9 n 0 -1 quux
10 10 merging
11 11 pulling from ../a
12 12 searching for changes
@@ -2,7 +2,7 b' adding bar'
2 2 adding foo
3 3 % state dump
4 4 a 0 -1 baz
5 n 644 0 foo
5 n 0 -1 foo
6 6 r 0 0 bar
7 7 % status
8 8 A baz
General Comments 0
You need to be logged in to leave comments. Login now