author | Aaron Griffin <agriffin@datalogics.com> | 2010-02-04 00:31:17 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2010-03-22 22:41:38 (UTC) |
commit | 65ced7c00907af7e8bd5d239a4fa854a84535520 (patch) (unidiff) | |
tree | 81e9f408d8781477c89ddd34591d52c355100cb9 /ui-atom.c | |
parent | ff3a3b4e2b7463bb8cb370bdda393e8b3526fcb9 (diff) | |
download | cgit-65ced7c00907af7e8bd5d239a4fa854a84535520.zip cgit-65ced7c00907af7e8bd5d239a4fa854a84535520.tar.gz cgit-65ced7c00907af7e8bd5d239a4fa854a84535520.tar.bz2 |
Add all=1 query param for atom feeds
Displays all items from all branches in one feed
Signed-off-by: Aaron Griffin <agriffin@datalogics.com>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-atom.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -56,65 +56,67 @@ void add_entry(struct commit *commit, char *host) | |||
56 | html(cgit_httpscheme()); | 56 | html(cgit_httpscheme()); |
57 | html_attr(host); | 57 | html_attr(host); |
58 | html_attr(cgit_pageurl(ctx.repo->url, "commit", NULL)); | 58 | html_attr(cgit_pageurl(ctx.repo->url, "commit", NULL)); |
59 | if (ctx.cfg.virtual_root) | 59 | if (ctx.cfg.virtual_root) |
60 | delim = '?'; | 60 | delim = '?'; |
61 | htmlf("%cid=%s", delim, hex); | 61 | htmlf("%cid=%s", delim, hex); |
62 | html("'/>\n"); | 62 | html("'/>\n"); |
63 | } | 63 | } |
64 | htmlf("<id>%s</id>\n", hex); | 64 | htmlf("<id>%s</id>\n", hex); |
65 | html("<content type='text'>\n"); | 65 | html("<content type='text'>\n"); |
66 | html_txt(info->msg); | 66 | html_txt(info->msg); |
67 | html("</content>\n"); | 67 | html("</content>\n"); |
68 | html("<content type='xhtml'>\n"); | 68 | html("<content type='xhtml'>\n"); |
69 | html("<div xmlns='http://www.w3.org/1999/xhtml'>\n"); | 69 | html("<div xmlns='http://www.w3.org/1999/xhtml'>\n"); |
70 | html("<pre>\n"); | 70 | html("<pre>\n"); |
71 | html_txt(info->msg); | 71 | html_txt(info->msg); |
72 | html("</pre>\n"); | 72 | html("</pre>\n"); |
73 | html("</div>\n"); | 73 | html("</div>\n"); |
74 | html("</content>\n"); | 74 | html("</content>\n"); |
75 | html("</entry>\n"); | 75 | html("</entry>\n"); |
76 | cgit_free_commitinfo(info); | 76 | cgit_free_commitinfo(info); |
77 | } | 77 | } |
78 | 78 | ||
79 | 79 | ||
80 | void cgit_print_atom(char *tip, char *path, int max_count) | 80 | void cgit_print_atom(char *tip, char *path, int max_count) |
81 | { | 81 | { |
82 | char *host; | 82 | char *host; |
83 | const char *argv[] = {NULL, tip, NULL, NULL, NULL}; | 83 | const char *argv[] = {NULL, tip, NULL, NULL, NULL}; |
84 | struct commit *commit; | 84 | struct commit *commit; |
85 | struct rev_info rev; | 85 | struct rev_info rev; |
86 | int argc = 2; | 86 | int argc = 2; |
87 | 87 | ||
88 | if (!tip) | 88 | if (ctx.qry.show_all) |
89 | argv[1] = "--all"; | ||
90 | else if (!tip) | ||
89 | argv[1] = ctx.qry.head; | 91 | argv[1] = ctx.qry.head; |
90 | 92 | ||
91 | if (path) { | 93 | if (path) { |
92 | argv[argc++] = "--"; | 94 | argv[argc++] = "--"; |
93 | argv[argc++] = path; | 95 | argv[argc++] = path; |
94 | } | 96 | } |
95 | 97 | ||
96 | init_revisions(&rev, NULL); | 98 | init_revisions(&rev, NULL); |
97 | rev.abbrev = DEFAULT_ABBREV; | 99 | rev.abbrev = DEFAULT_ABBREV; |
98 | rev.commit_format = CMIT_FMT_DEFAULT; | 100 | rev.commit_format = CMIT_FMT_DEFAULT; |
99 | rev.verbose_header = 1; | 101 | rev.verbose_header = 1; |
100 | rev.show_root_diff = 0; | 102 | rev.show_root_diff = 0; |
101 | rev.max_count = max_count; | 103 | rev.max_count = max_count; |
102 | setup_revisions(argc, argv, &rev, NULL); | 104 | setup_revisions(argc, argv, &rev, NULL); |
103 | prepare_revision_walk(&rev); | 105 | prepare_revision_walk(&rev); |
104 | 106 | ||
105 | host = cgit_hosturl(); | 107 | host = cgit_hosturl(); |
106 | ctx.page.mimetype = "text/xml"; | 108 | ctx.page.mimetype = "text/xml"; |
107 | ctx.page.charset = "utf-8"; | 109 | ctx.page.charset = "utf-8"; |
108 | cgit_print_http_headers(&ctx); | 110 | cgit_print_http_headers(&ctx); |
109 | html("<feed xmlns='http://www.w3.org/2005/Atom'>\n"); | 111 | html("<feed xmlns='http://www.w3.org/2005/Atom'>\n"); |
110 | html("<title>"); | 112 | html("<title>"); |
111 | html_txt(ctx.repo->name); | 113 | html_txt(ctx.repo->name); |
112 | html("</title>\n"); | 114 | html("</title>\n"); |
113 | html("<subtitle>"); | 115 | html("<subtitle>"); |
114 | html_txt(ctx.repo->desc); | 116 | html_txt(ctx.repo->desc); |
115 | html("</subtitle>\n"); | 117 | html("</subtitle>\n"); |
116 | if (host) { | 118 | if (host) { |
117 | html("<link rel='alternate' type='text/html' href='"); | 119 | html("<link rel='alternate' type='text/html' href='"); |
118 | html(cgit_httpscheme()); | 120 | html(cgit_httpscheme()); |
119 | html_attr(host); | 121 | html_attr(host); |
120 | html_attr(cgit_repourl(ctx.repo->url)); | 122 | html_attr(cgit_repourl(ctx.repo->url)); |