Mercurial > hg
diff hgext/remotefilelog/debugcommands.py @ 40514:6f0b6905ef6f
shallowutil: introduce a helper function isenabled()
This patch introduces a inenabled() function which will check whether
remotefilelog is enabled or not. The function is then also used at all the
places where check whether remotefilelog is enabled or not. The new function
makes code easy to read without need to understand what is the constant involved
and why we are checking repo.requirements.
Differential Revision: https://phab.mercurial-scm.org/D5190
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Mon, 05 Nov 2018 11:52:10 -0800 |
parents | fc2766860796 |
children | 13d4ad8d7801 |
line wrap: on
line diff
--- a/hgext/remotefilelog/debugcommands.py Wed Oct 24 16:59:05 2018 +0300 +++ b/hgext/remotefilelog/debugcommands.py Mon Nov 05 11:52:10 2018 -0800 @@ -92,7 +92,7 @@ if (opts.get('changelog') or opts.get('manifest') or opts.get('dir') or - not constants.SHALLOWREPO_REQUIREMENT in repo.requirements or + not shallowutil.isenabled(repo) or not repo.shallowmatch(file_)): return orig(ui, repo, file_, **opts) @@ -139,7 +139,7 @@ def debugindexdot(orig, ui, repo, file_): """dump an index DAG as a graphviz dot file""" - if not constants.SHALLOWREPO_REQUIREMENT in repo.requirements: + if not shallowutil.isenabled(repo): return orig(ui, repo, file_) r = buildtemprevlog(repo, os.path.basename(file_)[:-2])