Browse Source

Fix build error.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1720 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
e37f2a8ac8
  1. 18
      src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs
  2. 14
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewDisplayBinding.cs
  3. 4
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/SvnProjectBrowserVisitor.cs
  4. 6
      src/AddIns/Misc/SubversionAddIn/Project/Src/SubversionStateCondition.cs

18
src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs

@ -38,10 +38,14 @@ namespace ICSharpCode.Svn.Commands @@ -38,10 +38,14 @@ namespace ICSharpCode.Svn.Commands
node.AcceptVisitor(visitor, null);
}
internal static bool CanBeVersionControlled(string fileName)
internal static bool CanBeVersionControlledFile(string fileName)
{
string svnDir = Path.Combine(Path.GetDirectoryName(fileName), ".svn");
return Directory.Exists(svnDir);
return CanBeVersionControlledDirectory(Path.GetDirectoryName(fileName));
}
internal static bool CanBeVersionControlledDirectory(string directory)
{
return Directory.Exists(Path.Combine(directory, ".svn")) || Directory.Exists(Path.Combine(directory, "_svn"));
}
void FileSaved(object sender, FileNameEventArgs e)
@ -49,7 +53,7 @@ namespace ICSharpCode.Svn.Commands @@ -49,7 +53,7 @@ namespace ICSharpCode.Svn.Commands
ProjectBrowserPad pad = ProjectBrowserPad.Instance;
if (pad == null) return;
string fileName = e.FileName;
if (!CanBeVersionControlled(fileName)) return;
if (!CanBeVersionControlledFile(fileName)) return;
FileNode node = pad.ProjectBrowserControl.FindFileNode(fileName);
if (node == null) return;
OverlayIconManager.Enqueue(node);
@ -60,7 +64,7 @@ namespace ICSharpCode.Svn.Commands @@ -60,7 +64,7 @@ namespace ICSharpCode.Svn.Commands
{
try {
if (AddInOptions.AutomaticallyAddFiles) {
if (!CanBeVersionControlled(e.FileName)) return;
if (!CanBeVersionControlledFile(e.FileName)) return;
SvnClient.Instance.Client.Add(Path.GetFullPath(e.FileName), Recurse.None);
}
} catch (Exception ex) {
@ -72,7 +76,7 @@ namespace ICSharpCode.Svn.Commands @@ -72,7 +76,7 @@ namespace ICSharpCode.Svn.Commands
{
if (e.Cancel) return;
string fullName = Path.GetFullPath(e.FileName);
if (!CanBeVersionControlled(fullName)) return;
if (!CanBeVersionControlledFile(fullName)) return;
if (e.IsDirectory) {
// show "cannot delete directories" message even if
// AutomaticallyDeleteFiles (see below) is off!
@ -134,7 +138,7 @@ namespace ICSharpCode.Svn.Commands @@ -134,7 +138,7 @@ namespace ICSharpCode.Svn.Commands
{
if (e.Cancel) return;
string fullSource = Path.GetFullPath(e.SourceFile);
if (!CanBeVersionControlled(fullSource)) return;
if (!CanBeVersionControlledFile(fullSource)) return;
try {
Status status = SvnClient.Instance.Client.SingleStatus(fullSource);
switch (status.TextStatus) {

14
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewDisplayBinding.cs

@ -34,6 +34,10 @@ namespace ICSharpCode.Svn @@ -34,6 +34,10 @@ namespace ICSharpCode.Svn
static Client client;
static bool firstSvnClientException = true;
// prevent initialization of SvnHelper and therefore Client (and NSvn.Core.dll) unless it is
// really required
static SvnHelper() {}
internal static bool IsVersionControlled(string fileName)
{
if (client == null) {
@ -50,6 +54,7 @@ namespace ICSharpCode.Svn @@ -50,6 +54,7 @@ namespace ICSharpCode.Svn
} else {
LoggingService.Warn("Svn: IsVersionControlled Exception", ex);
}
return false;
}
}
}
@ -59,12 +64,11 @@ namespace ICSharpCode.Svn @@ -59,12 +64,11 @@ namespace ICSharpCode.Svn
if (content.IsUntitled || content.FileName == null || !File.Exists(content.FileName)) {
return false;
}
string baseDir = Path.GetDirectoryName(content.FileName);
string svnDir1 = Path.Combine(baseDir, ".svn");
string svnDir2 = Path.Combine(baseDir, "_svn");
if (!Directory.Exists(svnDir1) && !Directory.Exists(svnDir2))
if (Commands.RegisterEventsCommand.CanBeVersionControlledFile(content.FileName)) {
return SvnHelper.IsVersionControlled(content.FileName);
} else {
return false;
return SvnHelper.IsVersionControlled(content.FileName);
}
}
}
}

4
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/SvnProjectBrowserVisitor.cs

@ -19,7 +19,7 @@ namespace ICSharpCode.Svn @@ -19,7 +19,7 @@ namespace ICSharpCode.Svn
{
public override object Visit(SolutionNode node, object data)
{
if (Directory.Exists(Path.Combine(node.Solution.Directory, ".svn"))) {
if (Commands.RegisterEventsCommand.CanBeVersionControlledDirectory(node.Solution.Directory)) {
OverlayIconManager.Enqueue(node);
}
return node.AcceptChildren(this, data);
@ -32,7 +32,7 @@ namespace ICSharpCode.Svn @@ -32,7 +32,7 @@ namespace ICSharpCode.Svn
public override object Visit(DirectoryNode node, object data)
{
if (Directory.Exists(Path.Combine(node.Directory, ".svn"))) {
if (Commands.RegisterEventsCommand.CanBeVersionControlledDirectory(node.Directory)) {
OverlayIconManager.Enqueue(node);
return node.AcceptChildren(this, data);
}

6
src/AddIns/Misc/SubversionAddIn/Project/Src/SubversionStateCondition.cs

@ -25,15 +25,15 @@ namespace ICSharpCode.Svn @@ -25,15 +25,15 @@ namespace ICSharpCode.Svn
{
FileNode node = ProjectBrowserPad.Instance.SelectedNode as FileNode;
if (node != null) {
return RegisterEventsCommand.CanBeVersionControlled(node.FileName);
return RegisterEventsCommand.CanBeVersionControlledFile(node.FileName);
}
DirectoryNode dir = ProjectBrowserPad.Instance.SelectedNode as DirectoryNode;
if (dir != null) {
return Directory.Exists(Path.Combine(dir.Directory, ".svn"));
return Commands.RegisterEventsCommand.CanBeVersionControlledDirectory(dir.Directory);
}
SolutionNode sol = ProjectBrowserPad.Instance.SelectedNode as SolutionNode;
if (sol != null) {
return Directory.Exists(Path.Combine(sol.Solution.Directory, ".svn"));
return Commands.RegisterEventsCommand.CanBeVersionControlledDirectory(sol.Solution.Directory);
}
return false;
}

Loading…
Cancel
Save