summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/tickets/TicketNotifier.java
diff options
context:
space:
mode:
authorPaul Martin <paul@paulsputer.com>2016-04-27 23:58:06 +0100
committerPaul Martin <paul@paulsputer.com>2016-04-27 23:58:06 +0100
commitc2188a840bc4153ae92112b04b2e06a90d3944aa (patch)
treec11b48170773fcf1edfc53def832fe5a9b76f1c0 /src/main/java/com/gitblit/tickets/TicketNotifier.java
parent56619e42f0a1e555c004374e7f2b13f744ab23f5 (diff)
downloadgitblit-c2188a840bc4153ae92112b04b2e06a90d3944aa.tar.gz
gitblit-c2188a840bc4153ae92112b04b2e06a90d3944aa.zip
Ticket Reference handling #1048
+ Supports referencing: + Tickets from other tickets via comments + Tickets from commits on any branch + Common TicketLink class used for both commits and tickets + TicketLink is temporary and persisted to ticket as a Reference + Support deletion of ticket references + Rebasing patchsets/branches will generate new references + Deleting old patchsets/branches will remove the relevant references + Substantial testing of use cases + With and without patchsets, deleting, amending + BranchTicketService used during testing to allow end-to-end ref testing + Relocated common git helper functions to JGitUtils
Diffstat (limited to 'src/main/java/com/gitblit/tickets/TicketNotifier.java')
-rw-r--r--src/main/java/com/gitblit/tickets/TicketNotifier.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/tickets/TicketNotifier.java b/src/main/java/com/gitblit/tickets/TicketNotifier.java
index 5979cf26..8c7fe6d4 100644
--- a/src/main/java/com/gitblit/tickets/TicketNotifier.java
+++ b/src/main/java/com/gitblit/tickets/TicketNotifier.java
@@ -317,6 +317,19 @@ public class TicketNotifier {
// comment update
sb.append(MessageFormat.format("**{0}** commented on this ticket.", user.getDisplayName()));
sb.append(HARD_BRK);
+ } else if (lastChange.hasReference()) {
+ // reference update
+ String type = "?";
+
+ switch (lastChange.reference.getSourceType()) {
+ case Commit: { type = "commit"; } break;
+ case Ticket: { type = "ticket"; } break;
+ default: { } break;
+ }
+
+ sb.append(MessageFormat.format("**{0}** referenced this ticket in {1} {2}", type, lastChange.toString()));
+ sb.append(HARD_BRK);
+
} else {
// general update
pattern = "**{0}** has updated this ticket.";