public Status SingleStatus(string fileName) { fileName = FileUtility.NormalizePath(fileName); Status result; if (_statusCache.TryGetValue(fileName, out result)) { Debug("SVN: SingleStatus(" + fileName + ") = cached " + result.TextStatus); return result; } Debug("SVN: SingleStatus(" + fileName + ")"); BeforeReadOperation("stat"); try { var args = new SvnStatusArgs { Revision = SvnRevision.Working, RetrieveAllEntries = true, RetrieveIgnoredEntries = true, Depth = SvnDepth.Empty }; _client.Status( fileName, args, delegate (object sender, SvnStatusEventArgs e) { Debug("SVN: SingleStatus.callback(" + e.FullPath + ", " + e.LocalContentStatus + ")"); System.Diagnostics.Debug.Assert( fileName.Equals(e.FullPath, StringComparison.OrdinalIgnoreCase)); result = new Status(ToStatusKind(e.LocalContentStatus), e.LocalCopied); }); if (result == null) { result = Status.None; } _statusCache.Add(fileName, result); return result; } catch (SvnException ex) { throw new SvnClientException(ex); } finally { AfterOperation(); } }
public Dictionary<string, Status> MultiStatus(DirectoryInfo directoryInfo) { if (directoryInfo == null) { throw new ArgumentNullException(nameof(directoryInfo)); } var result = new Dictionary<string, Status>(); Debug($@"SVN: {nameof(MultiStatus)}({directoryInfo.FullName})"); BeforeReadOperation("stat"); try { var args = new SvnStatusArgs { Revision = SvnRevision.Working, RetrieveAllEntries = true, RetrieveIgnoredEntries = true, Depth = SvnDepth.Infinity }; _client.Status( directoryInfo.FullName, args, (sender, e) => { Debug($@"SVN: {nameof(MultiStatus)}.callback('{e.FullPath}', {e.LocalContentStatus})"); var status = new Status(ToStatusKind(e.LocalContentStatus), e.LocalCopied); result.Add(e.FullPath, status); }); return result; } catch (SvnException ex) { throw new SvnClientException(ex); } finally { AfterOperation(); } }