Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
[Counters] Track Version Control Repository open
Browse files Browse the repository at this point in the history
  • Loading branch information
Therzok committed Apr 16, 2015
1 parent 8079ec9 commit 5587667
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
Expand Up @@ -134,6 +134,12 @@ internal static bool CheckInstalled ()
return true;
}

public override string Version {
get {
return GetVersion ();
}
}

internal static bool CheckVersion ()
{
return GetVersion ().StartsWith ("1.6", StringComparison.Ordinal);
Expand Down
Expand Up @@ -8,12 +8,15 @@
using MonoDevelop.Core;
using System.Linq;
using System.Threading;
using MonoDevelop.Core.Instrumentation;

namespace MonoDevelop.VersionControl
{
[DataItem (FallbackType=typeof(UnknownRepository))]
public abstract class Repository: IDisposable
{
static Counter Repositories = InstrumentationService.CreateCounter ("VersionControl.RepositoryOpened", "Version Control", id:"VersionControl.RepositoryOpened");

string name;
VersionControlSystem vcs;

Expand All @@ -38,6 +41,10 @@ protected Repository ()
protected Repository (VersionControlSystem vcs): this ()
{
VersionControlSystem = vcs;
Repositories.SetValue (Repositories.Count + 1, string.Format ("Repository #{0}", Repositories.Count + 1), new Dictionary<string, string> {
{ "Type", vcs.Name },
{ "Version", vcs.Version },
});
}

public virtual void CopyConfigurationFrom (Repository other)
Expand Down
Expand Up @@ -36,6 +36,14 @@ public Repository CreateRepositoryInstance ()
/// </summary>
public abstract string Name { get; }

/// <summary>
/// The version of the native version control system compatible with this system.
/// </summary>
/// <value>The version string.</value>
public virtual string Version {
get { return "N/A"; }
}

/// <summary>
/// Gets a value indicating whether this version control system is available
/// </summary>
Expand Down
Expand Up @@ -27,6 +27,12 @@ static SvnSharpClient ()
client = new Lazy<SvnClient> (CheckInstalled);
}

public override string Version {
get {
return SvnClient.Version.ToString ();
}
}

static SvnClient CheckInstalled ()
{
try {
Expand Down

0 comments on commit 5587667

Please sign in to comment.