Mercurial > hg
comparison mercurial/dirstate.py @ 27398:c81675776c95
dirstate: only invoke delaywrite if relevant
This avoids a significant amount of sleeping in some of our longest
tests.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 16 Dec 2015 20:49:18 -0600 |
parents | 6c6b48aca328 |
children | 425dc70037f7 |
comparison
equal
deleted
inserted
replaced
27397:6c6b48aca328 | 27398:c81675776c95 |
---|---|
706 | 706 |
707 # enough 'delaywrite' prevents 'pack_dirstate' from dropping | 707 # enough 'delaywrite' prevents 'pack_dirstate' from dropping |
708 # timestamp of each entries in dirstate, because of 'now > mtime' | 708 # timestamp of each entries in dirstate, because of 'now > mtime' |
709 delaywrite = self._ui.configint('debug', 'dirstate.delaywrite', 0) | 709 delaywrite = self._ui.configint('debug', 'dirstate.delaywrite', 0) |
710 if delaywrite > 0: | 710 if delaywrite > 0: |
711 import time # to avoid useless import | 711 # do we have any files to delay for? |
712 time.sleep(delaywrite) | 712 for f, e in self._map.iteritems(): |
713 if e[0] == 'n' and e[3] == now: | |
714 import time # to avoid useless import | |
715 time.sleep(delaywrite) | |
716 break | |
713 | 717 |
714 st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now)) | 718 st.write(parsers.pack_dirstate(self._map, self._copymap, self._pl, now)) |
715 st.close() | 719 st.close() |
716 self._lastnormaltime = 0 | 720 self._lastnormaltime = 0 |
717 self._dirty = self._dirtypl = False | 721 self._dirty = self._dirtypl = False |