comparison mercurial/merge.py @ 48805:d4486810a179 stable 6.1

merge: remove direct rustmod reference We shouldn't rely on this member being present in `dirstate.py`, this creates unnecessary coupling. This also can trigger certain issues in edge-cases where the policy is changed at runtime or multiple Python environments fight, which is an added bonus. Differential Revision: https://phab.mercurial-scm.org/D12217
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 28 Feb 2022 18:34:23 +0100
parents af9f2c64302e
children 6000f5b25c9b 0cc5f74ff7f0
comparison
equal deleted inserted replaced
48804:f0081a551f37 48805:d4486810a179
23 filemerge, 23 filemerge,
24 match as matchmod, 24 match as matchmod,
25 mergestate as mergestatemod, 25 mergestate as mergestatemod,
26 obsutil, 26 obsutil,
27 pathutil, 27 pathutil,
28 policy,
28 pycompat, 29 pycompat,
29 scmutil, 30 scmutil,
30 subrepoutil, 31 subrepoutil,
31 util, 32 util,
32 worker, 33 worker,
1762 fsmonitorwarning = repo.ui.configbool(b'fsmonitor', b'warn_when_unused') 1763 fsmonitorwarning = repo.ui.configbool(b'fsmonitor', b'warn_when_unused')
1763 fsmonitorthreshold = repo.ui.configint( 1764 fsmonitorthreshold = repo.ui.configint(
1764 b'fsmonitor', b'warn_update_file_count' 1765 b'fsmonitor', b'warn_update_file_count'
1765 ) 1766 )
1766 # avoid cycle dirstate -> sparse -> merge -> dirstate 1767 # avoid cycle dirstate -> sparse -> merge -> dirstate
1767 from . import dirstate 1768 dirstate_rustmod = policy.importrust("dirstate")
1768 1769
1769 if dirstate.rustmod is not None: 1770 if dirstate_rustmod is not None:
1770 # When using rust status, fsmonitor becomes necessary at higher sizes 1771 # When using rust status, fsmonitor becomes necessary at higher sizes
1771 fsmonitorthreshold = repo.ui.configint( 1772 fsmonitorthreshold = repo.ui.configint(
1772 b'fsmonitor', 1773 b'fsmonitor',
1773 b'warn_update_file_count_rust', 1774 b'warn_update_file_count_rust',
1774 ) 1775 )