Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Merge the --showfiles enhancement from the venks-emacs branch into trunk. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
2b8cbf3c41d5df08e9ca0acd27ed9e07 |
| User & Date: | drh 2011-08-22 18:25:39.262 |
Context
|
2011-08-22
| ||
| 18:45 | Add the Makefile.in file back into the checkout. check-in: 5feb1d6015 user: drh tags: trunk | |
| 18:25 | Merge the --showfiles enhancement from the venks-emacs branch into trunk. check-in: 2b8cbf3c41 user: drh tags: trunk | |
| 18:23 | Merge the msw-hack branch into trunk. check-in: af50b29c98 user: drh tags: trunk | |
|
2011-08-19
| ||
| 23:27 | Add a -showfiles flag to timeline. fossil ... -showfiles will now print a list of files after the checkin comment, like the "Show Files" button in the Web GUI. The format of the printed lines is the same as update. check-in: b14ab41ff8 user: venkat tags: venks-emacs | |
Changes
Deleted Makefile.in.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to src/descendants.c.
| ︙ | ︙ | |||
285 286 287 288 289 290 291 |
compute_leaves(base, 0);
db_prepare(&q,
"%s"
" AND event.objid IN (SELECT rid FROM leaves)"
" ORDER BY event.mtime DESC",
timeline_query_for_tty()
);
| | | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
compute_leaves(base, 0);
db_prepare(&q,
"%s"
" AND event.objid IN (SELECT rid FROM leaves)"
" ORDER BY event.mtime DESC",
timeline_query_for_tty()
);
print_timeline(&q, 20, 0);
db_finalize(&q);
}
/*
** COMMAND: leaves
**
** Usage: %fossil leaves ?--all? ?--closed?
|
| ︙ | ︙ | |||
320 321 322 323 324 325 326 |
if( showClosed ){
blob_appendf(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
}else if( !showAll ){
blob_appendf(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
}
db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_str(&sql));
blob_reset(&sql);
| | | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
if( showClosed ){
blob_appendf(&sql," AND %z", leaf_is_closed_sql("blob.rid"));
}else if( !showAll ){
blob_appendf(&sql," AND NOT %z", leaf_is_closed_sql("blob.rid"));
}
db_prepare(&q, "%s ORDER BY event.mtime DESC", blob_str(&sql));
blob_reset(&sql);
print_timeline(&q, 2000, 0);
db_finalize(&q);
}
/*
** WEBPAGE: leaves
**
** Find leaves of all branches.
|
| ︙ | ︙ |
Changes to src/search.c.
| ︙ | ︙ | |||
201 202 203 204 205 206 207 |
);
iBest = db_int(0, "SELECT max(x) FROM srch");
db_prepare(&q,
"SELECT rid, uuid, date, comment, 0, 0 FROM srch"
" WHERE x>%d ORDER BY x DESC, date DESC",
iBest/3
);
| | | 201 202 203 204 205 206 207 208 209 210 |
);
iBest = db_int(0, "SELECT max(x) FROM srch");
db_prepare(&q,
"SELECT rid, uuid, date, comment, 0, 0 FROM srch"
" WHERE x>%d ORDER BY x DESC, date DESC",
iBest/3
);
print_timeline(&q, 1000, 0);
db_finalize(&q);
}
|
Changes to src/tag.c.
| ︙ | ︙ | |||
456 457 458 459 460 461 462 |
" AND blob.rid IN ("
" SELECT rid FROM tagxref"
" WHERE tagtype>0 AND tagid=%d"
")"
" ORDER BY event.mtime DESC",
timeline_query_for_tty(), zType, tagid
);
| | | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 |
" AND blob.rid IN ("
" SELECT rid FROM tagxref"
" WHERE tagtype>0 AND tagid=%d"
")"
" ORDER BY event.mtime DESC",
timeline_query_for_tty(), zType, tagid
);
print_timeline(&q, 2000, 0);
db_finalize(&q);
}
}
}else
if( strncmp(g.argv[2],"list",n)==0 ){
Stmt q;
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
1237 1238 1239 1240 1241 1242 1243 | ** 0. rid ** 1. uuid ** 2. Date/Time ** 3. Comment string and user ** 4. Number of non-merge children ** 5. Number of parents */ | | > > | 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 |
** 0. rid
** 1. uuid
** 2. Date/Time
** 3. Comment string and user
** 4. Number of non-merge children
** 5. Number of parents
*/
void print_timeline(Stmt *q, int mxLine, int showfiles){
int nLine = 0;
char zPrevDate[20];
const char *zCurrentUuid=0;
zPrevDate[0] = 0;
int fchngQueryInit = 0; /* True if fchngQuery is initialized */
Stmt fchngQuery; /* Query for file changes on check-ins */
if( g.localOpen ){
int rid = db_lget_int("checkout", 0);
zCurrentUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
}
while( db_step(q)==SQLITE_ROW && nLine<=mxLine ){
|
| ︙ | ︙ | |||
1290 1291 1292 1293 1294 1295 1296 |
if( fossil_strcmp(zCurrentUuid,zId)==0 ){
sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
n += strlen(zPrefix);
}
zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom);
nLine += comment_print(zFree, 9, 79);
sqlite3_free(zFree);
| | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 |
if( fossil_strcmp(zCurrentUuid,zId)==0 ){
sqlite3_snprintf(sizeof(zPrefix)-n, &zPrefix[n], "*CURRENT* ");
n += strlen(zPrefix);
}
zFree = sqlite3_mprintf("[%.10s] %s%s", zUuid, zPrefix, zCom);
nLine += comment_print(zFree, 9, 79);
sqlite3_free(zFree);
if(showfiles){
int inUl = 0;
if( !fchngQueryInit ){
db_prepare(&fchngQuery,
"SELECT (pid==0) AS isnew,"
" (fid==0) AS isdel,"
" (SELECT name FROM filename WHERE fnid=mlink.fnid) AS name,"
" (SELECT uuid FROM blob WHERE rid=fid),"
" (SELECT uuid FROM blob WHERE rid=pid)"
" FROM mlink"
" WHERE mid=:mid AND pid!=fid"
" ORDER BY 3 /*sort*/"
);
fchngQueryInit = 1;
}
db_bind_int(&fchngQuery, ":mid", rid);
while( db_step(&fchngQuery)==SQLITE_ROW ){
const char *zFilename = db_column_text(&fchngQuery, 2);
int isNew = db_column_int(&fchngQuery, 0);
int isDel = db_column_int(&fchngQuery, 1);
const char *zOld = db_column_text(&fchngQuery, 4);
const char *zNew = db_column_text(&fchngQuery, 3);
if( isNew ){
fossil_print(" ADDED %s\n",zFilename);
}else if( isDel ){
fossil_print(" DELETED %s\n",zFilename);
}else{
fossil_print(" EDITED %s\n", zFilename);
}
}
db_reset(&fchngQuery);
}
}
if( fchngQueryInit ) db_finalize(&fchngQuery);
}
/*
** Return a pointer to a static string that forms the basis for
** a timeline query for display on a TTY.
*/
const char *timeline_query_for_tty(void){
|
| ︙ | ︙ | |||
1335 1336 1337 1338 1339 1340 1341 |
&& fossil_isdigit(z[0])
&& fossil_isdigit(z[5]);
}
/*
** COMMAND: timeline
**
| | | 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 |
&& fossil_isdigit(z[0])
&& fossil_isdigit(z[5]);
}
/*
** COMMAND: timeline
**
** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?-n N? ?-t TYPE? ?-showfiles?
**
** Print a summary of activity going backwards in date and time
** specified or from the current date and time if no arguments
** are given. Show as many as N (default 20) check-ins. The
** WHEN argument can be any unique abbreviation of one of these
** keywords:
**
|
| ︙ | ︙ | |||
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 |
**
** The optional TYPE argument may any types supported by the /timeline
** page. For example:
**
** w = wiki commits only
** ci = file commits only
** t = tickets only
*/
void timeline_cmd(void){
Stmt q;
int n, k;
const char *zCount;
const char *zType;
char *zOrigin;
char *zDate;
Blob sql;
int objid = 0;
Blob uuid;
int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
db_find_and_open_repository(0, 0);
zCount = find_option("count","n",1);
zType = find_option("type","t",1);
if( zCount ){
n = atoi(zCount);
}else{
n = 20;
| > > > > > > | 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 |
**
** The optional TYPE argument may any types supported by the /timeline
** page. For example:
**
** w = wiki commits only
** ci = file commits only
** t = tickets only
**
** The optional showfiles argument if specified prints the list of
** files changed in a checkin after the checkin comment
**
*/
void timeline_cmd(void){
Stmt q;
int n, k;
const char *zCount;
const char *zType;
char *zOrigin;
char *zDate;
Blob sql;
int objid = 0;
Blob uuid;
int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
int showfilesFlag = 0 ;
showfilesFlag = find_option("showfiles","f", 0)!=0;
db_find_and_open_repository(0, 0);
zCount = find_option("count","n",1);
zType = find_option("type","t",1);
if( zCount ){
n = atoi(zCount);
}else{
n = 20;
|
| ︙ | ︙ | |||
1397 1398 1399 1400 1401 1402 1403 |
mode = 4;
}else if( strncmp(g.argv[2],"parents",k)==0 ){
mode = 4;
}else if(!zType && !zCount){
usage("?WHEN? ?BASELINE|DATETIME? ?-n|--count N? ?-t TYPE?");
}
if( '-' != *g.argv[3] ){
| | | | 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 |
mode = 4;
}else if( strncmp(g.argv[2],"parents",k)==0 ){
mode = 4;
}else if(!zType && !zCount){
usage("?WHEN? ?BASELINE|DATETIME? ?-n|--count N? ?-t TYPE?");
}
if( '-' != *g.argv[3] ){
zOrigin = g.argv[3];
}else{
zOrigin = "now";
}
}else if( g.argc==3 ){
zOrigin = g.argv[2];
}else{
zOrigin = "now";
}
k = strlen(zOrigin);
|
| ︙ | ︙ | |||
1457 1458 1459 1460 1461 1462 1463 |
if( zType && (zType[0]!='a') ){
blob_appendf(&sql, " AND event.type=%Q ", zType);
}
blob_appendf(&sql, " ORDER BY event.mtime DESC");
db_prepare(&q, blob_str(&sql));
blob_reset(&sql);
| | | 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 |
if( zType && (zType[0]!='a') ){
blob_appendf(&sql, " AND event.type=%Q ", zType);
}
blob_appendf(&sql, " ORDER BY event.mtime DESC");
db_prepare(&q, blob_str(&sql));
blob_reset(&sql);
print_timeline(&q, n, showfilesFlag);
db_finalize(&q);
}
/*
** This is a version of the "localtime()" function from the standard
** C library. It converts a unix timestamp (seconds since 1970) into
** a broken-out local time structure.
|
| ︙ | ︙ |
Changes to src/update.c.
| ︙ | ︙ | |||
168 169 170 171 172 173 174 |
compute_leaves(vid, closeCode);
db_prepare(&q,
"%s "
" AND event.objid IN leaves"
" ORDER BY event.mtime DESC",
timeline_query_for_tty()
);
| | | 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
compute_leaves(vid, closeCode);
db_prepare(&q,
"%s "
" AND event.objid IN leaves"
" ORDER BY event.mtime DESC",
timeline_query_for_tty()
);
print_timeline(&q, 100, 0);
db_finalize(&q);
fossil_fatal("Multiple descendants");
}
}
tid = db_int(0, "SELECT rid FROM leaves, event"
" WHERE event.objid=leaves.rid"
" ORDER BY event.mtime DESC");
|
| ︙ | ︙ |