// write this ticket to the git database public void SaveNew() { var dir = Base.CreateDirectory(TicketName); Base.AddFile(dir, "TICKET_ID", TicketName); Base.AddFile(dir, "ASSIGNED_" + CleanString(Assigned), Assigned); Debug.Assert(!string.IsNullOrEmpty(State)); Base.AddFile(dir, "STATE_" + State, State); foreach (var comment in Comments) { Base.AddFile(dir, CommentName(Email), comment.Text as string); } var tags = Tags.Select(t => t.Trim()).ToArray(); if (tags != null && tags.Length > 0) { foreach (var tag in tags) { if (tag.Length == 0) { continue; } var tag_filename = "TAG_" + Ticket.CleanString(tag); Base.AddFileIfNotExists(Path.Combine(TicketName, tag_filename), tag_filename); } } Base.Git.Commit("added ticket " + TicketName, new Author(User, Email)); }
private void AddTagNoCommit(string tag) { if (string.IsNullOrEmpty(tag)) { return; } var tag_filename = Path.Combine(TicketName, "TAG_" + tag); Base.AddFile(tag_filename, tag); }
public void AddComment(string comment) { if (string.IsNullOrEmpty(comment)) { return; } var comment_filename = Base.AddFile(Path.Combine(TicketName, CommentName(Email)), comment); Base.Git.Commit("added comment to ticket " + TicketName, new Author(User, Email)); Comments.Add(new Comment(Base, comment_filename)); }
public void ChangeAssigned(string new_assigned) { new_assigned = CleanString(new_assigned ?? ""); if (new_assigned == Assigned) { return; } Base.AddFile(Path.Combine(TicketName, "ASSIGNED_" + new_assigned), new_assigned); Base.RemoveFile(Path.Combine(TicketName, "ASSIGNED_" + Assigned)); Base.Git.Commit("assigned " + new_assigned + " to ticket " + TicketName, new Author(User, Email)); Assigned = new_assigned; }
public void ChangeState(string new_state) { if (string.IsNullOrEmpty(new_state)) { return; } if (new_state == State) { return; } Base.AddFile(Path.Combine(TicketName, "STATE_" + new_state), new_state); Base.RemoveFile(Path.Combine(TicketName, "STATE_" + State)); Base.Git.Commit("added state (" + new_state + ") to ticket " + TicketName, new Author(User, Email)); State = new_state; }