리포지토리에 연결하는 방법에 따라 저장소에 사용자 이름을 추가해야하므로이 작업은 모두 리비전에 사용자 이름을 추가해야합니다. 일반적으로 연결에 대한 자격 증명을 복사하지만 그렇게 할 필요는 없습니다.
file : /// 저장소 (보통 권장되지 않음 - The Subversion Book 참조)를 사용하면 커밋시 직접이 문제를 해결할 수 있습니다.
using (SvnClient client = new SvnClient())
{
client.Authentication.Clear(); // Clear predefined handlers
// Install a custom username handler
client.Authentication.UserNameHandlers +=
delegate(object sender, SvnUserNameEventArgs e)
{
e.UserName = "MyName";
};
SvnCommitArgs ca = new SvnCommitArgs { LogMessage = "Hello" }
client.Commit(dir, ca);
}
원격 저장소에 연결할 경우 미리 revprop - 변경 후크가 저장소에 설치되어있는 버전의 저자을 변경할 수 있습니다
using (SvnClient client = new SvnClient())
{
client.SetRevisionProperty(new Uri("http://my/repository"), 12345,
SvnPropertyNames.SvnAuthor,
"MyName");
// Older SharpSvn releases allowed only the now obsolete syntax
client.SetRevisionProperty(
new SvnUriTarget(new Uri("http://my/repository"), 12345),
SvnPropertyNames.SvnAuthor,
"MyName");
}
[2009-08 (The Subversion Book 참조)
using (SvnRepositoryClient rc = new SvnRepositoryClient())
{
SvnSetRevisionPropertyRepositoryArgs ra;
ra.CallPreRevPropChangeHook = false;
ra.CallPostRevPropChangeHook = false;
rc.SetRevisionProperty(@"C:\Path\To\Repository", 12345,
SvnPropertyNames.SvnAuthor, "MyName", ra);
}
이 마지막 예는 저장소에 직접 파일 액세스를 가정하지만 연구를 우회 : -14] 최근의 SharpSvn 자료는 이것을 허용 최적의 성능을위한 epository hook.
수정 속성을 변경하려면 .SetRevisionProperty()를 사용해야합니다. –