void (Project project, VirtualFile mapRoot) { if (project != null && (!project.isDefault()) && project.getBaseDir() != null && VfsUtilCore.isAncestor(project.getBaseDir(), mapRoot, false)) { mapRoot.refresh(false, false); final String path = mapRoot.equals(project.getBaseDir()) ? "" : mapRoot.getPath(); ProjectLevelVcsManager manager = ProjectLevelVcsManager.getInstance(project); manager.setDirectoryMappings(VcsUtil.addMapping(manager.getDirectoryMappings(), path, HgVcs.VCS_NAME)); } }