Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add the finfo web page. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
86c8768475f6eb0ec28329c4899e49a6 |
| User & Date: | drh 2007-08-01 00:55:18.000 |
Context
|
2007-08-01
| ||
| 01:24 | Added the vdiff webpage with links from vinfo. ... (check-in: 9df32e2808 user: drh tags: trunk) | |
| 00:55 | Add the finfo web page. ... (check-in: 86c8768475 user: drh tags: trunk) | |
| 00:40 | Improvements to the vinfo webpage. Show descendents, ancestors, and files changed. ... (check-in: 30d7afe328 user: drh tags: trunk) | |
Changes
Changes to src/info.c.
| ︙ | ︙ | |||
109 110 111 112 113 114 115 |
** Show information about descendents of a version. Do this recursively
** to a depth of N. Return true if descendents are shown and false if not.
*/
static int showDescendents(int pid, int depth){
Stmt q;
int cnt = 0;
db_prepare(&q,
| | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
** Show information about descendents of a version. Do this recursively
** to a depth of N. Return true if descendents are shown and false if not.
*/
static int showDescendents(int pid, int depth){
Stmt q;
int cnt = 0;
db_prepare(&q,
"SELECT plink.cid, blob.uuid, datetime(plink.mtime, 'localtime'),"
" event.user, event.comment"
" FROM plink, blob, event"
" WHERE plink.pid=%d"
" AND blob.rid=plink.cid"
" AND event.objid=plink.cid"
" ORDER BY plink.mtime ASC",
pid
|
| ︙ | ︙ | |||
155 156 157 158 159 160 161 |
** Show information about ancestors of a version. Do this recursively
** to a depth of N. Return true if ancestors are shown and false if not.
*/
static int showAncestors(int pid, int depth){
Stmt q;
int cnt = 0;
db_prepare(&q,
| | < | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
** Show information about ancestors of a version. Do this recursively
** to a depth of N. Return true if ancestors are shown and false if not.
*/
static int showAncestors(int pid, int depth){
Stmt q;
int cnt = 0;
db_prepare(&q,
"SELECT plink.pid, blob.uuid, datetime(event.mtime, 'localtime'),"
" event.user, event.comment"
" FROM plink, blob, event"
" WHERE plink.cid=%d"
" AND blob.rid=plink.pid"
" AND event.objid=plink.pid"
" ORDER BY event.mtime DESC",
pid
);
@ <ul>
while( db_step(&q)==SQLITE_ROW ){
int cid = db_column_int(&q, 0);
const char *zUuid = db_column_text(&q, 1);
const char *zDate = db_column_text(&q, 2);
const char *zUser = db_column_text(&q, 3);
const char *zCom = db_column_text(&q, 4);
cnt++;
@ <li>
|
| ︙ | ︙ | |||
194 195 196 197 198 199 200 |
** Return information about a version. The version number is contained
** in g.zExtra.
*/
void vinfo_page(void){
Stmt q;
int rid;
int isLeaf;
| | | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
** Return information about a version. The version number is contained
** in g.zExtra.
*/
void vinfo_page(void){
Stmt q;
int rid;
int isLeaf;
int n;
login_check_credentials();
if( !g.okHistory ){ login_needed(); return; }
style_header("Version Information");
rid = name_to_rid(g.zExtra);
if( rid==0 ){
@ No such object: %h(g.argv[2])
style_footer();
return;
}
isLeaf = !db_exists("SELECT 1 FROM plink WHERE pid=%d", rid);
db_prepare(&q,
"SELECT uuid, datetime(mtime, 'localtime'), user, comment"
" FROM blob, event"
" WHERE blob.rid=%d"
" AND event.objid=%d",
rid, rid
);
if( db_step(&q)==SQLITE_ROW ){
@ <h2>Version %s(db_column_text(&q,0))</h2>
|
| ︙ | ︙ | |||
253 254 255 256 257 258 259 |
if( pid && fid ){
@ <b>Modified:</b>
}else if( fid ){
@ <b>Added:</b>
}else{
@ <b>Deleted:</b>
}
| | < < | | | | < | < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | < | < > | < < < < | < | < | < < < < < | < | > | < < < < > > > > > | < < < < < < < < < < < < < < < < < < < | < < | < < < | | < | | | < < < < < < < < < | > | < | < | < | 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
if( pid && fid ){
@ <b>Modified:</b>
}else if( fid ){
@ <b>Added:</b>
}else{
@ <b>Deleted:</b>
}
@ <a href="%s(g.zBaseURL)/finfo/%T(zName)">%h(zName)</a></li>
}
@ </ul>
style_footer();
}
/*
** WEBPAGE: finfo
**
** Show the complete change history for a single file. The name
** of the file is in g.zExtra
*/
void finfo_page(void){
Stmt q;
char zPrevDate[20];
login_check_credentials();
if( !g.okHistory ){ login_needed(); return; }
style_header("File History");
zPrevDate[0] = 0;
db_prepare(&q,
"SELECT blob.uuid, datetime(event.mtime,'localtime'),"
" event.comment, event.user"
" FROM mlink, blob, event"
" WHERE mlink.fnid=(SELECT fnid FROM filename WHERE name=%Q)"
" AND blob.rid=mlink.mid"
" AND event.objid=mlink.mid"
" ORDER BY event.mtime DESC",
g.zExtra
);
@ <h2>History of %h(g.zExtra)</h2>
@ <table cellspacing=0 border=0 cellpadding=0>
while( db_step(&q)==SQLITE_ROW ){
const char *zDate = db_column_text(&q, 1);
if( memcmp(zDate, zPrevDate, 10) ){
sprintf(zPrevDate, "%.10s", zDate);
@ <tr><td colspan=3>
@ <table cellpadding=2 border=0>
@ <tr><td bgcolor="#a0b5f4" class="border1">
@ <table cellpadding=2 cellspacing=0 border=0><tr>
@ <td bgcolor="#d0d9f4" class="bkgnd1">%s(zPrevDate)</td>
@ </tr></table>
@ </td></tr></table>
@ </td></tr>
}
@ <tr><td valign="top">%s(&zDate[11])</td>
@ <td width="20"></td>
@ <td valign="top" align="left">
hyperlink_to_uuid(db_column_text(&q,0));
@ %h(db_column_text(&q,2)) (by %h(db_column_text(&q,3)))</td>
}
db_finalize(&q);
@ </table>
style_footer();
}
#if 0
/*
** WEB PAGE: diff
**
** Display the difference between two files determined by the v1 and v2
** query parameters. If only v2 is given compute v1 as the parent of v2.
|
| ︙ | ︙ |