@Override
  public void activate() {
    Disposable disposable = Disposer.newDisposable();
    // do not leak Project if 'deactivate' is never called
    Disposer.register(HgDisposable.getInstance(myProject), disposable);
    // workaround the race between 'activate' and 'deactivate'
    Disposable oldDisposable = myDisposable.getAndSet(disposable);
    if (oldDisposable != null) Disposer.dispose(oldDisposable);

    // validate hg executable on start and update hg version
    checkExecutableAndVersion();

    // updaters and listeners
    HgRemoteStatusUpdater remoteStatusUpdater = new HgRemoteStatusUpdater(this);
    Disposer.register(disposable, remoteStatusUpdater);
    myHgRemoteStatusUpdater = remoteStatusUpdater;

    HgVFSListener VFSListener = HgVFSListener.createInstance(this);
    Disposer.register(disposable, VFSListener);

    // ignore temporary files
    final String ignoredPattern = FileTypeManager.getInstance().getIgnoredFilesList();
    if (!ignoredPattern.contains(ORIG_FILE_PATTERN)) {
      final String newPattern = ignoredPattern + (ignoredPattern.endsWith(";") ? "" : ";") + ORIG_FILE_PATTERN;
      HgUtil.runWriteActionLater(() -> FileTypeManager.getInstance().setIgnoredFilesList(newPattern));
    }
  }
@Override
  public void activate()