Ejemplo n.º 1
0
        public override async Task <Annotation []> GetAnnotationsAsync(FilePath repositoryPath, Revision since, CancellationToken cancellationToken)
        {
            SvnRevision       sinceRev    = since != null ? (SvnRevision)since : null;
            List <Annotation> annotations = new List <Annotation> (Svn.GetAnnotations(this, repositoryPath, SvnRevision.First, sinceRev ?? SvnRevision.Base));
            Annotation        nextRev     = new Annotation(null, GettextCatalog.GetString("<uncommitted>"), DateTime.MinValue, null, GettextCatalog.GetString("working copy"));
            var baseDocument    = Mono.TextEditor.TextDocument.CreateImmutableDocument(await GetBaseTextAsync(repositoryPath, cancellationToken).ConfigureAwait(false));
            var workingDocument = Mono.TextEditor.TextDocument.CreateImmutableDocument(File.ReadAllText(repositoryPath));

            // "SubversionException: blame of the WORKING revision is not supported"
            if (sinceRev == null)
            {
                foreach (var hunk in baseDocument.Diff(workingDocument, includeEol: false))
                {
                    annotations.RemoveRange(hunk.RemoveStart - 1, hunk.Removed);
                    for (int i = 0; i < hunk.Inserted; ++i)
                    {
                        if (hunk.InsertStart + i >= annotations.Count)
                        {
                            annotations.Add(nextRev);
                        }
                        else
                        {
                            annotations.Insert(hunk.InsertStart - 1, nextRev);
                        }
                    }
                }
            }

            return(annotations.ToArray());
        }
        public Revision[] GetHistory(Repository repo, FilePath sourcefile, Revision since)
        {
            SvnRevision startrev = SvnRevision.Working;
            SvnRevision sincerev = SvnRevision.First;

            if (since != null)
            {
                sincerev = (SvnRevision)since;
            }

            return(Log(repo, sourcefile, startrev, sincerev).ToArray());
        }
Ejemplo n.º 3
0
        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);
            }

            VersionStatus status = ConvertStatus(SvnSchedule.Normal, ent.LocalContentStatus);

            bool readOnly = File.Exists(ent.FullPath) && (File.GetAttributes(ent.FullPath) & FileAttributes.ReadOnly) != 0;

            if (ent.WorkingCopyInfo != null)
            {
                if (ent.RemoteLock != null || ent.LocalLock != null)
                {
                    status |= VersionStatus.LockRequired;
                    if (ent.LocalLock != 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.Revision);
            }

            return(new VersionInfo(ent.FullPath, repoPath, ent.NodeKind == SvnNodeKind.Directory,
                                   status, newRev,
                                   rs, rr));
        }
Ejemplo n.º 4
0
        public override Task <Revision> GetPreviousAsync(CancellationToken cancellationToken)
        {
            Revision result;

            if (Kind != 1 && Rev == 0)
            {
                result = Previous;
            }
            else
            {
                result = new SvnRevision(Repository, Rev - 1);
            }
            return(Task.FromResult(result));
        }
Ejemplo n.º 5
0
        public override Annotation[] GetAnnotations(Repository repo, FilePath file, SvnRevision revStart, SvnRevision revEnd)
        {
            if (file == FilePath.Null)
            {
                throw new ArgumentNullException();
            }

            var target         = new SvnPathTarget(file, SharpSvn.SvnRevision.Base);
            int numAnnotations = 0;

            using (var data = new MemoryStream()) {
                lock (client)
                    client.Write(target, data);

                using (var reader = new StreamReader(data)) {
                    reader.BaseStream.Seek(0, SeekOrigin.Begin);
                    while (reader.ReadLine() != null)
                    {
                        numAnnotations++;
                    }
                }
            }

            System.Collections.ObjectModel.Collection <SvnBlameEventArgs> list;
            var args = new SvnBlameArgs {
                Start = GetRevision(revStart),
                End   = GetRevision(revEnd),
            };

            bool success;

            lock (client) {
                success = client.GetBlame(target, args, out list);
            }
            if (success)
            {
                var 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]);
        }
