mercurial/merge.py
changeset 34885 df2ff314e36f
parent 34787 754b5117622f
child 34919 1856de4d1297
equal deleted inserted replaced
34884:05535d0dea68 34885:df2ff314e36f
    23     nullrev,
    23     nullrev,
    24 )
    24 )
    25 from . import (
    25 from . import (
    26     copies,
    26     copies,
    27     error,
    27     error,
       
    28     extensions,
    28     filemerge,
    29     filemerge,
    29     match as matchmod,
    30     match as matchmod,
    30     obsutil,
    31     obsutil,
    31     pycompat,
    32     pycompat,
    32     scmutil,
    33     scmutil,
  1941         if not partial:
  1942         if not partial:
  1942             repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
  1943             repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
  1943             # note that we're in the middle of an update
  1944             # note that we're in the middle of an update
  1944             repo.vfs.write('updatestate', p2.hex())
  1945             repo.vfs.write('updatestate', p2.hex())
  1945 
  1946 
       
  1947         # Advertise fsmonitor when its presence could be useful.
       
  1948         #
       
  1949         # We only advertise when performing an update from an empty working
       
  1950         # directory. This typically only occurs during initial clone.
       
  1951         #
       
  1952         # We give users a mechanism to disable the warning in case it is
       
  1953         # annoying.
       
  1954         #
       
  1955         # We only allow on Linux and MacOS because that's where fsmonitor is
       
  1956         # considered stable.
       
  1957         fsmonitorwarning = repo.ui.configbool('fsmonitor', 'warn_when_unused')
       
  1958         fsmonitorthreshold = repo.ui.configint('fsmonitor',
       
  1959                                                'warn_update_file_count')
       
  1960         try:
       
  1961             extensions.find('fsmonitor')
       
  1962             fsmonitorenabled = repo.ui.config('fsmonitor', 'mode') != 'off'
       
  1963             # We intentionally don't look at whether fsmonitor has disabled
       
  1964             # itself because a) fsmonitor may have already printed a warning
       
  1965             # b) we only care about the config state here.
       
  1966         except KeyError:
       
  1967             fsmonitorenabled = False
       
  1968 
       
  1969         if (fsmonitorwarning
       
  1970                 and not fsmonitorenabled
       
  1971                 and p1.node() == nullid
       
  1972                 and len(actions['g']) >= fsmonitorthreshold
       
  1973                 and pycompat.sysplatform.startswith(('linux', 'darwin'))):
       
  1974             repo.ui.warn(
       
  1975                 _('(warning: large working directory being used without '
       
  1976                   'fsmonitor enabled; enable fsmonitor to improve performance; '
       
  1977                   'see "hg help -e fsmonitor")\n'))
       
  1978 
  1946         stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
  1979         stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
  1947         wc.flushall()
  1980         wc.flushall()
  1948 
  1981 
  1949         if not partial:
  1982         if not partial:
  1950             with repo.dirstate.parentchange():
  1983             with repo.dirstate.parentchange():