Fossil SCM

Add --limit as alias to --count in "fossil timeline" for consistancy with other commands. Add many short options, like "-a" for "--all" and "-c" for "--closed" (The JSON part already had those)

jan.nijtmans 2013-04-23 08:40 trunk
Commit 8b17c2360a5bc767a40b950bfdfa72db74eba6da
+4 -4
--- src/bisect.c
+++ src/bisect.c
@@ -202,11 +202,11 @@
202202
** fossil bisect reset
203203
**
204204
** Reinitialize a bisect session. This cancels prior bisect history
205205
** and allows a bisect session to start over from the beginning.
206206
**
207
-** fossil bisect vlist|ls|status ?--all?
207
+** fossil bisect vlist|ls|status ?-a|--all?
208208
**
209209
** List the versions in between "bad" and "good".
210210
**
211211
** fossil bisect undo
212212
**
@@ -296,11 +296,11 @@
296296
if( ridBad && ridGood ){
297297
zCmd = "next";
298298
n = 4;
299299
}
300300
}
301
- /* No else here so that the above commands can morph themselves into
301
+ /* No else here so that the above commands can morph themselves into
302302
** a "next" command */
303303
if( memcmp(zCmd, "next", n)==0 ){
304304
PathNode *pMid;
305305
bisect_path();
306306
pMid = path_midpoint();
@@ -369,14 +369,14 @@
369369
db_multi_exec(
370370
"DELETE FROM vvar WHERE name IN "
371371
" ('bisect-good', 'bisect-bad', 'bisect-log')"
372372
);
373373
}else if( memcmp(zCmd, "vlist", n)==0
374
- || memcmp(zCmd, "ls", n)==0
374
+ || memcmp(zCmd, "ls", n)==0
375375
|| memcmp(zCmd, "status", n)==0
376376
){
377
- int fAll = find_option("all", 0, 0)!=0;
377
+ int fAll = find_option("all", "a", 0)!=0;
378378
bisect_list(!fAll);
379379
}else if( !foundCmd ){
380380
usage("bad|good|log|next|options|reset|status|undo");
381381
}
382382
}
383383
--- src/bisect.c
+++ src/bisect.c
@@ -202,11 +202,11 @@
202 ** fossil bisect reset
203 **
204 ** Reinitialize a bisect session. This cancels prior bisect history
205 ** and allows a bisect session to start over from the beginning.
206 **
207 ** fossil bisect vlist|ls|status ?--all?
208 **
209 ** List the versions in between "bad" and "good".
210 **
211 ** fossil bisect undo
212 **
@@ -296,11 +296,11 @@
296 if( ridBad && ridGood ){
297 zCmd = "next";
298 n = 4;
299 }
300 }
301 /* No else here so that the above commands can morph themselves into
302 ** a "next" command */
303 if( memcmp(zCmd, "next", n)==0 ){
304 PathNode *pMid;
305 bisect_path();
306 pMid = path_midpoint();
@@ -369,14 +369,14 @@
369 db_multi_exec(
370 "DELETE FROM vvar WHERE name IN "
371 " ('bisect-good', 'bisect-bad', 'bisect-log')"
372 );
373 }else if( memcmp(zCmd, "vlist", n)==0
374 || memcmp(zCmd, "ls", n)==0
375 || memcmp(zCmd, "status", n)==0
376 ){
377 int fAll = find_option("all", 0, 0)!=0;
378 bisect_list(!fAll);
379 }else if( !foundCmd ){
380 usage("bad|good|log|next|options|reset|status|undo");
381 }
382 }
383
--- src/bisect.c
+++ src/bisect.c
@@ -202,11 +202,11 @@
202 ** fossil bisect reset
203 **
204 ** Reinitialize a bisect session. This cancels prior bisect history
205 ** and allows a bisect session to start over from the beginning.
206 **
207 ** fossil bisect vlist|ls|status ?-a|--all?
208 **
209 ** List the versions in between "bad" and "good".
210 **
211 ** fossil bisect undo
212 **
@@ -296,11 +296,11 @@
296 if( ridBad && ridGood ){
297 zCmd = "next";
298 n = 4;
299 }
300 }
301 /* No else here so that the above commands can morph themselves into
302 ** a "next" command */
303 if( memcmp(zCmd, "next", n)==0 ){
304 PathNode *pMid;
305 bisect_path();
306 pMid = path_midpoint();
@@ -369,14 +369,14 @@
369 db_multi_exec(
370 "DELETE FROM vvar WHERE name IN "
371 " ('bisect-good', 'bisect-bad', 'bisect-log')"
372 );
373 }else if( memcmp(zCmd, "vlist", n)==0
374 || memcmp(zCmd, "ls", n)==0
375 || memcmp(zCmd, "status", n)==0
376 ){
377 int fAll = find_option("all", "a", 0)!=0;
378 bisect_list(!fAll);
379 }else if( !foundCmd ){
380 usage("bad|good|log|next|options|reset|status|undo");
381 }
382 }
383
+7 -6
--- src/branch.c
+++ src/branch.c
@@ -238,15 +238,16 @@
238238
** --bgcolor COLOR use COLOR instead of automatic background
239239
** --nosign do not sign contents on this branch
240240
** --date-override DATE DATE to use instead of 'now'
241241
** --user-override USER USER to use instead of the current default
242242
**
243
-** %fossil branch list ?--all | --closed?
244
-** %fossil branch ls ?--all | --closed?
243
+** %fossil branch list ?-a|--all|-c|--closed?
244
+** %fossil branch ls ?-a|--all|-c|--closed?
245245
**
246
-** List all branches. Use --all or --closed to list all branches
247
-** or closed branches. The default is to show only open branches.
246
+** List all branches. Use -a or --all to list all branches and
247
+** -c or --closed to list all closed branches. The default is to
248
+** show only open branches.
248249
**
249250
** Options:
250251
** -R|--repository FILE Run commands on repository FILE
251252
*/
252253
void branch_cmd(void){
@@ -262,12 +263,12 @@
262263
branch_new();
263264
}else if( (strncmp(zCmd,"list",n)==0)||(strncmp(zCmd, "ls", n)==0) ){
264265
Stmt q;
265266
int vid;
266267
char *zCurrent = 0;
267
- int showAll = find_option("all",0,0)!=0;
268
- int showClosed = find_option("closed",0,0)!=0;
268
+ int showAll = find_option("all","a",0)!=0;
269
+ int showClosed = find_option("closed","c",0)!=0;
269270
270271
if( g.localOpen ){
271272
vid = db_lget_int("checkout", 0);
272273
zCurrent = db_text(0, "SELECT value FROM tagxref"
273274
" WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);
274275
--- src/branch.c
+++ src/branch.c
@@ -238,15 +238,16 @@
238 ** --bgcolor COLOR use COLOR instead of automatic background
239 ** --nosign do not sign contents on this branch
240 ** --date-override DATE DATE to use instead of 'now'
241 ** --user-override USER USER to use instead of the current default
242 **
243 ** %fossil branch list ?--all | --closed?
244 ** %fossil branch ls ?--all | --closed?
245 **
246 ** List all branches. Use --all or --closed to list all branches
247 ** or closed branches. The default is to show only open branches.
 
248 **
249 ** Options:
250 ** -R|--repository FILE Run commands on repository FILE
251 */
252 void branch_cmd(void){
@@ -262,12 +263,12 @@
262 branch_new();
263 }else if( (strncmp(zCmd,"list",n)==0)||(strncmp(zCmd, "ls", n)==0) ){
264 Stmt q;
265 int vid;
266 char *zCurrent = 0;
267 int showAll = find_option("all",0,0)!=0;
268 int showClosed = find_option("closed",0,0)!=0;
269
270 if( g.localOpen ){
271 vid = db_lget_int("checkout", 0);
272 zCurrent = db_text(0, "SELECT value FROM tagxref"
273 " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);
274
--- src/branch.c
+++ src/branch.c
@@ -238,15 +238,16 @@
238 ** --bgcolor COLOR use COLOR instead of automatic background
239 ** --nosign do not sign contents on this branch
240 ** --date-override DATE DATE to use instead of 'now'
241 ** --user-override USER USER to use instead of the current default
242 **
243 ** %fossil branch list ?-a|--all|-c|--closed?
244 ** %fossil branch ls ?-a|--all|-c|--closed?
245 **
246 ** List all branches. Use -a or --all to list all branches and
247 ** -c or --closed to list all closed branches. The default is to
248 ** show only open branches.
249 **
250 ** Options:
251 ** -R|--repository FILE Run commands on repository FILE
252 */
253 void branch_cmd(void){
@@ -262,12 +263,12 @@
263 branch_new();
264 }else if( (strncmp(zCmd,"list",n)==0)||(strncmp(zCmd, "ls", n)==0) ){
265 Stmt q;
266 int vid;
267 char *zCurrent = 0;
268 int showAll = find_option("all","a",0)!=0;
269 int showClosed = find_option("closed","c",0)!=0;
270
271 if( g.localOpen ){
272 vid = db_lget_int("checkout", 0);
273 zCurrent = db_text(0, "SELECT value FROM tagxref"
274 " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);
275
+13 -13
--- src/descendants.c
+++ src/descendants.c
@@ -71,11 +71,11 @@
7171
bag_init(&pending);
7272
bag_insert(&pending, iBase);
7373
7474
/* This query returns all non-branch-merge children of check-in :rid.
7575
**
76
- ** If a child is a merge of a fork within the same branch, it is
76
+ ** If a child is a merge of a fork within the same branch, it is
7777
** returned. Only merge children in different branches are excluded.
7878
*/
7979
db_prepare(&q1,
8080
"SELECT cid FROM plink"
8181
" WHERE pid=:rid"
@@ -84,25 +84,25 @@
8484
" WHERE tagid=%d AND rid=plink.pid), 'trunk')"
8585
"=coalesce((SELECT value FROM tagxref"
8686
" WHERE tagid=%d AND rid=plink.cid), 'trunk'))",
8787
TAG_BRANCH, TAG_BRANCH
8888
);
89
-
89
+
9090
/* This query returns a single row if check-in :rid is the first
9191
** check-in of a new branch.
9292
*/
93
- db_prepare(&isBr,
93
+ db_prepare(&isBr,
9494
"SELECT 1 FROM tagxref"
9595
" WHERE rid=:rid AND tagid=%d AND tagtype=2"
9696
" AND srcid>0",
9797
TAG_BRANCH
9898
);
99
-
99
+
100100
/* This statement inserts check-in :rid into the LEAVES table.
101101
*/
102102
db_prepare(&ins, "INSERT OR IGNORE INTO leaves VALUES(:rid)");
103
-
103
+
104104
while( bag_count(&pending) ){
105105
int rid = bag_first(&pending);
106106
int cnt = 0;
107107
bag_remove(&pending, rid);
108108
db_bind_int(&q1, ":rid", rid);
@@ -209,11 +209,11 @@
209209
" generation INTEGER PRIMARY KEY);"
210210
"DELETE FROM ancestor;"
211211
"INSERT INTO ancestor VALUES(%d, 0);", rid
212212
);
213213
db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)");
214
- db_prepare(&q,
214
+ db_prepare(&q,
215215
"SELECT pid FROM plink"
216216
" WHERE cid=:rid AND isprim"
217217
);
218218
while( (N--)>0 ){
219219
db_bind_int(&q, ":rid", rid);
@@ -339,29 +339,29 @@
339339
** COMMAND: leaves*
340340
**
341341
** Usage: %fossil leaves ?OPTIONS?
342342
**
343343
** Find leaves of all branches. By default show only open leaves.
344
-** The --all flag causes all leaves (closed and open) to be shown.
345
-** The --closed flag shows only closed leaves.
344
+** The -a|--all flag causes all leaves (closed and open) to be shown.
345
+** The -c|--closed flag shows only closed leaves.
346346
**
347347
** The --recompute flag causes the content of the "leaf" table in the
348348
** repository database to be recomputed.
349349
**
350350
** Options:
351
-** --all show ALL leaves
352
-** --closed show only closed leaves
351
+** -a|--all show ALL leaves
352
+** -c|--closed show only closed leaves
353353
** --bybranch order output by branch name
354354
** --recompute recompute the "leaf" table in the repository DB
355355
**
356356
** See also: descendants, finfo, info, branch
357357
*/
358358
void leaves_cmd(void){
359359
Stmt q;
360360
Blob sql;
361
- int showAll = find_option("all", 0, 0)!=0;
362
- int showClosed = find_option("closed", 0, 0)!=0;
361
+ int showAll = find_option("all", "a", 0)!=0;
362
+ int showClosed = find_option("closed", "c", 0)!=0;
363363
int recomputeFlag = find_option("recompute",0,0)!=0;
364364
int byBranch = find_option("bybranch",0,0)!=0;
365365
char *zLastBr = 0;
366366
int n;
367367
char zLineNo[10];
@@ -504,11 +504,11 @@
504504
db_bind_int(&ins, ":rid", mid);
505505
db_step(&ins);
506506
db_reset(&ins);
507507
}
508508
db_finalize(&q);
509
-
509
+
510510
db_prepare(&q, "SELECT mid FROM mlink WHERE pid=%d", fid);
511511
while( db_step(&q)==SQLITE_ROW ){
512512
int mid = db_column_int(&q, 0);
513513
bag_insert(&seen, mid);
514514
if( usesFlags & USESFILE_DELETE ){
515515
--- src/descendants.c
+++ src/descendants.c
@@ -71,11 +71,11 @@
71 bag_init(&pending);
72 bag_insert(&pending, iBase);
73
74 /* This query returns all non-branch-merge children of check-in :rid.
75 **
76 ** If a child is a merge of a fork within the same branch, it is
77 ** returned. Only merge children in different branches are excluded.
78 */
79 db_prepare(&q1,
80 "SELECT cid FROM plink"
81 " WHERE pid=:rid"
@@ -84,25 +84,25 @@
84 " WHERE tagid=%d AND rid=plink.pid), 'trunk')"
85 "=coalesce((SELECT value FROM tagxref"
86 " WHERE tagid=%d AND rid=plink.cid), 'trunk'))",
87 TAG_BRANCH, TAG_BRANCH
88 );
89
90 /* This query returns a single row if check-in :rid is the first
91 ** check-in of a new branch.
92 */
93 db_prepare(&isBr,
94 "SELECT 1 FROM tagxref"
95 " WHERE rid=:rid AND tagid=%d AND tagtype=2"
96 " AND srcid>0",
97 TAG_BRANCH
98 );
99
100 /* This statement inserts check-in :rid into the LEAVES table.
101 */
102 db_prepare(&ins, "INSERT OR IGNORE INTO leaves VALUES(:rid)");
103
104 while( bag_count(&pending) ){
105 int rid = bag_first(&pending);
106 int cnt = 0;
107 bag_remove(&pending, rid);
108 db_bind_int(&q1, ":rid", rid);
@@ -209,11 +209,11 @@
209 " generation INTEGER PRIMARY KEY);"
210 "DELETE FROM ancestor;"
211 "INSERT INTO ancestor VALUES(%d, 0);", rid
212 );
213 db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)");
214 db_prepare(&q,
215 "SELECT pid FROM plink"
216 " WHERE cid=:rid AND isprim"
217 );
218 while( (N--)>0 ){
219 db_bind_int(&q, ":rid", rid);
@@ -339,29 +339,29 @@
339 ** COMMAND: leaves*
340 **
341 ** Usage: %fossil leaves ?OPTIONS?
342 **
343 ** Find leaves of all branches. By default show only open leaves.
344 ** The --all flag causes all leaves (closed and open) to be shown.
345 ** The --closed flag shows only closed leaves.
346 **
347 ** The --recompute flag causes the content of the "leaf" table in the
348 ** repository database to be recomputed.
349 **
350 ** Options:
351 ** --all show ALL leaves
352 ** --closed show only closed leaves
353 ** --bybranch order output by branch name
354 ** --recompute recompute the "leaf" table in the repository DB
355 **
356 ** See also: descendants, finfo, info, branch
357 */
358 void leaves_cmd(void){
359 Stmt q;
360 Blob sql;
361 int showAll = find_option("all", 0, 0)!=0;
362 int showClosed = find_option("closed", 0, 0)!=0;
363 int recomputeFlag = find_option("recompute",0,0)!=0;
364 int byBranch = find_option("bybranch",0,0)!=0;
365 char *zLastBr = 0;
366 int n;
367 char zLineNo[10];
@@ -504,11 +504,11 @@
504 db_bind_int(&ins, ":rid", mid);
505 db_step(&ins);
506 db_reset(&ins);
507 }
508 db_finalize(&q);
509
510 db_prepare(&q, "SELECT mid FROM mlink WHERE pid=%d", fid);
511 while( db_step(&q)==SQLITE_ROW ){
512 int mid = db_column_int(&q, 0);
513 bag_insert(&seen, mid);
514 if( usesFlags & USESFILE_DELETE ){
515
--- src/descendants.c
+++ src/descendants.c
@@ -71,11 +71,11 @@
71 bag_init(&pending);
72 bag_insert(&pending, iBase);
73
74 /* This query returns all non-branch-merge children of check-in :rid.
75 **
76 ** If a child is a merge of a fork within the same branch, it is
77 ** returned. Only merge children in different branches are excluded.
78 */
79 db_prepare(&q1,
80 "SELECT cid FROM plink"
81 " WHERE pid=:rid"
@@ -84,25 +84,25 @@
84 " WHERE tagid=%d AND rid=plink.pid), 'trunk')"
85 "=coalesce((SELECT value FROM tagxref"
86 " WHERE tagid=%d AND rid=plink.cid), 'trunk'))",
87 TAG_BRANCH, TAG_BRANCH
88 );
89
90 /* This query returns a single row if check-in :rid is the first
91 ** check-in of a new branch.
92 */
93 db_prepare(&isBr,
94 "SELECT 1 FROM tagxref"
95 " WHERE rid=:rid AND tagid=%d AND tagtype=2"
96 " AND srcid>0",
97 TAG_BRANCH
98 );
99
100 /* This statement inserts check-in :rid into the LEAVES table.
101 */
102 db_prepare(&ins, "INSERT OR IGNORE INTO leaves VALUES(:rid)");
103
104 while( bag_count(&pending) ){
105 int rid = bag_first(&pending);
106 int cnt = 0;
107 bag_remove(&pending, rid);
108 db_bind_int(&q1, ":rid", rid);
@@ -209,11 +209,11 @@
209 " generation INTEGER PRIMARY KEY);"
210 "DELETE FROM ancestor;"
211 "INSERT INTO ancestor VALUES(%d, 0);", rid
212 );
213 db_prepare(&ins, "INSERT INTO ancestor VALUES(:rid, :gen)");
214 db_prepare(&q,
215 "SELECT pid FROM plink"
216 " WHERE cid=:rid AND isprim"
217 );
218 while( (N--)>0 ){
219 db_bind_int(&q, ":rid", rid);
@@ -339,29 +339,29 @@
339 ** COMMAND: leaves*
340 **
341 ** Usage: %fossil leaves ?OPTIONS?
342 **
343 ** Find leaves of all branches. By default show only open leaves.
344 ** The -a|--all flag causes all leaves (closed and open) to be shown.
345 ** The -c|--closed flag shows only closed leaves.
346 **
347 ** The --recompute flag causes the content of the "leaf" table in the
348 ** repository database to be recomputed.
349 **
350 ** Options:
351 ** -a|--all show ALL leaves
352 ** -c|--closed show only closed leaves
353 ** --bybranch order output by branch name
354 ** --recompute recompute the "leaf" table in the repository DB
355 **
356 ** See also: descendants, finfo, info, branch
357 */
358 void leaves_cmd(void){
359 Stmt q;
360 Blob sql;
361 int showAll = find_option("all", "a", 0)!=0;
362 int showClosed = find_option("closed", "c", 0)!=0;
363 int recomputeFlag = find_option("recompute",0,0)!=0;
364 int byBranch = find_option("bybranch",0,0)!=0;
365 char *zLastBr = 0;
366 int n;
367 char zLineNo[10];
@@ -504,11 +504,11 @@
504 db_bind_int(&ins, ":rid", mid);
505 db_step(&ins);
506 db_reset(&ins);
507 }
508 db_finalize(&q);
509
510 db_prepare(&q, "SELECT mid FROM mlink WHERE pid=%d", fid);
511 while( db_step(&q)==SQLITE_ROW ){
512 int mid = db_column_int(&q, 0);
513 bag_insert(&seen, mid);
514 if( usesFlags & USESFILE_DELETE ){
515
+5 -5
--- src/diff.c
+++ src/diff.c
@@ -2459,13 +2459,13 @@
24592459
**
24602460
** Output the text of a file with markings to show when each line of
24612461
** the file was last modified.
24622462
**
24632463
** Options:
2464
-** --limit N Only look backwards in time by N versions
2465
-** --log List all versions analyzed
24662464
** --filevers Show file version numbers rather than check-in versions
2465
+** -l|--log List all versions analyzed
2466
+** -n|--limit N Only look backwards in time by N versions
24672467
**
24682468
** See also: info, finfo, timeline
24692469
*/
24702470
void annotate_cmd(void){
24712471
int fnid; /* Filename ID */
@@ -2474,20 +2474,20 @@
24742474
int cid; /* Checkout ID */
24752475
Blob treename; /* FILENAME translated to canonical form */
24762476
char *zFilename; /* Canonical filename */
24772477
Annotator ann; /* The annotation of the file */
24782478
int i; /* Loop counter */
2479
- const char *zLimit; /* The value to the --limit option */
2479
+ const char *zLimit; /* The value to the -n|--limit option */
24802480
int iLimit; /* How far back in time to look */
24812481
int showLog; /* True to show the log */
24822482
int fileVers; /* Show file version instead of check-in versions */
24832483
int annFlags = 0; /* Flags to control annotation properties */
24842484
2485
- zLimit = find_option("limit",0,1);
2485
+ zLimit = find_option("limit","n",1);
24862486
if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
24872487
iLimit = atoi(zLimit);
2488
- showLog = find_option("log",0,0)!=0;
2488
+ showLog = find_option("log","l",0)!=0;
24892489
fileVers = find_option("filevers",0,0)!=0;
24902490
db_must_be_within_tree();
24912491
if( g.argc<3 ) {
24922492
usage("FILENAME");
24932493
}
24942494
--- src/diff.c
+++ src/diff.c
@@ -2459,13 +2459,13 @@
2459 **
2460 ** Output the text of a file with markings to show when each line of
2461 ** the file was last modified.
2462 **
2463 ** Options:
2464 ** --limit N Only look backwards in time by N versions
2465 ** --log List all versions analyzed
2466 ** --filevers Show file version numbers rather than check-in versions
 
 
2467 **
2468 ** See also: info, finfo, timeline
2469 */
2470 void annotate_cmd(void){
2471 int fnid; /* Filename ID */
@@ -2474,20 +2474,20 @@
2474 int cid; /* Checkout ID */
2475 Blob treename; /* FILENAME translated to canonical form */
2476 char *zFilename; /* Canonical filename */
2477 Annotator ann; /* The annotation of the file */
2478 int i; /* Loop counter */
2479 const char *zLimit; /* The value to the --limit option */
2480 int iLimit; /* How far back in time to look */
2481 int showLog; /* True to show the log */
2482 int fileVers; /* Show file version instead of check-in versions */
2483 int annFlags = 0; /* Flags to control annotation properties */
2484
2485 zLimit = find_option("limit",0,1);
2486 if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
2487 iLimit = atoi(zLimit);
2488 showLog = find_option("log",0,0)!=0;
2489 fileVers = find_option("filevers",0,0)!=0;
2490 db_must_be_within_tree();
2491 if( g.argc<3 ) {
2492 usage("FILENAME");
2493 }
2494
--- src/diff.c
+++ src/diff.c
@@ -2459,13 +2459,13 @@
2459 **
2460 ** Output the text of a file with markings to show when each line of
2461 ** the file was last modified.
2462 **
2463 ** Options:
 
 
2464 ** --filevers Show file version numbers rather than check-in versions
2465 ** -l|--log List all versions analyzed
2466 ** -n|--limit N Only look backwards in time by N versions
2467 **
2468 ** See also: info, finfo, timeline
2469 */
2470 void annotate_cmd(void){
2471 int fnid; /* Filename ID */
@@ -2474,20 +2474,20 @@
2474 int cid; /* Checkout ID */
2475 Blob treename; /* FILENAME translated to canonical form */
2476 char *zFilename; /* Canonical filename */
2477 Annotator ann; /* The annotation of the file */
2478 int i; /* Loop counter */
2479 const char *zLimit; /* The value to the -n|--limit option */
2480 int iLimit; /* How far back in time to look */
2481 int showLog; /* True to show the log */
2482 int fileVers; /* Show file version instead of check-in versions */
2483 int annFlags = 0; /* Flags to control annotation properties */
2484
2485 zLimit = find_option("limit","n",1);
2486 if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
2487 iLimit = atoi(zLimit);
2488 showLog = find_option("log","l",0)!=0;
2489 fileVers = find_option("filevers",0,0)!=0;
2490 db_must_be_within_tree();
2491 if( g.argc<3 ) {
2492 usage("FILENAME");
2493 }
2494
+8 -8
--- src/finfo.c
+++ src/finfo.c
@@ -27,11 +27,11 @@
2727
**
2828
** Print the complete change history for a single file going backwards
2929
** in time. The default mode is -l.
3030
**
3131
** For the -l|--log mode: If "-b|--brief" is specified one line per revision
32
-** is printed, otherwise the full comment is printed. The "--limit N"
32
+** is printed, otherwise the full comment is printed. The "-n|--limit N"
3333
** and "--offset P" options limits the output to the first N changes
3434
** after skipping P changes.
3535
**
3636
** In the -s mode prints the status as <status> <revision>. This is
3737
** a quick status and does not check for up-to-date-ness of the file.
@@ -39,20 +39,20 @@
3939
** In the -p mode, there's an optional flag "-r|--revision REVISION".
4040
** The specified version (or the latest checked out version) is printed
4141
** to stdout. The -p mode is another form of the "cat" command.
4242
**
4343
** Options:
44
-** --brief|-b display a brief (one line / revision) summary
44
+** -b|--brief display a brief (one line / revision) summary
4545
** --case-sensitive B Enable or disable case-sensitive filenames. B is a
4646
** boolean: "yes", "no", "true", "false", etc.
47
-** --limit N display the first N changes
48
-** --log|-l select log mode (the default)
47
+** -l|--log select log mode (the default)
48
+** -n|--limit N display the first N changes
4949
** --offset P skip P changes
50
-** --print|-p select print mode
51
-** --revision|-r R print the given revision (or ckout, if none is given)
50
+** -p|--print select print mode
51
+** -r|--revision R print the given revision (or ckout, if none is given)
5252
** to stdout (only in print mode)
53
-** --status|-s select status mode (print a status indicator for FILE)
53
+** -s|--status select status mode (print a status indicator for FILE)
5454
**
5555
** See also: artifact, cat, descendants, info, leaves
5656
*/
5757
void finfo_cmd(void){
5858
capture_case_sensitive_option();
@@ -140,11 +140,11 @@
140140
int iLimit, iOffset, iBrief;
141141
142142
if( find_option("log","l",0) ){
143143
/* this is the default, no-op */
144144
}
145
- zLimit = find_option("limit",0,1);
145
+ zLimit = find_option("limit","n",1);
146146
iLimit = zLimit ? atoi(zLimit) : -1;
147147
zOffset = find_option("offset",0,1);
148148
iOffset = zOffset ? atoi(zOffset) : 0;
149149
iBrief = (find_option("brief","b",0) == 0);
150150
if( g.argc!=3 ){
151151
--- src/finfo.c
+++ src/finfo.c
@@ -27,11 +27,11 @@
27 **
28 ** Print the complete change history for a single file going backwards
29 ** in time. The default mode is -l.
30 **
31 ** For the -l|--log mode: If "-b|--brief" is specified one line per revision
32 ** is printed, otherwise the full comment is printed. The "--limit N"
33 ** and "--offset P" options limits the output to the first N changes
34 ** after skipping P changes.
35 **
36 ** In the -s mode prints the status as <status> <revision>. This is
37 ** a quick status and does not check for up-to-date-ness of the file.
@@ -39,20 +39,20 @@
39 ** In the -p mode, there's an optional flag "-r|--revision REVISION".
40 ** The specified version (or the latest checked out version) is printed
41 ** to stdout. The -p mode is another form of the "cat" command.
42 **
43 ** Options:
44 ** --brief|-b display a brief (one line / revision) summary
45 ** --case-sensitive B Enable or disable case-sensitive filenames. B is a
46 ** boolean: "yes", "no", "true", "false", etc.
47 ** --limit N display the first N changes
48 ** --log|-l select log mode (the default)
49 ** --offset P skip P changes
50 ** --print|-p select print mode
51 ** --revision|-r R print the given revision (or ckout, if none is given)
52 ** to stdout (only in print mode)
53 ** --status|-s select status mode (print a status indicator for FILE)
54 **
55 ** See also: artifact, cat, descendants, info, leaves
56 */
57 void finfo_cmd(void){
58 capture_case_sensitive_option();
@@ -140,11 +140,11 @@
140 int iLimit, iOffset, iBrief;
141
142 if( find_option("log","l",0) ){
143 /* this is the default, no-op */
144 }
145 zLimit = find_option("limit",0,1);
146 iLimit = zLimit ? atoi(zLimit) : -1;
147 zOffset = find_option("offset",0,1);
148 iOffset = zOffset ? atoi(zOffset) : 0;
149 iBrief = (find_option("brief","b",0) == 0);
150 if( g.argc!=3 ){
151
--- src/finfo.c
+++ src/finfo.c
@@ -27,11 +27,11 @@
27 **
28 ** Print the complete change history for a single file going backwards
29 ** in time. The default mode is -l.
30 **
31 ** For the -l|--log mode: If "-b|--brief" is specified one line per revision
32 ** is printed, otherwise the full comment is printed. The "-n|--limit N"
33 ** and "--offset P" options limits the output to the first N changes
34 ** after skipping P changes.
35 **
36 ** In the -s mode prints the status as <status> <revision>. This is
37 ** a quick status and does not check for up-to-date-ness of the file.
@@ -39,20 +39,20 @@
39 ** In the -p mode, there's an optional flag "-r|--revision REVISION".
40 ** The specified version (or the latest checked out version) is printed
41 ** to stdout. The -p mode is another form of the "cat" command.
42 **
43 ** Options:
44 ** -b|--brief display a brief (one line / revision) summary
45 ** --case-sensitive B Enable or disable case-sensitive filenames. B is a
46 ** boolean: "yes", "no", "true", "false", etc.
47 ** -l|--log select log mode (the default)
48 ** -n|--limit N display the first N changes
49 ** --offset P skip P changes
50 ** -p|--print select print mode
51 ** -r|--revision R print the given revision (or ckout, if none is given)
52 ** to stdout (only in print mode)
53 ** -s|--status select status mode (print a status indicator for FILE)
54 **
55 ** See also: artifact, cat, descendants, info, leaves
56 */
57 void finfo_cmd(void){
58 capture_case_sensitive_option();
@@ -140,11 +140,11 @@
140 int iLimit, iOffset, iBrief;
141
142 if( find_option("log","l",0) ){
143 /* this is the default, no-op */
144 }
145 zLimit = find_option("limit","n",1);
146 iLimit = zLimit ? atoi(zLimit) : -1;
147 zOffset = find_option("offset",0,1);
148 iOffset = zOffset ? atoi(zOffset) : 0;
149 iBrief = (find_option("brief","b",0) == 0);
150 if( g.argc!=3 ){
151
+8 -8
--- src/main.c
+++ src/main.c
@@ -797,14 +797,14 @@
797797
**
798798
** Display information on how to use COMMAND. To display a list of
799799
** available commands one of:
800800
**
801801
** %fossil help Show common commands
802
-** %fossil help --all Show both common and auxiliary commands
803
-** %fossil help --test Show test commands only
804
-** %fossil help --aux Show auxiliary commands only
805
-** %fossil help --www Show list of WWW pages
802
+** %fossil help --a|-all Show both common and auxiliary commands
803
+** %fossil help --t|-test Show test commands only
804
+** %fossil help --x|-aux Show auxiliary commands only
805
+** %fossil help --w|-www Show list of WWW pages
806806
*/
807807
void help_cmd(void){
808808
int rc, idx, isPage = 0;
809809
const char *z;
810810
char const * zCmdOrPage;
@@ -817,23 +817,23 @@
817817
z, z);
818818
command_list(0, CMDFLAG_1ST_TIER);
819819
version_cmd();
820820
return;
821821
}
822
- if( find_option("all",0,0) ){
822
+ if( find_option("all","a",0) ){
823823
command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
824824
return;
825825
}
826
- else if( find_option("www",0,0) ){
826
+ else if( find_option("www","w",0) ){
827827
command_list(0, CMDFLAG_WEBPAGE);
828828
return;
829829
}
830
- else if( find_option("aux",0,0) ){
830
+ else if( find_option("aux","x",0) ){
831831
command_list(0, CMDFLAG_2ND_TIER);
832832
return;
833833
}
834
- else if( find_option("test",0,0) ){
834
+ else if( find_option("test","t",0) ){
835835
command_list(0, CMDFLAG_TEST);
836836
return;
837837
}
838838
isPage = ('/' == *g.argv[2]) ? 1 : 0;
839839
if(isPage){
840840
--- src/main.c
+++ src/main.c
@@ -797,14 +797,14 @@
797 **
798 ** Display information on how to use COMMAND. To display a list of
799 ** available commands one of:
800 **
801 ** %fossil help Show common commands
802 ** %fossil help --all Show both common and auxiliary commands
803 ** %fossil help --test Show test commands only
804 ** %fossil help --aux Show auxiliary commands only
805 ** %fossil help --www Show list of WWW pages
806 */
807 void help_cmd(void){
808 int rc, idx, isPage = 0;
809 const char *z;
810 char const * zCmdOrPage;
@@ -817,23 +817,23 @@
817 z, z);
818 command_list(0, CMDFLAG_1ST_TIER);
819 version_cmd();
820 return;
821 }
822 if( find_option("all",0,0) ){
823 command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
824 return;
825 }
826 else if( find_option("www",0,0) ){
827 command_list(0, CMDFLAG_WEBPAGE);
828 return;
829 }
830 else if( find_option("aux",0,0) ){
831 command_list(0, CMDFLAG_2ND_TIER);
832 return;
833 }
834 else if( find_option("test",0,0) ){
835 command_list(0, CMDFLAG_TEST);
836 return;
837 }
838 isPage = ('/' == *g.argv[2]) ? 1 : 0;
839 if(isPage){
840
--- src/main.c
+++ src/main.c
@@ -797,14 +797,14 @@
797 **
798 ** Display information on how to use COMMAND. To display a list of
799 ** available commands one of:
800 **
801 ** %fossil help Show common commands
802 ** %fossil help --a|-all Show both common and auxiliary commands
803 ** %fossil help --t|-test Show test commands only
804 ** %fossil help --x|-aux Show auxiliary commands only
805 ** %fossil help --w|-www Show list of WWW pages
806 */
807 void help_cmd(void){
808 int rc, idx, isPage = 0;
809 const char *z;
810 char const * zCmdOrPage;
@@ -817,23 +817,23 @@
817 z, z);
818 command_list(0, CMDFLAG_1ST_TIER);
819 version_cmd();
820 return;
821 }
822 if( find_option("all","a",0) ){
823 command_list(0, CMDFLAG_1ST_TIER | CMDFLAG_2ND_TIER);
824 return;
825 }
826 else if( find_option("www","w",0) ){
827 command_list(0, CMDFLAG_WEBPAGE);
828 return;
829 }
830 else if( find_option("aux","x",0) ){
831 command_list(0, CMDFLAG_2ND_TIER);
832 return;
833 }
834 else if( find_option("test","t",0) ){
835 command_list(0, CMDFLAG_TEST);
836 return;
837 }
838 isPage = ('/' == *g.argv[2]) ? 1 : 0;
839 if(isPage){
840
+13 -12
--- src/stash.c
+++ src/stash.c
@@ -406,22 +406,22 @@
406406
** COMMAND: stash
407407
**
408408
** Usage: %fossil stash SUBCOMMAND ARGS...
409409
**
410410
** fossil stash
411
-** fossil stash save ?-m COMMENT? ?FILES...?
412
-** fossil stash snapshot ?-m COMMENT? ?FILES...?
411
+** fossil stash save ?-m|--comment COMMENT? ?FILES...?
412
+** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
413413
**
414414
** Save the current changes in the working tree as a new stash.
415415
** Then revert the changes back to the last check-in. If FILES
416416
** are listed, then only stash and revert the named files. The
417417
** "save" verb can be omitted if and only if there are no other
418418
** arguments. The "snapshot" verb works the same as "save" but
419419
** omits the revert, keeping the check-out unchanged.
420420
**
421
-** fossil stash list ?--detail?
422
-** fossil stash ls ?-l?
421
+** fossil stash list ?-l|--detail?
422
+** fossil stash ls ?-l|--detail?
423423
**
424424
** List all changes sets currently stashed. Show information about
425425
** individual files in each changeset if --detail or -l is used.
426426
**
427427
** fossil stash show ?STASHID? ?DIFF-FLAGS?
@@ -440,32 +440,33 @@
440440
**
441441
** Update to the baseline checkout for STASHID then apply the
442442
** changes of STASHID. Keep STASHID so that it can be reused
443443
** This command is undoable.
444444
**
445
-** fossil stash drop ?STASHID? ?--all?
446
-** fossil stash rm ?STASHID? ?--all?
445
+** fossil stash drop ?STASHID? ?-a|--all?
446
+** fossil stash rm ?STASHID? ?-a|--all?
447447
**
448448
** Forget everything about STASHID. Forget the whole stash if the
449
-** --all flag is used. Individual drops are undoable but --all is not.
449
+** -a|--all flag is used. Individual drops are undoable but -a|--all
450
+** is not.
450451
**
451452
** fossil stash diff ?STASHID?
452453
** fossil stash gdiff ?STASHID?
453454
**
454455
** Show diffs of the current working directory and what that
455456
** directory would be if STASHID were applied.
456457
**
457458
** SUMMARY:
458459
** fossil stash
459
-** fossil stash save ?-m COMMENT? ?FILES...?
460
-** fossil stash snapshot ?-m COMMENT? ?FILES...?
461
-** fossil stash list|ls ?-l? ?--detail?
460
+** fossil stash save ?-m|--comment COMMENT? ?FILES...?
461
+** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
462
+** fossil stash list|ls ?-l|--detail?
462463
** fossil stash show ?STASHID? ?DIFF-OPTIONS?
463464
** fossil stash pop
464465
** fossil stash apply ?STASHID?
465466
** fossil stash goto ?STASHID?
466
-** fossil stash rm|drop ?STASHID? ?--all?
467
+** fossil stash rm|drop ?STASHID? ?-a|--all?
467468
** fossil stash [g]diff ?STASHID? ?DIFF-OPTIONS?
468469
*/
469470
void stash_cmd(void){
470471
const char *zDb;
471472
const char *zCmd;
@@ -560,11 +561,11 @@
560561
db_finalize(&q);
561562
if( fDetail ) db_finalize(&q2);
562563
if( n==0 ) fossil_print("empty stash\n");
563564
}else
564565
if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
565
- int allFlag = find_option("all", 0, 0)!=0;
566
+ int allFlag = find_option("all", "a", 0)!=0;
566567
if( allFlag ){
567568
Blob ans;
568569
char cReply;
569570
blob_zero(&ans);
570571
prompt_user("This action is not undoable. Continue (y/N)? ", &ans);
571572
--- src/stash.c
+++ src/stash.c
@@ -406,22 +406,22 @@
406 ** COMMAND: stash
407 **
408 ** Usage: %fossil stash SUBCOMMAND ARGS...
409 **
410 ** fossil stash
411 ** fossil stash save ?-m COMMENT? ?FILES...?
412 ** fossil stash snapshot ?-m COMMENT? ?FILES...?
413 **
414 ** Save the current changes in the working tree as a new stash.
415 ** Then revert the changes back to the last check-in. If FILES
416 ** are listed, then only stash and revert the named files. The
417 ** "save" verb can be omitted if and only if there are no other
418 ** arguments. The "snapshot" verb works the same as "save" but
419 ** omits the revert, keeping the check-out unchanged.
420 **
421 ** fossil stash list ?--detail?
422 ** fossil stash ls ?-l?
423 **
424 ** List all changes sets currently stashed. Show information about
425 ** individual files in each changeset if --detail or -l is used.
426 **
427 ** fossil stash show ?STASHID? ?DIFF-FLAGS?
@@ -440,32 +440,33 @@
440 **
441 ** Update to the baseline checkout for STASHID then apply the
442 ** changes of STASHID. Keep STASHID so that it can be reused
443 ** This command is undoable.
444 **
445 ** fossil stash drop ?STASHID? ?--all?
446 ** fossil stash rm ?STASHID? ?--all?
447 **
448 ** Forget everything about STASHID. Forget the whole stash if the
449 ** --all flag is used. Individual drops are undoable but --all is not.
 
450 **
451 ** fossil stash diff ?STASHID?
452 ** fossil stash gdiff ?STASHID?
453 **
454 ** Show diffs of the current working directory and what that
455 ** directory would be if STASHID were applied.
456 **
457 ** SUMMARY:
458 ** fossil stash
459 ** fossil stash save ?-m COMMENT? ?FILES...?
460 ** fossil stash snapshot ?-m COMMENT? ?FILES...?
461 ** fossil stash list|ls ?-l? ?--detail?
462 ** fossil stash show ?STASHID? ?DIFF-OPTIONS?
463 ** fossil stash pop
464 ** fossil stash apply ?STASHID?
465 ** fossil stash goto ?STASHID?
466 ** fossil stash rm|drop ?STASHID? ?--all?
467 ** fossil stash [g]diff ?STASHID? ?DIFF-OPTIONS?
468 */
469 void stash_cmd(void){
470 const char *zDb;
471 const char *zCmd;
@@ -560,11 +561,11 @@
560 db_finalize(&q);
561 if( fDetail ) db_finalize(&q2);
562 if( n==0 ) fossil_print("empty stash\n");
563 }else
564 if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
565 int allFlag = find_option("all", 0, 0)!=0;
566 if( allFlag ){
567 Blob ans;
568 char cReply;
569 blob_zero(&ans);
570 prompt_user("This action is not undoable. Continue (y/N)? ", &ans);
571
--- src/stash.c
+++ src/stash.c
@@ -406,22 +406,22 @@
406 ** COMMAND: stash
407 **
408 ** Usage: %fossil stash SUBCOMMAND ARGS...
409 **
410 ** fossil stash
411 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
412 ** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
413 **
414 ** Save the current changes in the working tree as a new stash.
415 ** Then revert the changes back to the last check-in. If FILES
416 ** are listed, then only stash and revert the named files. The
417 ** "save" verb can be omitted if and only if there are no other
418 ** arguments. The "snapshot" verb works the same as "save" but
419 ** omits the revert, keeping the check-out unchanged.
420 **
421 ** fossil stash list ?-l|--detail?
422 ** fossil stash ls ?-l|--detail?
423 **
424 ** List all changes sets currently stashed. Show information about
425 ** individual files in each changeset if --detail or -l is used.
426 **
427 ** fossil stash show ?STASHID? ?DIFF-FLAGS?
@@ -440,32 +440,33 @@
440 **
441 ** Update to the baseline checkout for STASHID then apply the
442 ** changes of STASHID. Keep STASHID so that it can be reused
443 ** This command is undoable.
444 **
445 ** fossil stash drop ?STASHID? ?-a|--all?
446 ** fossil stash rm ?STASHID? ?-a|--all?
447 **
448 ** Forget everything about STASHID. Forget the whole stash if the
449 ** -a|--all flag is used. Individual drops are undoable but -a|--all
450 ** is not.
451 **
452 ** fossil stash diff ?STASHID?
453 ** fossil stash gdiff ?STASHID?
454 **
455 ** Show diffs of the current working directory and what that
456 ** directory would be if STASHID were applied.
457 **
458 ** SUMMARY:
459 ** fossil stash
460 ** fossil stash save ?-m|--comment COMMENT? ?FILES...?
461 ** fossil stash snapshot ?-m|--comment COMMENT? ?FILES...?
462 ** fossil stash list|ls ?-l|--detail?
463 ** fossil stash show ?STASHID? ?DIFF-OPTIONS?
464 ** fossil stash pop
465 ** fossil stash apply ?STASHID?
466 ** fossil stash goto ?STASHID?
467 ** fossil stash rm|drop ?STASHID? ?-a|--all?
468 ** fossil stash [g]diff ?STASHID? ?DIFF-OPTIONS?
469 */
470 void stash_cmd(void){
471 const char *zDb;
472 const char *zCmd;
@@ -560,11 +561,11 @@
561 db_finalize(&q);
562 if( fDetail ) db_finalize(&q2);
563 if( n==0 ) fossil_print("empty stash\n");
564 }else
565 if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
566 int allFlag = find_option("all", "a", 0)!=0;
567 if( allFlag ){
568 Blob ans;
569 char cReply;
570 blob_zero(&ans);
571 prompt_user("This action is not undoable. Continue (y/N)? ", &ans);
572
+23 -22
--- src/timeline.c
+++ src/timeline.c
@@ -453,11 +453,11 @@
453453
if( (tmFlags & TIMELINE_FRENAMES)!=0 ){
454454
if( !isNew && !isDel && zOldName!=0 ){
455455
@ <li> %h(zOldName) &rarr; %h(zFilename)
456456
}
457457
continue;
458
- }
458
+ }
459459
if( isNew ){
460460
@ <li> %h(zFilename) (new file) &nbsp;
461461
@ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew))
462462
@ [view]</a></li>
463463
}else if( isDel ){
@@ -1533,11 +1533,11 @@
15331533
@ event.mtime AS mtime,
15341534
@ tagxref.value AS branch
15351535
@ FROM tag CROSS JOIN event CROSS JOIN blob
15361536
@ LEFT JOIN tagxref ON tagxref.tagid=tag.tagid
15371537
@ AND tagxref.tagtype>0
1538
- @ AND tagxref.rid=blob.rid
1538
+ @ AND tagxref.rid=blob.rid
15391539
@ WHERE blob.rid=event.objid
15401540
@ AND tag.tagname='branch'
15411541
;
15421542
return zBaseSql;
15431543
}
@@ -1555,17 +1555,16 @@
15551555
}
15561556
15571557
/*
15581558
** COMMAND: timeline
15591559
**
1560
-** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?-n|--count N? ?-t|--type TYPE? ?-showfiles?
1560
+** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?OPTIONS?
15611561
**
15621562
** Print a summary of activity going backwards in date and time
15631563
** specified or from the current date and time if no arguments
1564
-** are given. Show as many as N (default 20) check-ins. The
1565
-** WHEN argument can be any unique abbreviation of one of these
1566
-** keywords:
1564
+** are given. The WHEN argument can be any unique abbreviation
1565
+** of one of these keywords:
15671566
**
15681567
** before
15691568
** after
15701569
** descendants | children
15711570
** ancestors | parents
@@ -1573,25 +1572,24 @@
15731572
** The BASELINE can be any unique prefix of 4 characters or more.
15741573
** The DATETIME should be in the ISO8601 format. For
15751574
** examples: "2007-08-18 07:21:21". You can also say "current"
15761575
** for the current version or "now" for the current time.
15771576
**
1578
-** The optional TYPE argument may any types supported by the /timeline
1579
-** page. For example:
1580
-**
1581
-** w = wiki commits only
1582
-** ci = file commits only
1583
-** t = tickets only
1584
-**
1585
-** The optional showfiles argument, if specified, prints the list of
1586
-** files changed in a checkin after the checkin comment.
1587
-**
1577
+** Options:
1578
+** -f|--showfiles print the list of files changed in a checkin after
1579
+** the checkin comment.
1580
+** -n|--limit N display the first N changes (default 20)
1581
+** -t|--type TYPE only display items from the give types, such as:
1582
+** ci = file commits only
1583
+** e = events only
1584
+** t = tickets only
1585
+** w = wiki commits only
15881586
*/
15891587
void timeline_cmd(void){
15901588
Stmt q;
15911589
int n, k;
1592
- const char *zCount;
1590
+ const char *zLimit;
15931591
const char *zType;
15941592
char *zOrigin;
15951593
char *zDate;
15961594
Blob sql;
15971595
int objid = 0;
@@ -1598,14 +1596,17 @@
15981596
Blob uuid;
15991597
int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
16001598
int showfilesFlag = 0 ;
16011599
showfilesFlag = find_option("showfiles","f", 0)!=0;
16021600
db_find_and_open_repository(0, 0);
1603
- zCount = find_option("count","n",1);
1601
+ zLimit = find_option("limit","n",1);
16041602
zType = find_option("type","t",1);
1605
- if( zCount ){
1606
- n = atoi(zCount);
1603
+ if ( !zLimit ){
1604
+ zLimit = find_option("count",0,1);
1605
+ }
1606
+ if( zLimit ){
1607
+ n = atoi(zLimit);
16071608
}else{
16081609
n = 20;
16091610
}
16101611
if( g.argc>=4 ){
16111612
k = strlen(g.argv[2]);
@@ -1619,12 +1620,12 @@
16191620
mode = 3;
16201621
}else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
16211622
mode = 4;
16221623
}else if( strncmp(g.argv[2],"parents",k)==0 ){
16231624
mode = 4;
1624
- }else if(!zType && !zCount){
1625
- usage("?WHEN? ?BASELINE|DATETIME? ?-n|--count N? ?-t|--type TYPE?");
1625
+ }else if(!zType && !zLimit){
1626
+ usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE?");
16261627
}
16271628
if( '-' != *g.argv[3] ){
16281629
zOrigin = g.argv[3];
16291630
}else{
16301631
zOrigin = "now";
16311632
--- src/timeline.c
+++ src/timeline.c
@@ -453,11 +453,11 @@
453 if( (tmFlags & TIMELINE_FRENAMES)!=0 ){
454 if( !isNew && !isDel && zOldName!=0 ){
455 @ <li> %h(zOldName) &rarr; %h(zFilename)
456 }
457 continue;
458 }
459 if( isNew ){
460 @ <li> %h(zFilename) (new file) &nbsp;
461 @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew))
462 @ [view]</a></li>
463 }else if( isDel ){
@@ -1533,11 +1533,11 @@
1533 @ event.mtime AS mtime,
1534 @ tagxref.value AS branch
1535 @ FROM tag CROSS JOIN event CROSS JOIN blob
1536 @ LEFT JOIN tagxref ON tagxref.tagid=tag.tagid
1537 @ AND tagxref.tagtype>0
1538 @ AND tagxref.rid=blob.rid
1539 @ WHERE blob.rid=event.objid
1540 @ AND tag.tagname='branch'
1541 ;
1542 return zBaseSql;
1543 }
@@ -1555,17 +1555,16 @@
1555 }
1556
1557 /*
1558 ** COMMAND: timeline
1559 **
1560 ** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?-n|--count N? ?-t|--type TYPE? ?-showfiles?
1561 **
1562 ** Print a summary of activity going backwards in date and time
1563 ** specified or from the current date and time if no arguments
1564 ** are given. Show as many as N (default 20) check-ins. The
1565 ** WHEN argument can be any unique abbreviation of one of these
1566 ** keywords:
1567 **
1568 ** before
1569 ** after
1570 ** descendants | children
1571 ** ancestors | parents
@@ -1573,25 +1572,24 @@
1573 ** The BASELINE can be any unique prefix of 4 characters or more.
1574 ** The DATETIME should be in the ISO8601 format. For
1575 ** examples: "2007-08-18 07:21:21". You can also say "current"
1576 ** for the current version or "now" for the current time.
1577 **
1578 ** The optional TYPE argument may any types supported by the /timeline
1579 ** page. For example:
1580 **
1581 ** w = wiki commits only
1582 ** ci = file commits only
1583 ** t = tickets only
1584 **
1585 ** The optional showfiles argument, if specified, prints the list of
1586 ** files changed in a checkin after the checkin comment.
1587 **
1588 */
1589 void timeline_cmd(void){
1590 Stmt q;
1591 int n, k;
1592 const char *zCount;
1593 const char *zType;
1594 char *zOrigin;
1595 char *zDate;
1596 Blob sql;
1597 int objid = 0;
@@ -1598,14 +1596,17 @@
1598 Blob uuid;
1599 int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
1600 int showfilesFlag = 0 ;
1601 showfilesFlag = find_option("showfiles","f", 0)!=0;
1602 db_find_and_open_repository(0, 0);
1603 zCount = find_option("count","n",1);
1604 zType = find_option("type","t",1);
1605 if( zCount ){
1606 n = atoi(zCount);
 
 
 
1607 }else{
1608 n = 20;
1609 }
1610 if( g.argc>=4 ){
1611 k = strlen(g.argv[2]);
@@ -1619,12 +1620,12 @@
1619 mode = 3;
1620 }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
1621 mode = 4;
1622 }else if( strncmp(g.argv[2],"parents",k)==0 ){
1623 mode = 4;
1624 }else if(!zType && !zCount){
1625 usage("?WHEN? ?BASELINE|DATETIME? ?-n|--count N? ?-t|--type TYPE?");
1626 }
1627 if( '-' != *g.argv[3] ){
1628 zOrigin = g.argv[3];
1629 }else{
1630 zOrigin = "now";
1631
--- src/timeline.c
+++ src/timeline.c
@@ -453,11 +453,11 @@
453 if( (tmFlags & TIMELINE_FRENAMES)!=0 ){
454 if( !isNew && !isDel && zOldName!=0 ){
455 @ <li> %h(zOldName) &rarr; %h(zFilename)
456 }
457 continue;
458 }
459 if( isNew ){
460 @ <li> %h(zFilename) (new file) &nbsp;
461 @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew))
462 @ [view]</a></li>
463 }else if( isDel ){
@@ -1533,11 +1533,11 @@
1533 @ event.mtime AS mtime,
1534 @ tagxref.value AS branch
1535 @ FROM tag CROSS JOIN event CROSS JOIN blob
1536 @ LEFT JOIN tagxref ON tagxref.tagid=tag.tagid
1537 @ AND tagxref.tagtype>0
1538 @ AND tagxref.rid=blob.rid
1539 @ WHERE blob.rid=event.objid
1540 @ AND tag.tagname='branch'
1541 ;
1542 return zBaseSql;
1543 }
@@ -1555,17 +1555,16 @@
1555 }
1556
1557 /*
1558 ** COMMAND: timeline
1559 **
1560 ** Usage: %fossil timeline ?WHEN? ?BASELINE|DATETIME? ?OPTIONS?
1561 **
1562 ** Print a summary of activity going backwards in date and time
1563 ** specified or from the current date and time if no arguments
1564 ** are given. The WHEN argument can be any unique abbreviation
1565 ** of one of these keywords:
 
1566 **
1567 ** before
1568 ** after
1569 ** descendants | children
1570 ** ancestors | parents
@@ -1573,25 +1572,24 @@
1572 ** The BASELINE can be any unique prefix of 4 characters or more.
1573 ** The DATETIME should be in the ISO8601 format. For
1574 ** examples: "2007-08-18 07:21:21". You can also say "current"
1575 ** for the current version or "now" for the current time.
1576 **
1577 ** Options:
1578 ** -f|--showfiles print the list of files changed in a checkin after
1579 ** the checkin comment.
1580 ** -n|--limit N display the first N changes (default 20)
1581 ** -t|--type TYPE only display items from the give types, such as:
1582 ** ci = file commits only
1583 ** e = events only
1584 ** t = tickets only
1585 ** w = wiki commits only
 
1586 */
1587 void timeline_cmd(void){
1588 Stmt q;
1589 int n, k;
1590 const char *zLimit;
1591 const char *zType;
1592 char *zOrigin;
1593 char *zDate;
1594 Blob sql;
1595 int objid = 0;
@@ -1598,14 +1596,17 @@
1596 Blob uuid;
1597 int mode = 0 ; /* 0:none 1: before 2:after 3:children 4:parents */
1598 int showfilesFlag = 0 ;
1599 showfilesFlag = find_option("showfiles","f", 0)!=0;
1600 db_find_and_open_repository(0, 0);
1601 zLimit = find_option("limit","n",1);
1602 zType = find_option("type","t",1);
1603 if ( !zLimit ){
1604 zLimit = find_option("count",0,1);
1605 }
1606 if( zLimit ){
1607 n = atoi(zLimit);
1608 }else{
1609 n = 20;
1610 }
1611 if( g.argc>=4 ){
1612 k = strlen(g.argv[2]);
@@ -1619,12 +1620,12 @@
1620 mode = 3;
1621 }else if( strncmp(g.argv[2],"ancestors",k)==0 && k>1 ){
1622 mode = 4;
1623 }else if( strncmp(g.argv[2],"parents",k)==0 ){
1624 mode = 4;
1625 }else if(!zType && !zLimit){
1626 usage("?WHEN? ?BASELINE|DATETIME? ?-n|--limit N? ?-t|--type TYPE?");
1627 }
1628 if( '-' != *g.argv[3] ){
1629 zOrigin = g.argv[3];
1630 }else{
1631 zOrigin = "now";
1632

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button