Ejemplo n.º 1
0
        private Node CreateNode(SvnClient.StatusEnt ent)
        {
            Node ret = new Node();
            ret.RepositoryPath = ent.Url;
            ret.LocalPath = ent.LocalFilePath;
            ret.IsDirectory = ent.IsDirectory;
            ret.BaseRevision = new SvnRevisionPtr(ent.Revision);
            ret.Status = ConvertStatus(ent.Schedule, ent.TextStatus);

            if (ent.RemoteTextStatus != SvnClient.NodeStatus.EMPTY) {
                ret.RemoteStatus = ConvertStatus(SvnClient.NodeSchedule.Normal, ent.RemoteTextStatus);
                ret.RemoteUpdate = new RevisionDescription();
                ret.RemoteUpdate.RepositoryPath = ent.Url;
                ret.RemoteUpdate.Revision = new SvnRevisionPtr(ent.LastCommitRevision);
                ret.RemoteUpdate.Author = ent.LastCommitAuthor;
                ret.RemoteUpdate.Message = "(unavailable)";
                ret.RemoteUpdate.Time = ent.LastCommitDate;
            }

            return ret;
        }
Ejemplo n.º 2
0
        private NodeStatus ConvertStatus(SvnClient.NodeSchedule schedule, SvnClient.NodeStatus status)
        {
            switch (schedule) {
                case SvnClient.NodeSchedule.Add: return NodeStatus.ScheduledAdd;
                case SvnClient.NodeSchedule.Delete: return NodeStatus.ScheduledDelete;
                case SvnClient.NodeSchedule.Replace: return NodeStatus.ScheduledReplace;
            }

            switch (status) {
                case SvnClient.NodeStatus.None: return NodeStatus.Unchanged;
                case SvnClient.NodeStatus.Unversioned: return NodeStatus.Unversioned;
                case SvnClient.NodeStatus.Modified: return NodeStatus.Modified;
                case SvnClient.NodeStatus.Merged: return NodeStatus.Modified;
                case SvnClient.NodeStatus.Conflicted: return NodeStatus.Conflicted;
                case SvnClient.NodeStatus.Ignored: return NodeStatus.UnversionedIgnored;
                case SvnClient.NodeStatus.Obstructed: return NodeStatus.Obstructed;
            }
            return NodeStatus.Unknown;
        }