Patchwork dirstate: ignore negative debug.dirstate.delaywrite values - they crashed it

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 15, 2015, 2:38 a.m.
Message ID <6287a34548da13f8b834.1421289531@localhost.localdomain>
Download mbox | patch
Permalink /patch/7464/
State Accepted
Commit 9dd442148301bf982fb1815962860bb9faa35e35
Headers show

Comments

Mads Kiilerich - Jan. 15, 2015, 2:38 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1421194526 -3600
#      Wed Jan 14 01:15:26 2015 +0100
# Node ID 6287a34548da13f8b834c7a7930f091463d2612e
# Parent  669106fc5bb1de671f59e432bbc59ca4ccc0e5bc
dirstate: ignore negative debug.dirstate.delaywrite values - they crashed it

Sleep can only travel forward in time, not back.
Matt Mackall - Jan. 15, 2015, 11:17 p.m.
On Thu, 2015-01-15 at 03:38 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1421194526 -3600
> #      Wed Jan 14 01:15:26 2015 +0100
> # Node ID 6287a34548da13f8b834c7a7930f091463d2612e
> # Parent  669106fc5bb1de671f59e432bbc59ca4ccc0e5bc
> dirstate: ignore negative debug.dirstate.delaywrite values - they crashed it

Queued for default, thanks.

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -544,7 +544,7 @@  class dirstate(object):
         # enough 'delaywrite' prevents 'pack_dirstate' from dropping
         # timestamp of each entries in dirstate, because of 'now > mtime'
         delaywrite = self._ui.configint('debug', 'dirstate.delaywrite', 0)
-        if delaywrite:
+        if delaywrite > 0:
             import time # to avoid useless import
             time.sleep(delaywrite)