Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAJORVER 4
- #define MINORVER 23
- #define SOURCEVER 965
- using System;
- using Microsoft.Build.Framework;
- using Microsoft.Build.Utilities;
- using DotSVN.Common;
- using DotSVN.Common.Entities;
- using DotSVN.Common.Util;
- using DotSVN.Server.RepositoryAccess;
- namespace GetSVNVersion
- {
- public class GetRevision : Task
- {
- [Required]
- public string Repository { get; set; }
- [Output]
- public string Revision { get; set; }
- public override bool Execute()
- {
- ISVNRepository repo;
- bool connected = true;
- try
- {
- repo = SVNRepositoryFactory.Create(new SVNURL(Repository));
- repo.OpenRepository();
- Revision = repo.GetLatestRevision().ToString();
- Log.LogCommandLine(Repository + " is revision " + Revision);
- repo.CloseRepository();
- }
- catch(Exception e)
- {
- Log.LogError("Error retrieving revision number for " + Repository + ": " + e.Message);
- connected = false;
- }
- return connected;
- }
- }
- }
Add Comment
Please, Sign In to add comment