Skip to content

Commit

Permalink
configitems: defer a couple more istest() related defaults
Browse files Browse the repository at this point in the history
Summary: I was bit once by `istest()` being evaluated at module load time when under debugruntest with `$TESTTMP` not set yet for some reason. Let's defer the other `istest()` related values.

Reviewed By: zzl0

Differential Revision: D54839562

fbshipit-source-id: fa56e6d5fc5031c02fc3698f4ff67680af63b85e
  • Loading branch information
muirdm authored and facebook-github-bot committed Mar 14, 2024
1 parent dcc83cc commit b7b627e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eden/scm/sapling/configitems.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def getitemregister(configtable):
coreconfigitem("format", "maxchainlen", default=None)
coreconfigitem("format", "obsstore-version", default=None)
coreconfigitem("format", "usegeneraldelta", default=True)
coreconfigitem("format", "use-segmented-changelog", default=util.istest())
coreconfigitem("format", "use-segmented-changelog", default=util.istest)
coreconfigitem("fsmonitor", "warn_when_unused", default=True)
coreconfigitem("fsmonitor", "warn_update_file_count", default=50000)
coreconfigitem("git", "submodules", default=True)
Expand Down Expand Up @@ -395,7 +395,9 @@ def getitemregister(configtable):
coreconfigitem("pull", "automigrate", default=True)
# Practically, 100k commit data takes about 200MB memroy (or 400MB if
# duplicated in Python / Rust).
coreconfigitem("pull", "buffer-commit-count", default=(util.istest() and 5 or 100000))
coreconfigitem(
"pull", "buffer-commit-count", default=lambda: util.istest() and 5 or 100000
)
coreconfigitem("pull", "httpbookmarks", default=True)
coreconfigitem("pull", "httphashprefix", default=False)
coreconfigitem("pull", "httpcommitgraph2", default=False)
Expand Down

0 comments on commit b7b627e

Please sign in to comment.