示例#1
0
        override protected void runner_Output(object sender, string line)
        {
            int fileIndex = 3;

            if (line.Length < fileIndex || line.Length < 3)
            {
                return;
            }
            char c0 = line[0];
            char c1 = line[1];

            if (c1 == ':')
            {
                return;
            }

            VCItemStatus s = VCItemStatus.UpToDate;

            //else if (c0 == 'I') s = VCItemStatus.Ignored; // TODO look into .gitignore
            if (c0 == '?')
            {
                s = VCItemStatus.Unknown;
            }
            if (c0 == 'U')
            {
                s = VCItemStatus.Conflicted;
            }
            else if (c0 == 'A')
            {
                s = VCItemStatus.Added;
            }
            else if (c0 == 'C')
            {
                s = VCItemStatus.Added;                 // copied
            }
            else if (c0 == 'R')
            {
                s = VCItemStatus.Added;                 // renamed
            }
            else if (c0 == 'M' || c1 == 'M')
            {
                s = VCItemStatus.Modified;
            }
            else if (c0 == 'D' || c1 == 'D')
            {
                s = VCItemStatus.Deleted;
            }

            int p = line.IndexOf(" -> ");

            if (p > 0)
            {
                line = line.Substring(p + 4);
            }
            else
            {
                line = line.Substring(fileIndex);
            }
            temp.MapPath(line, s);
        }
示例#2
0
        public StatusNode Get(string path)
        {
            StatusNode found = root.FindPath(path);

            if (found == null)
            {
                foreach (IgnoreEntry ignore in ignores)
                {
                    if ((ignore.path == "" || path.StartsWith(ignore.path)) && ignore.regex.IsMatch(path))
                    {
                        found = root.MapPath(path.Substring(ignore.path.Length), VCItemStatus.Ignored);
                        return(found);
                    }
                }
                found = new StatusNode(Path.GetFileName(path), VCItemStatus.UpToDate);
            }
            return(found);
        }