internal static string PathToProject(LiftProject project)
        {
            var pathToProj = Path.Combine(BasePath, project.LiftProjectName);
            var repoId     = project.RepositoryIdentifier;         // May be null.

            if (!String.IsNullOrEmpty(repoId))
            {
                // Check for matching repo.
                foreach (var directory in from directory in Directory.GetDirectories(BasePath)
                         where Directory.Exists(Path.Combine(directory, ".hg"))
                         let repo = new HgRepository(directory, new NullProgress())
                                    where repo.Identifier == repoId
                                    select directory)
                {
                    pathToProj = directory;
                    break;
                }
            }

            if (!Directory.Exists(pathToProj))
            {
                Directory.CreateDirectory(pathToProj);
            }

            return(pathToProj);
        }
 internal static string PathToMercurialFolder(LiftProject project)
 {
     return(Path.Combine(PathToProject(project), ".hg"));
 }
        internal static string PathToFirstLiftFile(LiftProject project)
        {
            var liftFiles = Directory.GetFiles(PathToProject(project), "*.lift").ToList();

            return(liftFiles.Count == 0 ? null : GetMainLiftFile(liftFiles));
        }
 internal static bool ProjectIsShared(LiftProject project)
 {
     return(Directory.Exists(PathToMercurialFolder(project)));
 }