Mercurial > public > mercurial-scm > hg
diff mercurial/cmdutil.py @ 45552:10284ce3d5ed
scmutil: introduce function to check whether repo uses treemanifest or not
In an upcoming patch, I wanted to check whether current repo uses treemanifest
or not.
I looked for a function and found that at all places we manually check for the
requirement in repo requirements. I guess having a dedicated function for that
is much better.
Differential Revision: https://phab.mercurial-scm.org/D8981
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 01 Sep 2020 18:08:24 +0530 |
parents | 8ceb5b4b2728 |
children | 03726f5b6092 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu Sep 03 11:07:47 2020 -0400 +++ b/mercurial/cmdutil.py Tue Sep 01 18:08:24 2020 +0530 @@ -46,7 +46,6 @@ phases, pycompat, repair, - requirements, revlog, rewriteutil, scmutil, @@ -1359,7 +1358,7 @@ if cl: r = repo.unfiltered().changelog elif dir: - if requirements.TREEMANIFEST_REQUIREMENT not in repo.requirements: + if not scmutil.istreemanifest(repo): raise error.Abort( _( b"--dir can only be used on repos with "