Ejemplo n.º 6
0
        public override string GetUnifiedDiff(FilePath path1, SvnRevision revision1, FilePath path2, SvnRevision revision2, bool recursive)
        {
            SvnPathTarget t1   = new SvnPathTarget(path1, GetRevision(revision1));
            SvnPathTarget t2   = new SvnPathTarget(path2, GetRevision(revision2));
            SvnDiffArgs   args = new SvnDiffArgs();

            args.Depth = recursive ? SvnDepth.Infinity : SvnDepth.Children;
            MemoryStream ms = new MemoryStream();

            client.Diff(t1, t2, args, ms);
            ms.Position = 0;
            using (StreamReader sr = new StreamReader(ms)) {
                return(sr.ReadToEnd());
            }
        }
Ejemplo n.º 7
0
        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));
            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);
        }
Ejemplo n.º 8
0
        public Revision[] GetHistory(Repository repo, FilePath sourcefile, Revision since)
        {
            List <Revision> revs = new List <Revision>();

            SvnRevision startrev = SvnRevision.Working;
            SvnRevision sincerev = SvnRevision.First;

            if (since != null)
            {
                sincerev = (SvnRevision)since;
            }

            foreach (SvnRevision rev in Log(repo, sourcefile, startrev, sincerev))
            {
                revs.Add(rev);
            }

            return(revs.ToArray());
        }
Ejemplo n.º 9
0
		/// <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];
		}
		/// <summary>
		/// Get annotations for a versioned file.
		/// </summary>
		/// <returns>
		/// A <see cref="System.String"/> annotation for each line in file.
		/// </returns>
		public virtual List<string> GetAnnotations (Repository repo, FilePath file, SvnRevision revStart, SvnRevision revEnd)
		{
			return new List<string> ();
		}
Ejemplo n.º 11
0
		public abstract IEnumerable<DirectoryEntry> List (FilePath path, bool recurse, SvnRevision rev);
Ejemplo n.º 12
0
		public abstract void Move (FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, ProgressMonitor monitor);
Ejemplo n.º 13
0
        protected override Task <RevisionPath []> OnGetRevisionChangesAsync(Revision revision, CancellationToken cancellationToken = default)
        {
            SvnRevision rev = (SvnRevision)revision;

            return(Task.FromResult(rev.ChangedFiles ?? new RevisionPath [0]));
        }
		public virtual IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision)
		{
			return Status (repo, path, revision, false, false, false);
		}
 public abstract IEnumerable <DirectoryEntry> ListUrl(string url, bool recurse, SvnRevision rev);
Ejemplo n.º 16
0
        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);
        }
Ejemplo n.º 17
0
		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;
		}
 public abstract IEnumerable <VersionInfo> Status(Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus);
Ejemplo n.º 19
0
 public virtual IEnumerable <VersionInfo> Status(Repository repo, FilePath path, SvnRevision revision)
 {
     return(Status(repo, path, revision, false, false, false));
 }
Ejemplo n.º 20
0
		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;
		}
Ejemplo n.º 21
0
		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;
		}
Ejemplo n.º 22
0
 public override IEnumerable <DirectoryEntry> ListUrl(string url, bool recurse, SvnRevision rev)
 {
     return(List(new SvnUriTarget(url, GetRevision(rev)), recurse));
 }
 public abstract string GetUnifiedDiff(FilePath path1, SvnRevision revision1, FilePath path2, SvnRevision revision2, bool recursive);
Ejemplo n.º 24
0
 public override IEnumerable <DirectoryEntry> List(FilePath path, bool recurse, SvnRevision rev)
 {
     return(List(new SvnPathTarget(path, GetRevision(rev)), recurse));
 }
