2017-02-06 16 views
0

Sharpsvn 클라이언트 클래스를 사용하여 svn 디렉터리의 파일에 속성을 설정하고 있습니다. 새로운 타임 스탬프로 속성을 계속 재설정하고 싶을 때 새로운 로그 메시지가있는 새 개정이 저장소 기록에서 업데이트됩니다. 내가하고 싶지 않은 일은 파일을 변경 한 다음 다시 디렉토리로 커밋하는 것입니다. 지금 당장은 디렉토리의 파일에 연결하는 방법을 알아 내려고 노력하고 있습니다. 여기에 내가 현재 가지고있는 코드 :sharpsvn clinet 클래스를 사용하여 svn 디렉토리의 파일에 등록 정보를 설정하는 방법은 무엇입니까?

System.Uri uri = new System.Uri("url link"); 

using (SvnClient client = new SvnClient()) 
{ 
    try 
    { 
    // Get new timestamp 
    DateTime dt = DateTime.Now; 
    string time = String.Format("{0:G}", dt); 

    // Set property to file in the svn directory 
    client.RemoteSetProperty(uri, "svn:time", time); 
    } 
    catch (Svnexception ex) 
    { 
    MessageBox.show(ex.Message + "Check out error!"); 
    } 
} 

나는뿐만 아니라 client.SetProperty 방법을 사용하여 시도,하지만 내가 모두 로컬 작업 복사본에 똑바로 URL로 그것을 시도 때 작동하지 않았다. 도움이 될 것입니다!

답변

0

필요에 따라 코드의 일부분을 변경하여 작동되게합니다. 보십시오 :

   System.Uri uri = new System.Uri("url link"); 

       using (SvnClient client = new SvnClient()) 
       { 
        try 
        { 
         // Get new timestamp 
         DateTime date = DateTime.Now; 
         string time = String.Format("{0:G}", date); 

         // To Get the Latest Revision on the Required SVN Folder 
         SvnInfoEventArgs info; 
         client.GetInfo(uri, out info); 

         // Prepare a PropertyArgs object with latest revision and a commit message; 
         SvnSetPropertyArgs args = new SvnSetPropertyArgs() { BaseRevision = info.Revision, LogMessage = "Sample msg for SVN commit" }; 

         // Set property to file in the svn directory 
         client.RemoteSetProperty(uri, "svn:time", time, args); 
        } 
        catch (Exception ex) 
        { 
         MessageBox.Show(ex.Message + "Check out error!"); 
        } 
       } 

희망이 있습니다;