public void SetBranchLabel(BranchLabelModel b) { CommitManager m = CommitManager.GetInstance(); m.SetupMovingBranchLabel(b); _moved = false; }
public bool Merge(BranchLabelModel merged) { Signature s = GetCurrentSignature(); MergeResult r = Repository.Merge(merged.Branch, s); return(r.Status != MergeStatus.Conflicts); }
void DeployBranchNodes() { List <BranchLabelModel> branchModels = new List <BranchLabelModel>(); ZoomAndPanCanvasModel.Branches?.ToList().ForEach(b => UnsubscribeEvents(b)); Dictionary <Commit, CommitNodeModel> pairs = ZoomAndPanCanvasModel.Commits.ToDictionary(x => x.Commit); List <IGrouping <Commit, Branch> > branchGroups = LibGitService.GetInstance().Branches.GroupBy(b => b.Tip).ToList(); foreach (var branchGroup in branchGroups) { int y = 1; List <BranchLabelModel> mg = branchGroup.ToList().Select(b => { CommitNodeModel tipNode = pairs[b.Tip]; tipNode.PlusButton = false; Point cl = tipNode.Location; BranchLabelModel m = new BranchLabelModel() { Location = new Point(cl.X, cl.Y - 10 - 32 * (y++)), Branch = b }; branchModels.Add(m); return(m); }).ToList(); mg.First().Arrow = true; mg.Last().PlusButton = true; } branchModels.ForEach(b => SubscribeEvents(b)); ZoomAndPanCanvasModel.Branches = branchModels; }
public void SetupMovingBranchLabel(BranchLabelModel m) { m.RenderTransform = NodeTransform; m.ForegroundPull(); m.IsHitTestVisible = false; CompositionTarget.Rendering += MoveCanvasToMouse; Stopwatch = Stopwatch.StartNew(); }
public void RestoreBranchLabel(BranchLabelModel m) { m.RenderTransform = null; m.IsHitTestVisible = true; m.BackgroundPush(); Stopwatch.Stop(); NodeTransform.Matrix = Matrix.Identity; CompositionTarget.Rendering -= MoveCanvasToMouse; }
public void Rebase(BranchLabelModel rebasing, BranchLabelModel rebased) { GraphItemModel checkouted = Graph.Checkouted; Checkout(rebasing); bool succes = LibGitService.Merge(rebased); if (succes) { Checkout(rebased); } }
public void HighlightAsAggregationFocused(BranchLabelModel model) { if (AggregationFocused != null) { AggregationFocused.AggregationFocused = false; } AggregationFocused = model; if (model != null) { model.AggregationFocused = true; } }
public void Merge(BranchLabelModel merging, BranchLabelModel merged) { GraphItemModel checkouted = Graph.Checkouted; Checkout(merging); bool succes = LibGitService.Merge(merged); if (succes) { Checkout(checkouted); } }
public void Aggregate(BranchLabelModel aggregating, BranchLabelModel aggregated) { Aggregating = aggregating; Aggregated = aggregated; if (_conflict) { MainWindowModel.RaiseCantAggregateWhenConflict(); } else { MainWindowModel.OpenAggregatingContextMenu(); } }
public void BranchLabelToMouse(BranchLabelModel branch, Point mouse) { Vector mouseRelativeToGraph = new Vector(mouse.X, mouse.Y) - new Vector(Position.X, Position.Y); Matrix mat = ZoomAndPanCanvasModel.TransformMatrix; Matrix inv = mat; inv.Invert(); Point loc = branch.Location; Point tloc = mat.Transform(NodeTransform.Transform(loc)); Point diff = new Point(mouseRelativeToGraph.X - tloc.X, mouseRelativeToGraph.Y - tloc.Y); ScaleTransform scale = new ScaleTransform(inv.M11, inv.M22); diff = scale.Transform(diff); Matrix m = NodeTransform.Matrix; m.Translate(diff.X, diff.Y); NodeTransform.Matrix = m; }
void UpdateCheckouted() { Branch head = LibGitService.GetInstance().Head; BranchLabelModel checkoutedBranch = ZoomAndPanCanvasModel.Branches.Find(b => b.Branch.CanonicalName == head.CanonicalName); if (checkoutedBranch != null) { HighlightAsCheckouted(checkoutedBranch); } else { CommitNodeModel checkoutedCommit = ZoomAndPanCanvasModel.Commits.Find(c => c.Sha == head.Reference.TargetIdentifier); if (checkoutedCommit != null) { HighlightAsCheckouted(checkoutedCommit); } } }
public void AggregationFocus(BranchLabelModel m) { Graph.HighlightAsAggregationFocused(m); }
public void Commit(BranchLabelModel l, string message) { Signature s = GetCurrentSignature(); Commit c = Repository.Commit(message, s, s); }
public void Commit(BranchLabelModel l, string message, IEnumerable <string> stagedFiles, IEnumerable <string> unstagedFiles) { LibGitService.GetInstance().Add(stagedFiles, unstagedFiles); LibGitService.Commit(l, message); }
public void RestoreBranchLabel(BranchLabelModel m) { m.Focused = false; Graph.RestoreBranchLabel(m); }
public void BranchLabelToMouse(BranchLabelModel branch, Point mouse) { Graph.BranchLabelToMouse(branch, mouse); }
public void SetupMovingBranchLabel(BranchLabelModel m) { Graph.SetupMovingBranchLabel(m); }
public void AggregationFocus(BranchLabelModel l) { AggregationFocused = l; CommitManager.AggregationFocus(l); }
public BranchLabelViewModel(BranchLabelModel model, BranchLabelView view) : base(model, view) { Panel.SetZIndex(view, 2); SubscribeViewEvents(view); InitializeLocation(); }
Branch CreateBranch(string name, BranchLabelModel l) { return(Repository.CreateBranch(name, l.Branch.Tip)); }