Patchwork [3,of,6] fastannotate: make the default value for `fastannotate.useflock` dynamic

login
register
mail settings
Submitter Matt Harbison
Date Aug. 22, 2018, 2:55 a.m.
Message ID <aba4c08cb0dfebb1f1c1.1534906524@Envy>
Download mbox | patch
Permalink /patch/33960/
State Accepted
Headers show

Comments

Matt Harbison - Aug. 22, 2018, 2:55 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1534901350 14400
#      Tue Aug 21 21:29:10 2018 -0400
# Node ID aba4c08cb0dfebb1f1c1d7738967b414a9ce4c78
# Parent  66d4a3ebb954ee8f5f6fe9fa26b1a11839c8611f
fastannotate: make the default value for `fastannotate.useflock` dynamic

fcntl.flock isn't available on Windows.

Patch

diff --git a/hgext/fastannotate/__init__.py b/hgext/fastannotate/__init__.py
--- a/hgext/fastannotate/__init__.py
+++ b/hgext/fastannotate/__init__.py
@@ -114,6 +114,7 @@  from __future__ import absolute_import
 
 from mercurial.i18n import _
 from mercurial import (
+    configitems,
     error as hgerror,
     localrepo,
     registrar,
@@ -138,7 +139,7 @@  configitem = registrar.configitem(config
 
 configitem('fastannotate', 'modes', default=['fastannotate'])
 configitem('fastannotate', 'server', default=False)
-configitem('fastannotate', 'useflock', default=True)
+configitem('fastannotate', 'useflock', default=configitems.dynamicdefault)
 configitem('fastannotate', 'client', default=False)
 configitem('fastannotate', 'unfilteredrepo', default=True)
 configitem('fastannotate', 'defaultformat', default=['number'])