Пример #1
0
        public void InitializeRepository(string basePath, string initPath, params LogPropertyInfo[] properties)
        {
            var baseUri      = new Uri(basePath);
            var tempPath     = PathUtility.GetTempPath(true);
            var tagsPath     = DirectoryUtility.Prepare(tempPath, SvnString.Tags);
            var branchesPath = DirectoryUtility.Prepare(tempPath, SvnString.Branches);
            var trunkPath    = DirectoryUtility.Prepare(tempPath, SvnString.Trunk);

            if (baseUri.Scheme == Uri.UriSchemeFile)
            {
                var createCommand = new SvnAdminCommand("create")
                {
                    (SvnPath)basePath,
                    "--fs-type",
                    "fsfs"
                };
                createCommand.Run();
            }

            DirectoryUtility.Copy(initPath, trunkPath);

            var importCommand = new SvnCommand("import")
            {
                SvnCommandItem.FromMessage("first"),
                (SvnPath)tempPath,
                (SvnPath)baseUri,
            };

            importCommand.Run();
        }
Пример #2
0
        private void Pack(string sourcePath)
        {
            var info     = SvnInfo.Run(sourcePath);
            var rootPath = info.RepositoryRoot.LocalPath;

            if (rootPath.EndsWith($"{Path.DirectorySeparatorChar}") == true)
            {
                rootPath = Path.GetDirectoryName(rootPath);
            }
            var packCommand = new SvnAdminCommand("pack")
            {
                (SvnPath)rootPath
            };

            packCommand.Run();
        }