public static IAsyncOperation ApplyShelf(Shelf s) { throw new NotImplementedException(); /* * MessageDialogProgressMonitor monitor = new MessageDialogProgressMonitor (true, false, false, true); * var statusTracker = IdeApp.Workspace.GetFileStatusTracker (); * ThreadPool.QueueUserWorkItem (delegate { * try { * NGit.Api.MergeCommandResult result; * using (var gm = new MercurialMonitor (monitor)) * result = s.Apply (gm); * ReportShelfResult (monitor, result); * } catch (Exception ex) { * string msg = GettextCatalog.GetString ("Stash operation failed."); * monitor.ReportError (msg, ex); * } * finally { * monitor.Dispose (); * statusTracker.NotifyChanges (); * } * }); * return monitor.AsyncOperation; */ }
protected void OnButtonDeleteClicked(object sender, System.EventArgs e) { Shelf s = GetSelected(); if (s != null) { stashes.Remove(s); Fill(); UpdateButtons(); } }
internal static Shelf Parse(string line) { // Parses a stash log line and creates a Shelf object with the information Shelf s = new Shelf(); s.PrevShelfCommitId = line.Substring(0, 40); if (s.PrevShelfCommitId.All(c => c == '0')) // And id will all 0 means no parent (first stash of the stack) { s.PrevShelfCommitId = null; } s.CommitId = line.Substring(41, 40); string aname = string.Empty; string amail = string.Empty; int i = line.IndexOf('<'); if (i != -1) { aname = line.Substring(82, i - 82 - 1); i++; int i2 = line.IndexOf('>', i); if (i2 != -1) { amail = line.Substring(i, i2 - i); } i2 += 2; i = line.IndexOf(' ', i2); int secs = int.Parse(line.Substring(i2, i - i2)); DateTime t = new DateTime(1970, 1, 1) + TimeSpan.FromSeconds(secs); string st = t.ToString("yyyy-MM-ddTHH:mm:ss") + line.Substring(i + 1, 3) + ":" + line.Substring(i + 4, 2); s.DateTime = DateTimeOffset.Parse(st); s.Comment = line.Substring(i + 7); i = s.Comment.IndexOf(':'); if (i != -1) { s.Comment = s.Comment.Substring(i + 2); } } s.Author = aname; s.AuthorEmail = amail; s.FullLine = line; return(s); }