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 | |
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-- | cgit.c | 2 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | ui-atom.c | 4 |
3 files changed, 6 insertions, 1 deletions
@@ -241,24 +241,26 @@ static void querystring_cb(const char *name, const char *value) | |||
241 | } else if (!strcmp(name, "name")) { | 241 | } else if (!strcmp(name, "name")) { |
242 | ctx.qry.name = xstrdup(value); | 242 | ctx.qry.name = xstrdup(value); |
243 | } else if (!strcmp(name, "mimetype")) { | 243 | } else if (!strcmp(name, "mimetype")) { |
244 | ctx.qry.mimetype = xstrdup(value); | 244 | ctx.qry.mimetype = xstrdup(value); |
245 | } else if (!strcmp(name, "s")){ | 245 | } else if (!strcmp(name, "s")){ |
246 | ctx.qry.sort = xstrdup(value); | 246 | ctx.qry.sort = xstrdup(value); |
247 | } else if (!strcmp(name, "showmsg")) { | 247 | } else if (!strcmp(name, "showmsg")) { |
248 | ctx.qry.showmsg = atoi(value); | 248 | ctx.qry.showmsg = atoi(value); |
249 | } else if (!strcmp(name, "period")) { | 249 | } else if (!strcmp(name, "period")) { |
250 | ctx.qry.period = xstrdup(value); | 250 | ctx.qry.period = xstrdup(value); |
251 | } else if (!strcmp(name, "ss")) { | 251 | } else if (!strcmp(name, "ss")) { |
252 | ctx.qry.ssdiff = atoi(value); | 252 | ctx.qry.ssdiff = atoi(value); |
253 | } else if (!strcmp(name, "all")) { | ||
254 | ctx.qry.show_all = atoi(value); | ||
253 | } | 255 | } |
254 | } | 256 | } |
255 | 257 | ||
256 | char *xstrdupn(const char *str) | 258 | char *xstrdupn(const char *str) |
257 | { | 259 | { |
258 | return (str ? xstrdup(str) : NULL); | 260 | return (str ? xstrdup(str) : NULL); |
259 | } | 261 | } |
260 | 262 | ||
261 | static void prepare_context(struct cgit_context *ctx) | 263 | static void prepare_context(struct cgit_context *ctx) |
262 | { | 264 | { |
263 | memset(ctx, 0, sizeof(*ctx)); | 265 | memset(ctx, 0, sizeof(*ctx)); |
264 | ctx->cfg.agefile = "info/web/last-modified"; | 266 | ctx->cfg.agefile = "info/web/last-modified"; |
@@ -136,24 +136,25 @@ struct cgit_query { | |||
136 | char *sha1; | 136 | char *sha1; |
137 | char *sha2; | 137 | char *sha2; |
138 | char *path; | 138 | char *path; |
139 | char *name; | 139 | char *name; |
140 | char *mimetype; | 140 | char *mimetype; |
141 | char *url; | 141 | char *url; |
142 | char *period; | 142 | char *period; |
143 | int ofs; | 143 | int ofs; |
144 | int nohead; | 144 | int nohead; |
145 | char *sort; | 145 | char *sort; |
146 | int showmsg; | 146 | int showmsg; |
147 | int ssdiff; | 147 | int ssdiff; |
148 | int show_all; | ||
148 | }; | 149 | }; |
149 | 150 | ||
150 | struct cgit_config { | 151 | struct cgit_config { |
151 | char *agefile; | 152 | char *agefile; |
152 | char *cache_root; | 153 | char *cache_root; |
153 | char *clone_prefix; | 154 | char *clone_prefix; |
154 | char *css; | 155 | char *css; |
155 | char *favicon; | 156 | char *favicon; |
156 | char *footer; | 157 | char *footer; |
157 | char *head_include; | 158 | char *head_include; |
158 | char *header; | 159 | char *header; |
159 | char *index_header; | 160 | char *index_header; |
@@ -76,25 +76,27 @@ void add_entry(struct commit *commit, char *host) | |||
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; |