##// 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 from node import nullid
10 from node import nullid
11 from i18n import _
11 from i18n import _
12 import struct, os, bisect, stat, strutil, util, errno, ignore
12 import struct, os, bisect, stat, strutil, util, errno, ignore
13 import cStringIO, osutil
13 import cStringIO, osutil, sys
14
14
15 _unknown = ('?', 0, 0, 0)
15 _unknown = ('?', 0, 0, 0)
16 _format = ">cllll"
16 _format = ">cllll"
@@ -66,6 +66,12 b' class dirstate(object):'
66 elif name == '_checkexec':
66 elif name == '_checkexec':
67 self._checkexec = util.checkexec(self._root)
67 self._checkexec = util.checkexec(self._root)
68 return self._checkexec
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 else:
75 else:
70 raise AttributeError, name
76 raise AttributeError, name
71
77
@@ -335,6 +341,11 b' class dirstate(object):'
335 def write(self):
341 def write(self):
336 if not self._dirty:
342 if not self._dirty:
337 return
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 cs = cStringIO.StringIO()
349 cs = cStringIO.StringIO()
339 copymap = self._copymap
350 copymap = self._copymap
340 pack = struct.pack
351 pack = struct.pack
@@ -343,10 +354,11 b' class dirstate(object):'
343 for f, e in self._map.iteritems():
354 for f, e in self._map.iteritems():
344 if f in copymap:
355 if f in copymap:
345 f = "%s\0%s" % (f, copymap[f])
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 e = pack(_format, e[0], e[1], e[2], e[3], len(f))
359 e = pack(_format, e[0], e[1], e[2], e[3], len(f))
347 write(e)
360 write(e)
348 write(f)
361 write(f)
349 st = self._opener("dirstate", "w", atomictemp=True)
350 st.write(cs.getvalue())
362 st.write(cs.getvalue())
351 st.rename()
363 st.rename()
352 self._dirty = self._dirtypl = False
364 self._dirty = self._dirtypl = False
@@ -3,10 +3,10 b' 4 files updated, 0 files merged, 0 files'
3 creating branch a
3 creating branch a
4 creating branch b
4 creating branch b
5 we shouldn't have anything but n state here
5 we shouldn't have anything but n state here
6 n 644 2 bar
6 n 0 -1 bar
7 n 644 3 baz
7 n 0 -1 baz
8 n 644 3 foo
8 n 0 -1 foo
9 n 644 2 quux
9 n 0 -1 quux
10 merging
10 merging
11 pulling from ../a
11 pulling from ../a
12 searching for changes
12 searching for changes
@@ -2,7 +2,7 b' adding bar'
2 adding foo
2 adding foo
3 % state dump
3 % state dump
4 a 0 -1 baz
4 a 0 -1 baz
5 n 644 0 foo
5 n 0 -1 foo
6 r 0 0 bar
6 r 0 0 bar
7 % status
7 % status
8 A baz
8 A baz
General Comments 0
You need to be logged in to leave comments. Login now