本文整理汇总了C#中MonoDevelop.VersionControl.Subversion.SvnRevision类的典型用法代码示例。如果您正苦于以下问题:C# SvnRevision类的具体用法?C# SvnRevision怎么用?C# SvnRevision使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SvnRevision类属于MonoDevelop.VersionControl.Subversion命名空间,在下文中一共展示了SvnRevision类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Status
public virtual IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision)
{
return Status (repo, path, revision, false, false, false);
}
示例2: Status
public abstract IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus);
示例3: CreateVersionInfo
static VersionInfo CreateVersionInfo (Repository repo, SvnStatusEventArgs ent)
{
VersionStatus rs = VersionStatus.Unversioned;
Revision rr = null;
// TODO: Fix remote status for Win32 Svn.
if (ent.IsRemoteUpdated) {
rs = ConvertStatus (SvnSchedule.Normal, ent.RemoteContentStatus);
rr = new SvnRevision (repo, (int) ent.RemoteUpdateRevision, ent.RemoteUpdateCommitTime,
ent.RemoteUpdateCommitAuthor, "(unavailable)", null);
}
SvnSchedule sched = ent.WorkingCopyInfo != null ? ent.WorkingCopyInfo.Schedule : SvnSchedule.Normal;
VersionStatus status = ConvertStatus (sched, ent.LocalContentStatus);
bool readOnly = File.Exists (ent.FullPath) && (File.GetAttributes (ent.FullPath) & FileAttributes.ReadOnly) != 0;
if (ent.WorkingCopyInfo != null) {
if (ent.RemoteLock != null || ent.WorkingCopyInfo.LockToken != null) {
status |= VersionStatus.LockRequired;
if (ent.WorkingCopyInfo.LockToken != null || (ent.RemoteLock != null && ent.RemoteLock.Token != null))
status |= VersionStatus.LockOwned;
else
status |= VersionStatus.Locked;
}
else if (readOnly)
status |= VersionStatus.LockRequired;
}
string repoPath = ent.Uri != null ? ent.Uri.ToString () : null;
SvnRevision newRev = null;
if (ent.WorkingCopyInfo != null)
newRev = new SvnRevision (repo, (int) ent.WorkingCopyInfo.Revision);
VersionInfo ret = new VersionInfo (ent.FullPath, repoPath, ent.NodeKind == SvnNodeKind.Directory,
status, newRev,
rs, rr);
return ret;
}
示例4: GetAnnotations
public override Annotation[] GetAnnotations (Repository repo, FilePath file, SvnRevision revStart, SvnRevision revEnd)
{
if (file == FilePath.Null)
throw new ArgumentNullException ();
SvnPathTarget target = new SvnPathTarget (file, SharpSvn.SvnRevision.Base);
MemoryStream data = new MemoryStream ();
int numAnnotations = 0;
client.Write (target, data);
using (StreamReader reader = new StreamReader (data)) {
reader.BaseStream.Seek (0, SeekOrigin.Begin);
while (reader.ReadLine () != null)
numAnnotations++;
}
System.Collections.ObjectModel.Collection<SvnBlameEventArgs> list;
SvnBlameArgs args = new SvnBlameArgs ();
args.Start = GetRevision (revStart);
args.End = GetRevision (revEnd);
if (client.GetBlame (target, args, out list)) {
Annotation[] annotations = new Annotation [numAnnotations];
foreach (var annotation in list) {
if (annotation.LineNumber < annotations.Length)
annotations [(int)annotation.LineNumber] = new Annotation (annotation.Revision.ToString (),
annotation.Author, annotation.Time);
}
return annotations;
}
return new Annotation[0];
}
示例5: GetAnnotations
/// <summary>
/// Get annotations for a versioned file.
/// </summary>
/// <returns>
/// A <see cref="System.String"/> annotation for each line in file.
/// </returns>
public virtual Annotation[] GetAnnotations (Repository repo, FilePath file, SvnRevision revStart, SvnRevision revEnd)
{
return new Annotation[0];
}
示例6: Status
public override IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus)
{
List<VersionInfo> list = new List<VersionInfo> ();
SvnStatusArgs args = new SvnStatusArgs ();
args.Revision = GetRevision (revision);
args.Depth = descendDirs ? SvnDepth.Infinity : SvnDepth.Children;
args.RetrieveAllEntries = !changedItemsOnly;
args.RetrieveRemoteStatus = remoteStatus;
lock (client) {
try {
client.Status (path, args, delegate (object o, SvnStatusEventArgs a) {
list.Add (CreateVersionInfo (repo, a));
});
} catch (SvnInvalidNodeKindException e) {
if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_WORKING_COPY)
list.Add (VersionInfo.CreateUnversioned (e.File, true));
else if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_FILE)
list.Add (VersionInfo.CreateUnversioned (e.File, false));
else
throw;
}
}
return list;
}
示例7: Log
public override IEnumerable<SvnRevision> Log (Repository repo, FilePath path, SvnRevision revisionStart, SvnRevision revisionEnd)
{
List<SvnRevision> list = new List<SvnRevision> ();
SvnLogArgs args = new SvnLogArgs ();
args.Range = new SvnRevisionRange (GetRevision (revisionStart), GetRevision (revisionEnd));
lock (client)
client.Log (path, args, delegate (object o, SvnLogEventArgs a) {
List<RevisionPath> paths = new List<RevisionPath> ();
foreach (SvnChangeItem item in a.ChangedPaths) {
paths.Add (new RevisionPath (item.Path, ConvertRevisionAction (item.Action), ""));
}
SvnRevision r = new SvnRevision (repo, (int) a.Revision, a.Time, a.Author, a.LogMessage, paths.ToArray ());
list.Add (r);
});
return list;
}
示例8: Move
public abstract void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, ProgressMonitor monitor);
示例9: ListUrl
public override IEnumerable<DirectoryEntry> ListUrl (string url, bool recurse, SvnRevision rev)
{
return List (new SvnUriTarget (url, GetRevision (rev)), recurse);
}
示例10: List
public override IEnumerable<DirectoryEntry> List (FilePath path, bool recurse, SvnRevision rev)
{
return List (new SvnPathTarget (path, GetRevision (rev)), recurse);
}
示例11: Status
public override IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus)
{
var list = new List<VersionInfo> ();
var args = new SvnStatusArgs {
Revision = GetRevision (revision),
Depth = descendDirs ? SvnDepth.Infinity : SvnDepth.Children,
RetrieveAllEntries = !changedItemsOnly,
RetrieveRemoteStatus = remoteStatus,
};
lock (client) {
try {
client.Status (path, args, (o, a) => list.Add (CreateVersionInfo (repo, a)));
} catch (SvnInvalidNodeKindException e) {
if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_WORKING_COPY)
list.Add (VersionInfo.CreateUnversioned (e.File, true));
else if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_FILE)
list.Add (VersionInfo.CreateUnversioned (e.File, false));
else
throw;
} catch (SvnWorkingCopyPathNotFoundException e) {
var fp = new FilePath (e.File);
list.Add (VersionInfo.CreateUnversioned (fp, fp.IsDirectory));
}
}
return list;
}
示例12: Move
public override void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, ProgressMonitor monitor)
{
var args = new SvnMoveArgs {
Force = force,
};
BindMonitor (monitor);
lock (client)
client.Move (srcPath, destPath, args);
}
示例13: Log
public override IEnumerable<SvnRevision> Log (Repository repo, FilePath path, SvnRevision revisionStart, SvnRevision revisionEnd)
{
var list = new List<SvnRevision> ();
var args = new SvnLogArgs {
Range = new SvnRevisionRange (GetRevision (revisionStart), GetRevision (revisionEnd)),
};
lock (client)
client.Log (path, args, (o, a) =>
list.Add (new SvnRevision (repo, (int)a.Revision, a.Time, a.Author, a.LogMessage,
a.ChangedPaths == null ? new RevisionPath[0] : a.ChangedPaths.Select (item => new RevisionPath (item.Path, ConvertRevisionAction (item.Action), "")).ToArray ())));
return list;
}
示例14: List
public abstract IEnumerable<DirectoryEntry> List (FilePath path, bool recurse, SvnRevision rev);
示例15: Move
public override void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, IProgressMonitor monitor)
{
SvnMoveArgs args = new SvnMoveArgs ();
BindMonitor (args, monitor);
args.Force = force;
lock (client)
client.Move (srcPath, destPath, args);
}