/// <summary> /// Gets Subversion information about the directory at <paramref name="directoryPath"/>. /// </summary> /// <param name="directoryPath">The directory.</param> /// <param name="settings">The settings.</param> /// <returns>The Subversion information.</returns> public IEnumerable <SvnInfoResult> GetInfo(DirectoryPath directoryPath, SvnInfoSettings settings) { settings.NotNull(nameof(settings)); directoryPath.NotNull(nameof(directoryPath)); return(GetInfo(directoryPath.MakeAbsolute(_environment).ToString(), settings)); }
/// <summary> /// Gets Subversion information about the file at <paramref name="filePath"/>. /// </summary> /// <param name="filePath">The file.</param> /// <param name="settings">The settings.</param> /// <returns>The Subversion information.</returns> public IEnumerable <SvnInfoResult> GetInfo(FilePath filePath, SvnInfoSettings settings) { settings.NotNull(nameof(settings)); filePath.NotNull(nameof(filePath)); return(GetInfo(filePath.MakeAbsolute(_environment).ToString(), settings)); }
/// <summary> /// Gets Subversion information about the file or directory at <paramref name="repositoryUrl"/>. /// </summary> /// <param name="repositoryUrl">The URL of the repository.</param> /// <param name="settings">The settings.</param> /// <returns>The Subversion information.</returns> public IEnumerable <SvnInfoResult> GetInfo(Uri repositoryUrl, SvnInfoSettings settings) { settings.NotNull(nameof(settings)); repositoryUrl.NotNull(nameof(repositoryUrl)); if (repositoryUrl.IsFile) { throw new ArgumentException("Directory of file are not allowed.", nameof(repositoryUrl)); } return(GetInfo(repositoryUrl.ToString(), settings)); }
internal static SvnInfoArgs ToSvnInfoArgs(this SvnInfoSettings settings) { settings.NotNull(nameof(settings)); return((new SvnInfoArgs { Depth = settings.Depth.ToSharpSvn(), Revision = !settings.Revision.HasValue ? new SvnRevision() : (settings.Revision < 0 ? SvnRevision.Head : new SvnRevision(settings.Revision.Value)), IncludeExternals = settings.IncludeExternals, RetrieveActualOnly = settings.RetrieveActualOnly, RetrieveExcluded = settings.RetrieveExcluded }).SetBaseSettings(settings)); }
/// <summary> /// Gets Subversion information about the file or directory at <paramref name="repositoryUrl"/>. /// </summary> /// <param name="repositoryUrl">The URL of the repository.</param> /// <param name="settings">The settings.</param> /// <returns>The Subversion information.</returns> private IEnumerable <SvnInfoResult> GetInfo(string repositoryUrl, SvnInfoSettings settings) { settings.NotNull(nameof(settings)); repositoryUrl.NotNullOrWhiteSpace(nameof(repositoryUrl)); using (var client = GetClient()) { client.TrustServerCertificate = settings.Insecure; if (settings.Credentials != null) { client.ForceCredentials(settings.Credentials); } return(client.GetInfo(repositoryUrl, settings)); } }