ディレクトリの現在のリポジトリを取得するにはどうすればよいですか?
私はやってみたいです:
SvnInfoEventArgs info;
Uri repos = new Uri("http://my.server/svn/repos");
client.GetInfo(repos, out info);
しかし、以前にチェックアウトされていたため、ディレクトリの URI が何であるかはわかりません。特定のチェックアウト場所の URI を取得するにはどうすればよいですか?
以下を使用して、フォルダーからリポジトリ URI を取得します。
using (var folderDlg = new FolderBrowserDialog())
{
folderDlg.Description = Resources.SelectBranchFolder;
folderDlg.ShowNewFolderButton = false;
folderDlg.RootFolder = Environment.SpecialFolder.MyComputer;
if (folderDlg.ShowDialog() == DialogResult.OK)
{
string workingPath = folderDlg.SelectedPath;
using (var svnClient = new SvnClient())
{
Uri repo = svnClient.GetUriFromWorkingCopy(workingPath);
if (repo != null)
{
MessageBox.Show("The URI for this folder is " + repo.AbsoluteUri);
}
else
{
MessageBox.Show("This is not a working SVN directory.");
}
}
}
}