Ejemplo n.º 25
0
        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)
                client.Status(path, args, delegate(object o, SvnStatusEventArgs a) {
                    list.Add(CreateVersionInfo(repo, a));
                });
            return(list);
        }
Ejemplo n.º 26
0
        public override IEnumerable <VersionInfo> Status(Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus)
        {
            if (path == FilePath.Null)
            {
                throw new ArgumentNullException();
            }

            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 (!string.IsNullOrEmpty(e.File))
                    {
                        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) {
                    list.Add(VersionInfo.CreateUnversioned(e.File, Directory.Exists(e.File)));
                }
            }
            return(list);
        }
Ejemplo n.º 27
0
		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);
		}
Ejemplo n.º 28
0
        protected override RevisionPath[] OnGetRevisionChanges(Revision revision)
        {
            SvnRevision rev = (SvnRevision)revision;

            return(rev.ChangedFiles ?? new RevisionPath [0]);
        }
Ejemplo n.º 29
0
		public override IEnumerable<DirectoryEntry> ListUrl (string url, bool recurse, SvnRevision rev)
		{
			return List (new SvnUriTarget (url, GetRevision (rev)), recurse);
		}
 public abstract IEnumerable <DirectoryEntry> List(FilePath path, bool recurse, SvnRevision rev);
Ejemplo n.º 31
0
		public override IEnumerable<DirectoryEntry> List (FilePath path, bool recurse, SvnRevision rev)
		{
			return List (new SvnPathTarget (path, GetRevision (rev)), recurse);
		}
 public abstract void Move(FilePath srcPath, FilePath destPath, SvnRevision rev, bool force, IProgressMonitor monitor);
Ejemplo n.º 33
0
		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;
		}
 /// <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]);
 }
Ejemplo n.º 35
0
		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);
		}
 public abstract IEnumerable <SvnRevision> Log(Repository repo, FilePath path, SvnRevision revisionStart, SvnRevision revisionEnd);
Ejemplo n.º 37
0
		public override string GetUnifiedDiff (FilePath path1, SvnRevision revision1, FilePath path2, SvnRevision revision2, bool recursive)
		{
			SvnPathTarget t1 = new SvnPathTarget (path1, GetRevision (revision1));
			SvnPathTarget t2 = new SvnPathTarget (path2, GetRevision (revision2));
			SvnDiffArgs args = new SvnDiffArgs ();
			args.Depth = recursive ? SvnDepth.Infinity : SvnDepth.Children;
			MemoryStream ms = new MemoryStream ();
			lock (client) 
				client.Diff (t1, t2, args, ms);
			ms.Position = 0;
			using (StreamReader sr = new StreamReader (ms)) {
				return sr.ReadToEnd ();
			}
		}
Ejemplo n.º 38
0
		public abstract IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus);
Ejemplo n.º 39
0
		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) 
				client.Status (path, args, delegate (object o, SvnStatusEventArgs a) {
					list.Add (CreateVersionInfo (repo, a));
				});
			return list;
		}
Ejemplo n.º 40
0
		public abstract IEnumerable<DirectoryEntry> ListUrl (string url, bool recurse, SvnRevision rev);
Ejemplo n.º 41
0
		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;
		}
Ejemplo n.º 42
0
		public abstract string GetUnifiedDiff (FilePath path1, SvnRevision revision1, FilePath path2, SvnRevision revision2, bool recursive);
Ejemplo n.º 43
0
		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];
		}
Ejemplo n.º 44
0
		public abstract IEnumerable<SvnRevision> Log (Repository repo, FilePath path, SvnRevision revisionStart, SvnRevision revisionEnd);
Ejemplo n.º 45
0
        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();

            args.Revision             = GetRevision(revision);
            args.Depth                = descendDirs ? SvnDepth.Infinity : SvnDepth.Children;
            args.RetrieveAllEntries   = !changedItemsOnly;
            args.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;
                    }
                }
            }
            return(list);
        }