SharpSVN을 사용하여 텍스트 비교를 수행하는 파일의 이전 버전을 얻는 효율적인 방법을 찾으려고합니다.SharpSVN - 이전 버전을 얻는 방법?
using (SvnClient c = new SvnClient())
{
c.Authentication.DefaultCredentials = new NetworkCredential(
ConfigurationManager.AppSettings.Get("SvnServiceUserName")
, ConfigurationManager.AppSettings.Get("SvnServicePassword")
, ConfigurationManager.AppSettings.Get("SvnServiceDomain")
);
c.Authentication.SslServerTrustHandlers += new EventHandler<SvnSslServerTrustEventArgs>(Authentication_SslServerTrustHandlers);
Collection<SvnFileVersionEventArgs> fileVersionCollection = new Collection<SvnFileVersionEventArgs>();
SvnRevisionRange range = new SvnRevisionRange(0, this.hooks.Revision);
SvnFileVersionsArgs args = new SvnFileVersionsArgs();
args.RetrieveProperties = true;
args.Range = range;
foreach (SvnChangeItem item in log.ChangedPaths)
{
string path = this.repositoryPath + item.Path;
bool gotFileVersions = false;
try
{
if (item.NodeKind == SvnNodeKind.File)
gotFileVersions = c.GetFileVersions(SvnTarget.FromString(path), args, out fileVersionCollection);
위 코드는 내 요청을 수행하는 예제이지만 매우 비효율적입니다. 나의 목표는 리비전과 이전 리비전을 선택할 수있게하는 것입니다. 예를 들어, 내 저장소가 r185에 있지만 개정 100에서 파일을보고 싶고 동일한 파일의 이전 개정판을보고 싶다면 (이것이 무엇인지는 알 수 없습니다) 어떻게이 작업을 수행 할 수 있습니까?
나는 c.GetInfo()를 보았지만 이것은 가장 최근의 커밋으로 이전 버전을 얻는 것으로 보인다.
감사합니다.