# HG changeset patch # User Yuya Nishihara # Date 1517925302 -32400 # Node ID 46a54de96a54c5bdcd7d7cbfc996e2178fcab35f # Parent 55e8efa2451a0999b56978e471dc31dc8066a0fb merge: cut import cycle at merge -> extensions This seems less bad because checking fsmonitor looks like a temporary hack, and cmdutil -> mergemod should be a valid dependency. diff -r 55e8efa2451a -r 46a54de96a54 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Feb 06 22:36:38 2018 +0900 +++ b/mercurial/cmdutil.py Tue Feb 06 22:55:02 2018 +0900 @@ -31,6 +31,7 @@ formatter, logcmdutil, match as matchmod, + merge as mergemod, obsolete, patch, pathutil, @@ -220,7 +221,6 @@ def dorecord(ui, repo, commitfunc, cmdsuggest, backupall, filterfn, *pats, **opts): - from . import merge as mergemod opts = pycompat.byteskwargs(opts) if not ui.interactive(): if cmdsuggest: @@ -557,8 +557,6 @@ return '\n'.join(commentedlines) + '\n' def _conflictsmsg(repo): - # avoid merge cycle - from . import merge as mergemod mergestate = mergemod.mergestate.read(repo) if not mergestate.active(): return diff -r 55e8efa2451a -r 46a54de96a54 mercurial/merge.py --- a/mercurial/merge.py Tue Feb 06 22:36:38 2018 +0900 +++ b/mercurial/merge.py Tue Feb 06 22:55:02 2018 +0900 @@ -25,7 +25,6 @@ from . import ( copies, error, - extensions, filemerge, match as matchmod, obsutil, @@ -1992,6 +1991,8 @@ fsmonitorthreshold = repo.ui.configint('fsmonitor', 'warn_update_file_count') try: + # avoid cycle: extensions -> cmdutil -> merge + from . import extensions extensions.find('fsmonitor') fsmonitorenabled = repo.ui.config('fsmonitor', 'mode') != 'off' # We intentionally don't look at whether fsmonitor has disabled