private void GetChildren(StatusNode node, List<StatusNode> result) { if (node.Children == null) return; foreach (StatusNode child in node.Children.Values) { result.Add(child); GetChildren(child, result); } }
private string GetNodePath(StatusNode child, string rootPath) { char S = Path.DirectorySeparatorChar; string path = ""; while (child != null && child.Name != ".") { path = S + child.Name + path; child = child.Parent; } return rootPath + S + path; }
public void Update() { if (runner != null) return; temp = new StatusNode(".", VCItemStatus.Undefined); updatingPath = RootPath; if (dirty != null) dirty = null; ignores.Update(); Run("status -A", updatingPath); }
private string GetNodePath(StatusNode child, string rootPath) { char S = Path.DirectorySeparatorChar; string path = ""; while (child != null && child.Name != ".") { path = S + child.Name + path; child = child.Parent; } return(rootPath + S + path); }
private void GetChildren(StatusNode node, List <StatusNode> result) { if (node.Children == null) { return; } foreach (StatusNode child in node.Children.Values) { result.Add(child); GetChildren(child, result); } }
public VCItemStatus GetOverlay(string path, string rootPath) { StatusNode snode = FindNode(path, rootPath); if (snode != null) { return(snode.Status); } else { return(VCItemStatus.Unknown); } }
public void Update() { if (runner != null) { return; } temp = new StatusNode(".", VCItemStatus.Undefined); updatingPath = RootPath; dirty = null; ignores.Update(); Run("status -A", updatingPath); }
private StatusNode AddChild(string name, VCItemStatus status, bool isLeaf) { if (name == ".") { if (status != VCItemStatus.Unknown) { Status = status; } return(this); } // inherit child status if (Status < status && status > VCItemStatus.UpToDate) { Status = status == VCItemStatus.Conflicted ? status : VCItemStatus.Modified; } // add/retrieve child if (!isLeaf) { if (status > VCItemStatus.UpToDate && status != VCItemStatus.Conflicted) { status = VCItemStatus.Modified; } else { status = VCItemStatus.UpToDate; } } StatusNode node = new StatusNode(name, status); node.Parent = this; if (!HasChildren) { HasChildren = true; Children = new Dictionary <string, StatusNode>(); Children.Add(name, node); } else if (Children.ContainsKey(name)) { return(Children[name]); } else { Children.Add(name, node); } return(node); }
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.Unknown); } return found; }
public void Update() { if (runner != null) return; temp = new StatusNode(".", VCItemStatus.Undefined); updatingPath = RootPath; if (dirty != null) { /*if (File.Exists(dirty)) dirty = Path.GetDirectoryName(dirty); StatusNode dirtyNode = root.FindPath(dirty); if (dirtyNode != null) updatingPath = dirty;*/ dirty = null; } Run("status -A", updatingPath); }
override protected void Runner_ProcessEnded(object sender, int exitCode) { runner = null; if (exitCode != 0) { String label = TextHelper.GetString("SourceControl.Label.UnableToGetRepoStatus"); TraceManager.AddAsync(label + " (" + exitCode + ")"); } if (updatingPath == RootPath) { root = temp; } if (OnResult != null) { OnResult(this); } }
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.Unknown); } return(found); }
public List <VCStatusReport> GetAllOverlays(string path, string rootPath) { StatusNode root = FindNode(path, rootPath); if (root == null) { return(null); } List <StatusNode> children = new List <StatusNode>(); GetChildren(root, children); List <VCStatusReport> result = new List <VCStatusReport>(); foreach (StatusNode child in children) { result.Add(new VCStatusReport(GetNodePath(child, rootPath), child.Status)); } return(result); }
public void Update() { if (runner != null) { return; } temp = new StatusNode(".", VCItemStatus.Undefined); updatingPath = RootPath; if (dirty != null) { /*if (File.Exists(dirty)) dirty = Path.GetDirectoryName(dirty); * StatusNode dirtyNode = root.FindPath(dirty); * if (dirtyNode != null) * updatingPath = dirty;*/ dirty = null; } Run("status -A", updatingPath); }
override protected void runner_ProcessEnded(object sender, int exitCode) { runner = null; if (exitCode != 0) { String label = TextHelper.GetString("SourceControl.Label.UnableToGetRepoStatus"); TraceManager.AddAsync(label + " (" + exitCode + ")"); } if (updatingPath == RootPath) root = temp; if (OnResult != null) OnResult(this); }
private StatusNode AddChild(string name, VCItemStatus status, bool isLeaf) { if (name == ".") { if (status != VCItemStatus.Unknown) Status = status; return this; } // inherit child status if (Status < status && status > VCItemStatus.UpToDate) Status = status == VCItemStatus.Conflicted ? status : VCItemStatus.Modified; // add/retrieve child if (!isLeaf) { if (status > VCItemStatus.UpToDate && status != VCItemStatus.Conflicted) status = VCItemStatus.Modified; else status = VCItemStatus.UpToDate; } StatusNode node = new StatusNode(name, status); node.Parent = this; if (!HasChildren) { HasChildren = true; Children = new Dictionary<string, StatusNode>(); Children.Add(name, node); } else if (Children.ContainsKey(name)) { return Children[name]; } else Children.Add(name, node); return node; }
protected override void runner_ProcessEnded(object sender, int exitCode) { runner = null; if (exitCode != 0) { String label = TextHelper.GetString("SourceControl.Label.UnableToGetRepoStatus"); TraceManager.AddAsync(label + " (" + exitCode + ")"); } if (updatingPath == RootPath) root = temp; /*else { StatusNode updateNode = root.FindPath(Path.GetDirectoryName(updatingPath)); if (updateNode != null) { if (updateNode.Parent == null) root = temp; else { string name = Path.GetFileName(updatingPath); if (updateNode.Children.ContainsKey(name)) updateNode.Children.Remove(name); updateNode.Children.Add(name, temp); } } }*/ if (OnResult != null) OnResult(this); }