]> source.dussan.org Git - gitblit.git/commitdiff
Prefix RSS tags with type information. Include commit id and parents.
authorJames Moger <james.moger@gitblit.com>
Thu, 10 Nov 2011 21:57:53 +0000 (16:57 -0500)
committerJames Moger <james.moger@gitblit.com>
Thu, 10 Nov 2011 21:57:53 +0000 (16:57 -0500)
src/com/gitblit/SyndicationServlet.java

index 1de3d7906cbd9a18368717e2b0550f920ffa84b3..f9ae4e6de767e86d0c5a574af8356001183806bd 100644 (file)
@@ -190,18 +190,26 @@ public class SyndicationServlet extends HttpServlet {
                                        StringUtils.encodeURL(model.name), commit.getName());\r
                        entry.published = commit.getCommitterIdent().getWhen();\r
                        entry.contentType = "text/html";\r
-                       String message = GitBlit.self().processCommitMessage(model.name, commit.getFullMessage());\r
+                       String message = GitBlit.self().processCommitMessage(model.name,\r
+                                       commit.getFullMessage());\r
                        entry.content = message;\r
                        entry.repository = model.name;\r
-                       entry.branch = objectId;\r
+                       entry.branch = objectId;                        \r
+                       entry.tags = new ArrayList<String>();\r
+                       \r
+                       // add commit id and parent commit ids\r
+                       entry.tags.add("commit:" + commit.getName());\r
+                       for (RevCommit parent : commit.getParents()) {\r
+                               entry.tags.add("parent:" + parent.getName());\r
+                       }\r
+                       \r
+                       // add refs to tabs list\r
                        List<RefModel> refs = allRefs.get(commit.getId());\r
                        if (refs != null && refs.size() > 0) {\r
-                               List<String> tags = new ArrayList<String>();\r
                                for (RefModel ref : refs) {\r
-                                       tags.add(ref.getName());\r
+                                       entry.tags.add("ref:" + ref.getName());\r
                                }\r
-                               entry.tags = tags;\r
-                       }\r
+                       }                       \r
                        entries.add(entry);\r
                }\r
                String feedLink;\r