The evolve command uses it, but there are core things like phabsend and
rebase that would also benefit.
Details
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Indeed. I saw obsutil.py, but not this. I'll move it there, but what's the difference between these handful of utils (scmutil.py, obsutil.py, etc) and the stuff in the mercurial.utils package?
A mix of timing regarding policy changes and semantic. Module in utils are mostly a split of the old utils module. These modules are a generic utility module with function that might be useful in about any kind of other Mercurial code.
They are some other "utility" module that focus on quite specific part of Mercurial and should/will not be used from outside that part of Mercurial. For example the one contains inside the mercurial/revlogutils/ directory.
So that causes a cycle:
--- c:/Users/Matt/hg/tests/test-check-module-imports.t +++ c:/Users/Matt/hg/tests/test-check-module-imports.t.err @@ -38,3 +38,5 @@ > -X tests/test-imports-checker.t \ > -X tests/test-verify-repo-operations.py \ > | sed 's-\\-/-g' | "$PYTHON" "$import_checker" - + Import cycle: mercurial.cmdutil -> mercurial.rewriteutil -> mercurial.localrepo -> mercurial.extensions -> mercurial.cmdutil\r (esc) + [1]
That is really only used for type checking, so is that safe to move under if pycompat.TYPE_CHECKING: with the typing related imports, or is there another way to do this? Or should I just drop the type checking?
The mercurial.localrepo import in a subsequent patch. That import is only used for the # type: ... comment on the function.
I believe in future we might want to call some utilities function of this new file from cmdutil.py which will create a cycle. I think we should drop the #type .. part for now as adding imports for this is going to be quite a problem since repository object is used at lot of places.