private void MoveTagsToBranches(string dataBasesPath)
        {
            var dataBaseUrl = new Uri(dataBasesPath);
            var tagsUrl     = UriUtility.Combine(dataBaseUrl, SvnString.Tags);
            var branchesUri = UriUtility.Combine(dataBaseUrl, SvnString.Branches);
            var listCommand = new SvnCommand("list")
            {
                (SvnPath)tagsUrl
            };
            var list = listCommand.ReadLines();

            foreach (var item in list)
            {
                if (item.EndsWith(PathUtility.Separator) == true)
                {
                    var name      = item.Remove(item.Length - PathUtility.Separator.Length);
                    var sourceUri = UriUtility.Combine(tagsUrl, name);
                    var destUri   = UriUtility.Combine(branchesUri, name);
                    //var log = SvnLogInfo.Run(sourceUri.ToString(), null, 1).First();
                    var moveCommand = new SvnCommand("mv")
                    {
                        (SvnPath)sourceUri,
                        (SvnPath)destUri,
                        SvnCommandItem.FromMessage($"Migrate: move {name} from tags to branches"),
                        SvnCommandItem.FromUsername(nameof(SvnRepositoryMigrator)),
                    };
                    moveCommand.Run();
                    //var propText = string.Join(" ", log.Properties.Select(i => $"--with-revprop \"{i.Prefix}{i.Key}={i.Value}\""));
                    //SvnClientHost.Run($"mv \"{sourceUri}\" \"{destUri}\" -m \"Migrate: move {name} from tags to branches\"", propText, $"--username {nameof(SvnRepositoryMigrator)}");
                }
            }
        }
        public IEnumerable <KeyValuePair <string, Uri> > GetRepositoryPaths(string basePath)
        {
            var uri         = new Uri(basePath);
            var listCommand = new SvnCommand("list")
            {
                (SvnPath)uri
            };
            var lines = listCommand.ReadLines();

            foreach (var line in lines)
            {
                if (line.EndsWith(PathUtility.Separator) == true)
                {
                    var name = line.Substring(0, line.Length - PathUtility.Separator.Length);
                    if (name == SvnString.Trunk)
                    {
                        yield return(new KeyValuePair <string, Uri>(SvnString.Default, UriUtility.Combine(uri, name)));
                    }
                    else if (name == SvnString.Tags || name == SvnString.Branches)
                    {
                        var subPath = Path.Combine(basePath, name);
                        foreach (var item in this.GetRepositoryPaths(subPath))
                        {
                            yield return(item);
                        }
                    }
                    else
                    {
                        yield return(new KeyValuePair <string, Uri>(name, UriUtility.Combine(uri, name)));
                    }
                }
            }
        }
        private IEnumerable <string> EnumerateRepositories(string basePath)
        {
            var uri         = new Uri(basePath);
            var listCommand = new SvnCommand("list")
            {
                (SvnPath)uri
            };
            var lines = listCommand.ReadLines();

            foreach (var line in lines)
            {
                if (line.EndsWith(PathUtility.Separator) == true)
                {
                    var name = line.Substring(0, line.Length - PathUtility.Separator.Length);
                    if (name == SvnString.Trunk)
                    {
                        yield return("default");
                    }
                    else if (name == SvnString.Tags || name == SvnString.Branches)
                    {
                        var subPath = Path.Combine(basePath, name);
                        foreach (var item in this.EnumerateRepositories(subPath))
                        {
                            yield return(item);
                        }
                    }
                    else
                    {
                        yield return(name);
                    }
                }
            }
        }
        public string[] GetRepositoryItemList(string basePath, string repositoryName)
        {
            var uri         = this.GetUrl(basePath, repositoryName);
            var listCommand = new SvnCommand("list")
            {
                (SvnPath)uri, SvnCommandItem.Recursive
            };
            var lines = listCommand.ReadLines();
            var query = from item in lines
                        where item.Trim() != string.Empty
                        select PathUtility.Separator + item;

            return(query.ToArray());
        }
        private void PrepareBranches(string dataBasesPath)
        {
            var dataBaseUrl = new Uri(dataBasesPath);
            var listCommand = new SvnCommand("list")
            {
                (SvnPath)dataBaseUrl
            };
            var list = listCommand.ReadLines();

            if (list.Contains($"{SvnString.Branches}{PathUtility.Separator}") == false)
            {
                var branchesUrl  = UriUtility.Combine(dataBaseUrl, SvnString.Branches);
                var mkdirCommand = new SvnCommand("mkdir")
                {
                    (SvnPath)branchesUrl,
                    SvnCommandItem.FromMessage("Migrate: create branches"),
                    SvnCommandItem.FromUsername(nameof(SvnRepositoryMigrator)),
                };
                mkdirCommand.Run();
            }
        }