author | Lars Hjemli <hjemli@gmail.com> | 2007-06-17 16:12:03 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-06-17 16:12:03 (UTC) |
commit | 4a0be586662843382ecfa53af34a13b291312bc0 (patch) (unidiff) | |
tree | 01e0cd725fe249df3449bb089aad9f8d58081f89 /cgit.h | |
parent | faaca447b071592c9a1e1f14b4d0d2a39b4c795a (diff) | |
download | cgit-4a0be586662843382ecfa53af34a13b291312bc0.zip cgit-4a0be586662843382ecfa53af34a13b291312bc0.tar.gz cgit-4a0be586662843382ecfa53af34a13b291312bc0.tar.bz2 |
Add cgit_diff_link()
This adds a new function used to generate links to the diff page and uses
it everywhere such links appear (expect for single files in the diffstat
displayed on the commit page: this is now a link to the tree page).
The updated diff-page now expects zero, one or two revision specifiers, in
parameters head, id and id2. Id defaults to head unless otherwise specified,
while head (as usual) defaults to repo.defbranch. If id2 isn't specified, it
defaults to the first parent of id1.
The most important change is of course that now all repo pages (summary, log,
tree, commit and diff) has support for passing on the current branch and
revision, i.e. the road is now open for a 'static' menu with links to all
of these pages.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.h | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -202,32 +202,33 @@ extern char *cgit_pageurl(const char *reponame, const char *pagename, | |||
202 | const char *query); | 202 | const char *query); |
203 | 203 | ||
204 | extern void cgit_tree_link(char *name, char *title, char *class, char *head, | 204 | extern void cgit_tree_link(char *name, char *title, char *class, char *head, |
205 | char *rev, char *path); | 205 | char *rev, char *path); |
206 | extern void cgit_log_link(char *name, char *title, char *class, char *head, | 206 | extern void cgit_log_link(char *name, char *title, char *class, char *head, |
207 | char *rev, char *path); | 207 | char *rev, char *path); |
208 | extern void cgit_commit_link(char *name, char *title, char *class, char *head, | 208 | extern void cgit_commit_link(char *name, char *title, char *class, char *head, |
209 | char *rev); | 209 | char *rev); |
210 | extern void cgit_diff_link(char *name, char *title, char *class, char *head, | ||
211 | char *new_rev, char *old_rev, char *path); | ||
210 | 212 | ||
211 | extern void cgit_print_error(char *msg); | 213 | extern void cgit_print_error(char *msg); |
212 | extern void cgit_print_date(time_t secs, char *format); | 214 | extern void cgit_print_date(time_t secs, char *format); |
213 | extern void cgit_print_age(time_t t, time_t max_relative, char *format); | 215 | extern void cgit_print_age(time_t t, time_t max_relative, char *format); |
214 | extern void cgit_print_docstart(char *title, struct cacheitem *item); | 216 | extern void cgit_print_docstart(char *title, struct cacheitem *item); |
215 | extern void cgit_print_docend(); | 217 | extern void cgit_print_docend(); |
216 | extern void cgit_print_pageheader(char *title, int show_search); | 218 | extern void cgit_print_pageheader(char *title, int show_search); |
217 | extern void cgit_print_snapshot_start(const char *mimetype, | 219 | extern void cgit_print_snapshot_start(const char *mimetype, |
218 | const char *filename, | 220 | const char *filename, |
219 | struct cacheitem *item); | 221 | struct cacheitem *item); |
220 | 222 | ||
221 | extern void cgit_print_repolist(struct cacheitem *item); | 223 | extern void cgit_print_repolist(struct cacheitem *item); |
222 | extern void cgit_print_summary(); | 224 | extern void cgit_print_summary(); |
223 | extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager); | 225 | extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager); |
224 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); | 226 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); |
225 | extern void cgit_print_tree(const char *rev, char *path); | 227 | extern void cgit_print_tree(const char *rev, char *path); |
226 | extern void cgit_print_commit(const char *hex); | 228 | extern void cgit_print_commit(char *hex); |
227 | extern void cgit_print_diff(const char *head, const char *old_hex, const char *new_hex, | 229 | extern void cgit_print_diff(const char *new_hex, const char *old_hex); |
228 | char *path); | ||
229 | extern void cgit_print_snapshot(struct cacheitem *item, const char *hex, | 230 | extern void cgit_print_snapshot(struct cacheitem *item, const char *hex, |
230 | const char *format, const char *prefix, | 231 | const char *format, const char *prefix, |
231 | const char *filename); | 232 | const char *filename); |
232 | 233 | ||
233 | #endif /* CGIT_H */ | 234 | #endif /* CGIT_H */ |