Fossil SCM

Rename "--limit" to "--count" and "--test" to "--nochange" in some fossil commands

jan.nijtmans 2013-04-19 07:55 trunk
Commit e72af5058edcafd4d198817f56c1341e9b1ba992
+8 -4
--- src/add.c
+++ src/add.c
@@ -456,26 +456,30 @@
456456
** Options:
457457
** --case-sensitive <BOOL> override case-sensitive setting
458458
** --dotfiles include files beginning with a dot (".")
459459
** --ignore <CSG> ignore files matching patterns from the
460460
** comma separated list of glob patterns.
461
-** --test If given, display instead of run actions
461
+** --nochange|-n If given, display instead of run actions
462462
**
463463
** See also: add, rm
464464
*/
465465
void addremove_cmd(void){
466466
Blob path;
467467
const char *zIgnoreFlag = find_option("ignore",0,1);
468468
unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
469
- int isTest = find_option("test",0,0)!=0;
469
+ int nochangeFlag = find_option("nochange","n",0)!=0;
470470
int n;
471471
Stmt q;
472472
int vid;
473473
int nAdd = 0;
474474
int nDelete = 0;
475475
Glob *pIgnore;
476476
477
+ if( !nochangeFlag ){
478
+ /* --test is deprecated */
479
+ nochangeFlag = find_option("test",0,0)!=0;
480
+ }
477481
capture_case_sensitive_option();
478482
db_must_be_within_tree();
479483
if( zIgnoreFlag==0 ){
480484
zIgnoreFlag = db_get("ignore-glob", 0);
481485
}
@@ -512,11 +516,11 @@
512516
const char * zPath;
513517
514518
zFile = db_column_text(&q, 0);
515519
zPath = db_column_text(&q, 1);
516520
if( !file_wd_isfile_or_link(zPath) ){
517
- if( !isTest ){
521
+ if( !nochangeFlag ){
518522
db_multi_exec("UPDATE vfile SET deleted=1 WHERE pathname=%Q", zFile);
519523
}
520524
fossil_print("DELETED %s\n", zFile);
521525
nDelete++;
522526
}
@@ -523,11 +527,11 @@
523527
}
524528
db_finalize(&q);
525529
/* show command summary */
526530
fossil_print("added %d files, deleted %d files\n", nAdd, nDelete);
527531
528
- db_end_transaction(isTest);
532
+ db_end_transaction(nochangeFlag);
529533
}
530534
531535
532536
/*
533537
** Rename a single file.
534538
--- src/add.c
+++ src/add.c
@@ -456,26 +456,30 @@
456 ** Options:
457 ** --case-sensitive <BOOL> override case-sensitive setting
458 ** --dotfiles include files beginning with a dot (".")
459 ** --ignore <CSG> ignore files matching patterns from the
460 ** comma separated list of glob patterns.
461 ** --test If given, display instead of run actions
462 **
463 ** See also: add, rm
464 */
465 void addremove_cmd(void){
466 Blob path;
467 const char *zIgnoreFlag = find_option("ignore",0,1);
468 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
469 int isTest = find_option("test",0,0)!=0;
470 int n;
471 Stmt q;
472 int vid;
473 int nAdd = 0;
474 int nDelete = 0;
475 Glob *pIgnore;
476
 
 
 
 
477 capture_case_sensitive_option();
478 db_must_be_within_tree();
479 if( zIgnoreFlag==0 ){
480 zIgnoreFlag = db_get("ignore-glob", 0);
481 }
@@ -512,11 +516,11 @@
512 const char * zPath;
513
514 zFile = db_column_text(&q, 0);
515 zPath = db_column_text(&q, 1);
516 if( !file_wd_isfile_or_link(zPath) ){
517 if( !isTest ){
518 db_multi_exec("UPDATE vfile SET deleted=1 WHERE pathname=%Q", zFile);
519 }
520 fossil_print("DELETED %s\n", zFile);
521 nDelete++;
522 }
@@ -523,11 +527,11 @@
523 }
524 db_finalize(&q);
525 /* show command summary */
526 fossil_print("added %d files, deleted %d files\n", nAdd, nDelete);
527
528 db_end_transaction(isTest);
529 }
530
531
532 /*
533 ** Rename a single file.
534
--- src/add.c
+++ src/add.c
@@ -456,26 +456,30 @@
456 ** Options:
457 ** --case-sensitive <BOOL> override case-sensitive setting
458 ** --dotfiles include files beginning with a dot (".")
459 ** --ignore <CSG> ignore files matching patterns from the
460 ** comma separated list of glob patterns.
461 ** --nochange|-n If given, display instead of run actions
462 **
463 ** See also: add, rm
464 */
465 void addremove_cmd(void){
466 Blob path;
467 const char *zIgnoreFlag = find_option("ignore",0,1);
468 unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0;
469 int nochangeFlag = find_option("nochange","n",0)!=0;
470 int n;
471 Stmt q;
472 int vid;
473 int nAdd = 0;
474 int nDelete = 0;
475 Glob *pIgnore;
476
477 if( !nochangeFlag ){
478 /* --test is deprecated */
479 nochangeFlag = find_option("test",0,0)!=0;
480 }
481 capture_case_sensitive_option();
482 db_must_be_within_tree();
483 if( zIgnoreFlag==0 ){
484 zIgnoreFlag = db_get("ignore-glob", 0);
485 }
@@ -512,11 +516,11 @@
516 const char * zPath;
517
518 zFile = db_column_text(&q, 0);
519 zPath = db_column_text(&q, 1);
520 if( !file_wd_isfile_or_link(zPath) ){
521 if( !nochangeFlag ){
522 db_multi_exec("UPDATE vfile SET deleted=1 WHERE pathname=%Q", zFile);
523 }
524 fossil_print("DELETED %s\n", zFile);
525 nDelete++;
526 }
@@ -523,11 +527,11 @@
527 }
528 db_finalize(&q);
529 /* show command summary */
530 fossil_print("added %d files, deleted %d files\n", nAdd, nDelete);
531
532 db_end_transaction(nochangeFlag);
533 }
534
535
536 /*
537 ** Rename a single file.
538
+7 -7
--- src/allrepo.c
+++ src/allrepo.c
@@ -109,20 +109,20 @@
109109
char *zFossil;
110110
char *zQFilename;
111111
Blob extra;
112112
int useCheckouts = 0;
113113
int quiet = 0;
114
- int testRun = 0;
114
+ int nochangeFlag = 0;
115115
int stopOnError = find_option("dontstop",0,0)==0;
116116
int rc;
117117
Bag outOfDate;
118118
119
- /* The undocumented --test option causes no changes to occur to any
119
+ /* The undocumented --nochange option causes no changes to occur to any
120120
** repository, but instead show what would have happened. Intended for
121121
** test and debugging use.
122122
*/
123
- testRun = find_option("test",0,0)!=0;
123
+ nochangeFlag = find_option("nochange","n",0)!=0;
124124
125125
if( g.argc<3 ){
126126
usage("changes|list|ls|pull|push|rebuild|sync");
127127
}
128128
n = strlen(g.argv[2]);
@@ -169,11 +169,11 @@
169169
verify_all_options();
170170
db_begin_transaction();
171171
for(j=3; j<g.argc; j++){
172172
char *zSql = mprintf("DELETE FROM global_config"
173173
" WHERE name GLOB 'repo:%q'", g.argv[j]);
174
- if( testRun ){
174
+ if( nochangeFlag ){
175175
fossil_print("%s\n", zSql);
176176
}else{
177177
db_multi_exec("%s", zSql);
178178
}
179179
fossil_free(zSql);
@@ -218,15 +218,15 @@
218218
continue;
219219
}
220220
zQFilename = quoteFilename(zFilename);
221221
zSyscmd = mprintf("%s %s %s%s",
222222
zFossil, zCmd, zQFilename, blob_str(&extra));
223
- if( !quiet || testRun ){
223
+ if( !quiet || nochangeFlag ){
224224
fossil_print("%s\n", zSyscmd);
225225
fflush(stdout);
226226
}
227
- rc = testRun ? 0 : fossil_system(zSyscmd);
227
+ rc = nochangeFlag ? 0 : fossil_system(zSyscmd);
228228
free(zSyscmd);
229229
free(zQFilename);
230230
if( stopOnError && rc ){
231231
break;
232232
}
@@ -245,13 +245,13 @@
245245
for(rowid=bag_first(&outOfDate); rowid>0; rowid=bag_next(&outOfDate,rowid)){
246246
blob_appendf(&sql, "%s%d", zSep, rowid);
247247
zSep = ",";
248248
}
249249
blob_appendf(&sql, ")");
250
- if( testRun ){
250
+ if( nochangeFlag ){
251251
fossil_print("%s\n", blob_str(&sql));
252252
}else{
253253
db_multi_exec(blob_str(&sql));
254254
}
255255
blob_reset(&sql);
256256
}
257257
}
258258
--- src/allrepo.c
+++ src/allrepo.c
@@ -109,20 +109,20 @@
109 char *zFossil;
110 char *zQFilename;
111 Blob extra;
112 int useCheckouts = 0;
113 int quiet = 0;
114 int testRun = 0;
115 int stopOnError = find_option("dontstop",0,0)==0;
116 int rc;
117 Bag outOfDate;
118
119 /* The undocumented --test option causes no changes to occur to any
120 ** repository, but instead show what would have happened. Intended for
121 ** test and debugging use.
122 */
123 testRun = find_option("test",0,0)!=0;
124
125 if( g.argc<3 ){
126 usage("changes|list|ls|pull|push|rebuild|sync");
127 }
128 n = strlen(g.argv[2]);
@@ -169,11 +169,11 @@
169 verify_all_options();
170 db_begin_transaction();
171 for(j=3; j<g.argc; j++){
172 char *zSql = mprintf("DELETE FROM global_config"
173 " WHERE name GLOB 'repo:%q'", g.argv[j]);
174 if( testRun ){
175 fossil_print("%s\n", zSql);
176 }else{
177 db_multi_exec("%s", zSql);
178 }
179 fossil_free(zSql);
@@ -218,15 +218,15 @@
218 continue;
219 }
220 zQFilename = quoteFilename(zFilename);
221 zSyscmd = mprintf("%s %s %s%s",
222 zFossil, zCmd, zQFilename, blob_str(&extra));
223 if( !quiet || testRun ){
224 fossil_print("%s\n", zSyscmd);
225 fflush(stdout);
226 }
227 rc = testRun ? 0 : fossil_system(zSyscmd);
228 free(zSyscmd);
229 free(zQFilename);
230 if( stopOnError && rc ){
231 break;
232 }
@@ -245,13 +245,13 @@
245 for(rowid=bag_first(&outOfDate); rowid>0; rowid=bag_next(&outOfDate,rowid)){
246 blob_appendf(&sql, "%s%d", zSep, rowid);
247 zSep = ",";
248 }
249 blob_appendf(&sql, ")");
250 if( testRun ){
251 fossil_print("%s\n", blob_str(&sql));
252 }else{
253 db_multi_exec(blob_str(&sql));
254 }
255 blob_reset(&sql);
256 }
257 }
258
--- src/allrepo.c
+++ src/allrepo.c
@@ -109,20 +109,20 @@
109 char *zFossil;
110 char *zQFilename;
111 Blob extra;
112 int useCheckouts = 0;
113 int quiet = 0;
114 int nochangeFlag = 0;
115 int stopOnError = find_option("dontstop",0,0)==0;
116 int rc;
117 Bag outOfDate;
118
119 /* The undocumented --nochange option causes no changes to occur to any
120 ** repository, but instead show what would have happened. Intended for
121 ** test and debugging use.
122 */
123 nochangeFlag = find_option("nochange","n",0)!=0;
124
125 if( g.argc<3 ){
126 usage("changes|list|ls|pull|push|rebuild|sync");
127 }
128 n = strlen(g.argv[2]);
@@ -169,11 +169,11 @@
169 verify_all_options();
170 db_begin_transaction();
171 for(j=3; j<g.argc; j++){
172 char *zSql = mprintf("DELETE FROM global_config"
173 " WHERE name GLOB 'repo:%q'", g.argv[j]);
174 if( nochangeFlag ){
175 fossil_print("%s\n", zSql);
176 }else{
177 db_multi_exec("%s", zSql);
178 }
179 fossil_free(zSql);
@@ -218,15 +218,15 @@
218 continue;
219 }
220 zQFilename = quoteFilename(zFilename);
221 zSyscmd = mprintf("%s %s %s%s",
222 zFossil, zCmd, zQFilename, blob_str(&extra));
223 if( !quiet || nochangeFlag ){
224 fossil_print("%s\n", zSyscmd);
225 fflush(stdout);
226 }
227 rc = nochangeFlag ? 0 : fossil_system(zSyscmd);
228 free(zSyscmd);
229 free(zQFilename);
230 if( stopOnError && rc ){
231 break;
232 }
@@ -245,13 +245,13 @@
245 for(rowid=bag_first(&outOfDate); rowid>0; rowid=bag_next(&outOfDate,rowid)){
246 blob_appendf(&sql, "%s%d", zSep, rowid);
247 zSep = ",";
248 }
249 blob_appendf(&sql, ")");
250 if( nochangeFlag ){
251 fossil_print("%s\n", blob_str(&sql));
252 }else{
253 db_multi_exec(blob_str(&sql));
254 }
255 blob_reset(&sql);
256 }
257 }
258
+7 -7
--- src/checkin.c
+++ src/checkin.c
@@ -410,17 +410,17 @@
410410
const char *zIgnoreFlag;
411411
Blob path, repo;
412412
Stmt q;
413413
int n;
414414
Glob *pIgnore;
415
- int testFlag = 0;
415
+ int nochangeFlag = 0;
416416
417417
allFlag = find_option("force","f",0)!=0;
418418
if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
419419
if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
420420
zIgnoreFlag = find_option("ignore",0,1);
421
- testFlag = find_option("test",0,0)!=0;
421
+ nochangeFlag = find_option("nochange","n",0)!=0;
422422
capture_case_sensitive_option();
423423
db_must_be_within_tree();
424424
if( zIgnoreFlag==0 ){
425425
zIgnoreFlag = db_get("ignore-glob", 0);
426426
}
@@ -440,11 +440,11 @@
440440
if( file_tree_name(g.zRepositoryName, &repo, 0) ){
441441
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
442442
}
443443
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
444444
while( db_step(&q)==SQLITE_ROW ){
445
- if( testFlag ){
445
+ if( nochangeFlag ){
446446
fossil_print("%s\n", db_column_text(&q,0));
447447
continue;
448448
}else if( !allFlag ){
449449
Blob ans;
450450
char cReply;
@@ -1154,11 +1154,11 @@
11541154
int allowFork = 0; /* Allow the commit to fork */
11551155
int allowOlder = 0; /* Allow a commit older than its ancestor */
11561156
char *zManifestFile; /* Name of the manifest file */
11571157
int useCksum; /* True if checksums should be computed and verified */
11581158
int outputManifest; /* True to output "manifest" and "manifest.uuid" */
1159
- int testRun; /* True for a test run. Debugging only */
1159
+ int nochangeFlag; /* True for a test run. Debugging only */
11601160
CheckinInfo sCiInfo; /* Information about this check-in */
11611161
const char *zComFile; /* Read commit message from this file */
11621162
int nTag = 0; /* Number of --tag arguments */
11631163
const char *zTag; /* A single --tag argument */
11641164
Blob manifest; /* Manifest in baseline form */
@@ -1178,11 +1178,11 @@
11781178
forceDelta = find_option("delta",0,0)!=0;
11791179
forceBaseline = find_option("baseline",0,0)!=0;
11801180
if( forceDelta && forceBaseline ){
11811181
fossil_fatal("cannot use --delta and --baseline together");
11821182
}
1183
- testRun = find_option("test",0,0)!=0;
1183
+ nochangeFlag = find_option("nochange","n",0)!=0;
11841184
zComment = find_option("comment","m",1);
11851185
forceFlag = find_option("force", "f", 0)!=0;
11861186
allowConflict = find_option("allow-conflict",0,0)!=0;
11871187
allowEmpty = find_option("allow-empty",0,0)!=0;
11881188
allowFork = find_option("allow-fork",0,0)!=0;
@@ -1522,11 +1522,11 @@
15221522
}
15231523
15241524
/* If the --test option is specified, output the manifest file
15251525
** and rollback the transaction.
15261526
*/
1527
- if( testRun ){
1527
+ if( nochangeFlag ){
15281528
blob_write_to_file(&manifest, "");
15291529
}
15301530
15311531
if( outputManifest ){
15321532
zManifestFile = mprintf("%smanifest", g.zLocalRoot);
@@ -1601,11 +1601,11 @@
16011601
/* Clear the undo/redo stack */
16021602
undo_reset();
16031603
16041604
/* Commit */
16051605
db_multi_exec("DELETE FROM vvar WHERE name='ci-comment'");
1606
- if( testRun ){
1606
+ if( nochangeFlag ){
16071607
db_end_transaction(1);
16081608
exit(1);
16091609
}
16101610
db_end_transaction(0);
16111611
16121612
--- src/checkin.c
+++ src/checkin.c
@@ -410,17 +410,17 @@
410 const char *zIgnoreFlag;
411 Blob path, repo;
412 Stmt q;
413 int n;
414 Glob *pIgnore;
415 int testFlag = 0;
416
417 allFlag = find_option("force","f",0)!=0;
418 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
419 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
420 zIgnoreFlag = find_option("ignore",0,1);
421 testFlag = find_option("test",0,0)!=0;
422 capture_case_sensitive_option();
423 db_must_be_within_tree();
424 if( zIgnoreFlag==0 ){
425 zIgnoreFlag = db_get("ignore-glob", 0);
426 }
@@ -440,11 +440,11 @@
440 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
441 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
442 }
443 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
444 while( db_step(&q)==SQLITE_ROW ){
445 if( testFlag ){
446 fossil_print("%s\n", db_column_text(&q,0));
447 continue;
448 }else if( !allFlag ){
449 Blob ans;
450 char cReply;
@@ -1154,11 +1154,11 @@
1154 int allowFork = 0; /* Allow the commit to fork */
1155 int allowOlder = 0; /* Allow a commit older than its ancestor */
1156 char *zManifestFile; /* Name of the manifest file */
1157 int useCksum; /* True if checksums should be computed and verified */
1158 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
1159 int testRun; /* True for a test run. Debugging only */
1160 CheckinInfo sCiInfo; /* Information about this check-in */
1161 const char *zComFile; /* Read commit message from this file */
1162 int nTag = 0; /* Number of --tag arguments */
1163 const char *zTag; /* A single --tag argument */
1164 Blob manifest; /* Manifest in baseline form */
@@ -1178,11 +1178,11 @@
1178 forceDelta = find_option("delta",0,0)!=0;
1179 forceBaseline = find_option("baseline",0,0)!=0;
1180 if( forceDelta && forceBaseline ){
1181 fossil_fatal("cannot use --delta and --baseline together");
1182 }
1183 testRun = find_option("test",0,0)!=0;
1184 zComment = find_option("comment","m",1);
1185 forceFlag = find_option("force", "f", 0)!=0;
1186 allowConflict = find_option("allow-conflict",0,0)!=0;
1187 allowEmpty = find_option("allow-empty",0,0)!=0;
1188 allowFork = find_option("allow-fork",0,0)!=0;
@@ -1522,11 +1522,11 @@
1522 }
1523
1524 /* If the --test option is specified, output the manifest file
1525 ** and rollback the transaction.
1526 */
1527 if( testRun ){
1528 blob_write_to_file(&manifest, "");
1529 }
1530
1531 if( outputManifest ){
1532 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
@@ -1601,11 +1601,11 @@
1601 /* Clear the undo/redo stack */
1602 undo_reset();
1603
1604 /* Commit */
1605 db_multi_exec("DELETE FROM vvar WHERE name='ci-comment'");
1606 if( testRun ){
1607 db_end_transaction(1);
1608 exit(1);
1609 }
1610 db_end_transaction(0);
1611
1612
--- src/checkin.c
+++ src/checkin.c
@@ -410,17 +410,17 @@
410 const char *zIgnoreFlag;
411 Blob path, repo;
412 Stmt q;
413 int n;
414 Glob *pIgnore;
415 int nochangeFlag = 0;
416
417 allFlag = find_option("force","f",0)!=0;
418 if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
419 if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
420 zIgnoreFlag = find_option("ignore",0,1);
421 nochangeFlag = find_option("nochange","n",0)!=0;
422 capture_case_sensitive_option();
423 db_must_be_within_tree();
424 if( zIgnoreFlag==0 ){
425 zIgnoreFlag = db_get("ignore-glob", 0);
426 }
@@ -440,11 +440,11 @@
440 if( file_tree_name(g.zRepositoryName, &repo, 0) ){
441 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
442 }
443 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
444 while( db_step(&q)==SQLITE_ROW ){
445 if( nochangeFlag ){
446 fossil_print("%s\n", db_column_text(&q,0));
447 continue;
448 }else if( !allFlag ){
449 Blob ans;
450 char cReply;
@@ -1154,11 +1154,11 @@
1154 int allowFork = 0; /* Allow the commit to fork */
1155 int allowOlder = 0; /* Allow a commit older than its ancestor */
1156 char *zManifestFile; /* Name of the manifest file */
1157 int useCksum; /* True if checksums should be computed and verified */
1158 int outputManifest; /* True to output "manifest" and "manifest.uuid" */
1159 int nochangeFlag; /* True for a test run. Debugging only */
1160 CheckinInfo sCiInfo; /* Information about this check-in */
1161 const char *zComFile; /* Read commit message from this file */
1162 int nTag = 0; /* Number of --tag arguments */
1163 const char *zTag; /* A single --tag argument */
1164 Blob manifest; /* Manifest in baseline form */
@@ -1178,11 +1178,11 @@
1178 forceDelta = find_option("delta",0,0)!=0;
1179 forceBaseline = find_option("baseline",0,0)!=0;
1180 if( forceDelta && forceBaseline ){
1181 fossil_fatal("cannot use --delta and --baseline together");
1182 }
1183 nochangeFlag = find_option("nochange","n",0)!=0;
1184 zComment = find_option("comment","m",1);
1185 forceFlag = find_option("force", "f", 0)!=0;
1186 allowConflict = find_option("allow-conflict",0,0)!=0;
1187 allowEmpty = find_option("allow-empty",0,0)!=0;
1188 allowFork = find_option("allow-fork",0,0)!=0;
@@ -1522,11 +1522,11 @@
1522 }
1523
1524 /* If the --test option is specified, output the manifest file
1525 ** and rollback the transaction.
1526 */
1527 if( nochangeFlag ){
1528 blob_write_to_file(&manifest, "");
1529 }
1530
1531 if( outputManifest ){
1532 zManifestFile = mprintf("%smanifest", g.zLocalRoot);
@@ -1601,11 +1601,11 @@
1601 /* Clear the undo/redo stack */
1602 undo_reset();
1603
1604 /* Commit */
1605 db_multi_exec("DELETE FROM vvar WHERE name='ci-comment'");
1606 if( nochangeFlag ){
1607 db_end_transaction(1);
1608 exit(1);
1609 }
1610 db_end_transaction(0);
1611
1612
+8 -4
--- src/diff.c
+++ src/diff.c
@@ -2415,11 +2415,11 @@
24152415
login_check_credentials();
24162416
if( !g.perm.Read ){ login_needed(); return; }
24172417
mid = name_to_typed_rid(PD("checkin","0"),"ci");
24182418
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", P("filename"));
24192419
if( mid==0 || fnid==0 ){ fossil_redirect_home(); }
2420
- iLimit = atoi(PD("limit","-1"));
2420
+ iLimit = atoi(PD("count","-1"));
24212421
if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){
24222422
fossil_redirect_home();
24232423
}
24242424
compute_direct_ancestors(mid, 10000000);
24252425
style_header("File Annotation");
@@ -2459,11 +2459,11 @@
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
2464
+** --count|-n N Only look backwards in time by N versions
24652465
** --log List all versions analyzed
24662466
** --filevers Show file version numbers rather than check-in versions
24672467
**
24682468
** See also: info, finfo, timeline
24692469
*/
@@ -2474,17 +2474,21 @@
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 --count 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("count","n",1);
2486
+ if(!zLimit){
2487
+ /* deprecated */
2488
+ zLimit = find_option("limit",0,1);
2489
+ }
24862490
if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
24872491
iLimit = atoi(zLimit);
24882492
showLog = find_option("log",0,0)!=0;
24892493
fileVers = find_option("filevers",0,0)!=0;
24902494
db_must_be_within_tree();
24912495
--- src/diff.c
+++ src/diff.c
@@ -2415,11 +2415,11 @@
2415 login_check_credentials();
2416 if( !g.perm.Read ){ login_needed(); return; }
2417 mid = name_to_typed_rid(PD("checkin","0"),"ci");
2418 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", P("filename"));
2419 if( mid==0 || fnid==0 ){ fossil_redirect_home(); }
2420 iLimit = atoi(PD("limit","-1"));
2421 if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){
2422 fossil_redirect_home();
2423 }
2424 compute_direct_ancestors(mid, 10000000);
2425 style_header("File Annotation");
@@ -2459,11 +2459,11 @@
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 */
@@ -2474,17 +2474,21 @@
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
--- src/diff.c
+++ src/diff.c
@@ -2415,11 +2415,11 @@
2415 login_check_credentials();
2416 if( !g.perm.Read ){ login_needed(); return; }
2417 mid = name_to_typed_rid(PD("checkin","0"),"ci");
2418 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", P("filename"));
2419 if( mid==0 || fnid==0 ){ fossil_redirect_home(); }
2420 iLimit = atoi(PD("count","-1"));
2421 if( !db_exists("SELECT 1 FROM mlink WHERE mid=%d AND fnid=%d",mid,fnid) ){
2422 fossil_redirect_home();
2423 }
2424 compute_direct_ancestors(mid, 10000000);
2425 style_header("File Annotation");
@@ -2459,11 +2459,11 @@
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 ** --count|-n 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 */
@@ -2474,17 +2474,21 @@
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 --count 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("count","n",1);
2486 if(!zLimit){
2487 /* deprecated */
2488 zLimit = find_option("limit",0,1);
2489 }
2490 if( zLimit==0 || zLimit[0]==0 ) zLimit = "-1";
2491 iLimit = atoi(zLimit);
2492 showLog = find_option("log",0,0)!=0;
2493 fileVers = find_option("filevers",0,0)!=0;
2494 db_must_be_within_tree();
2495
+7 -3
--- 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 "--count 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.
@@ -42,11 +42,11 @@
4242
**
4343
** Options:
4444
** --brief|-b 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
47
+** --count|n N display the first N changes
4848
** --log|-l select log mode (the default)
4949
** --offset P skip P changes
5050
** --print|-p select print mode
5151
** --revision|-r R print the given revision (or ckout, if none is given)
5252
** to stdout (only in print mode)
@@ -140,11 +140,15 @@
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("count","n",1);
146
+ if( !zLimit ){
147
+ /* deprecated */
148
+ zLimit = find_option("limit",0,1);
149
+ }
146150
iLimit = zLimit ? atoi(zLimit) : -1;
147151
zOffset = find_option("offset",0,1);
148152
iOffset = zOffset ? atoi(zOffset) : 0;
149153
iBrief = (find_option("brief","b",0) == 0);
150154
if( g.argc!=3 ){
151155
--- 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.
@@ -42,11 +42,11 @@
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)
@@ -140,11 +140,15 @@
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 "--count 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.
@@ -42,11 +42,11 @@
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 ** --count|n 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)
@@ -140,11 +140,15 @@
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("count","n",1);
146 if( !zLimit ){
147 /* deprecated */
148 zLimit = find_option("limit",0,1);
149 }
150 iLimit = zLimit ? atoi(zLimit) : -1;
151 zOffset = find_option("offset",0,1);
152 iOffset = zOffset ? atoi(zOffset) : 0;
153 iBrief = (find_option("brief","b",0) == 0);
154 if( g.argc!=3 ){
155
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -33,11 +33,11 @@
3333
char const * zFilename = NULL;
3434
Blob sql = empty_blob;
3535
Stmt q = empty_Stmt;
3636
char const * zAfter = NULL;
3737
char const * zBefore = NULL;
38
- int limit = -1;
38
+ int count = -1;
3939
int currentRow = 0;
4040
char const * zCheckin = NULL;
4141
char sort = -1;
4242
if(!g.perm.Read){
4343
json_set_err(FSL_JSON_E_DENIED,"Requires 'o' privileges.");
@@ -59,11 +59,11 @@
5959
return NULL;
6060
}
6161
6262
zBefore = json_find_option_cstr("before",NULL,"b");
6363
zAfter = json_find_option_cstr("after",NULL,"a");
64
- limit = json_find_option_int("limit",NULL,"n", -1);
64
+ count = json_find_option_int("count",NULL,"n", -1);
6565
zCheckin = json_find_option_cstr("checkin",NULL,"ci");
6666
6767
blob_appendf(&sql,
6868
/*0*/ "SELECT b.uuid,"
6969
/*1*/ " ci.uuid,"
@@ -112,12 +112,12 @@
112112
SQL escapes*/);
113113
blob_reset(&sql);
114114
115115
pay = cson_new_object();
116116
cson_object_set(pay, "name", json_new_string(zFilename));
117
- if( limit > 0 ){
118
- cson_object_set(pay, "limit", json_new_int(limit));
117
+ if( count > 0 ){
118
+ cson_object_set(pay, "count", json_new_int(count));
119119
}
120120
checkins = cson_new_array();
121121
cson_object_set(pay, "checkins", cson_array_value(checkins));
122122
while( db_step(&q)==SQLITE_ROW ){
123123
cson_object * row = cson_new_object();
@@ -132,11 +132,11 @@
132132
cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) ));
133133
/*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/
134134
cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) ));
135135
cson_object_set(row, "state",
136136
json_new_string(json_artifact_status_to_string(isNew,isDel)));
137
- if( (0 < limit) && (++currentRow >= limit) ){
137
+ if( (0 < count) && (++currentRow >= count) ){
138138
break;
139139
}
140140
}
141141
db_finalize(&q);
142142
143143
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -33,11 +33,11 @@
33 char const * zFilename = NULL;
34 Blob sql = empty_blob;
35 Stmt q = empty_Stmt;
36 char const * zAfter = NULL;
37 char const * zBefore = NULL;
38 int limit = -1;
39 int currentRow = 0;
40 char const * zCheckin = NULL;
41 char sort = -1;
42 if(!g.perm.Read){
43 json_set_err(FSL_JSON_E_DENIED,"Requires 'o' privileges.");
@@ -59,11 +59,11 @@
59 return NULL;
60 }
61
62 zBefore = json_find_option_cstr("before",NULL,"b");
63 zAfter = json_find_option_cstr("after",NULL,"a");
64 limit = json_find_option_int("limit",NULL,"n", -1);
65 zCheckin = json_find_option_cstr("checkin",NULL,"ci");
66
67 blob_appendf(&sql,
68 /*0*/ "SELECT b.uuid,"
69 /*1*/ " ci.uuid,"
@@ -112,12 +112,12 @@
112 SQL escapes*/);
113 blob_reset(&sql);
114
115 pay = cson_new_object();
116 cson_object_set(pay, "name", json_new_string(zFilename));
117 if( limit > 0 ){
118 cson_object_set(pay, "limit", json_new_int(limit));
119 }
120 checkins = cson_new_array();
121 cson_object_set(pay, "checkins", cson_array_value(checkins));
122 while( db_step(&q)==SQLITE_ROW ){
123 cson_object * row = cson_new_object();
@@ -132,11 +132,11 @@
132 cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) ));
133 /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/
134 cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) ));
135 cson_object_set(row, "state",
136 json_new_string(json_artifact_status_to_string(isNew,isDel)));
137 if( (0 < limit) && (++currentRow >= limit) ){
138 break;
139 }
140 }
141 db_finalize(&q);
142
143
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -33,11 +33,11 @@
33 char const * zFilename = NULL;
34 Blob sql = empty_blob;
35 Stmt q = empty_Stmt;
36 char const * zAfter = NULL;
37 char const * zBefore = NULL;
38 int count = -1;
39 int currentRow = 0;
40 char const * zCheckin = NULL;
41 char sort = -1;
42 if(!g.perm.Read){
43 json_set_err(FSL_JSON_E_DENIED,"Requires 'o' privileges.");
@@ -59,11 +59,11 @@
59 return NULL;
60 }
61
62 zBefore = json_find_option_cstr("before",NULL,"b");
63 zAfter = json_find_option_cstr("after",NULL,"a");
64 count = json_find_option_int("count",NULL,"n", -1);
65 zCheckin = json_find_option_cstr("checkin",NULL,"ci");
66
67 blob_appendf(&sql,
68 /*0*/ "SELECT b.uuid,"
69 /*1*/ " ci.uuid,"
@@ -112,12 +112,12 @@
112 SQL escapes*/);
113 blob_reset(&sql);
114
115 pay = cson_new_object();
116 cson_object_set(pay, "name", json_new_string(zFilename));
117 if( count > 0 ){
118 cson_object_set(pay, "count", json_new_int(count));
119 }
120 checkins = cson_new_array();
121 cson_object_set(pay, "checkins", cson_array_value(checkins));
122 while( db_step(&q)==SQLITE_ROW ){
123 cson_object * row = cson_new_object();
@@ -132,11 +132,11 @@
132 cson_object_set(row, "comment", json_new_string( db_column_text(&q,5) ));
133 /*cson_object_set(row, "bgColor", json_new_string( db_column_text(&q,7) ));*/
134 cson_object_set(row, "size", cson_value_new_integer( (cson_int_t)db_column_int64(&q,8) ));
135 cson_object_set(row, "state",
136 json_new_string(json_artifact_status_to_string(isNew,isDel)));
137 if( (0 < count) && (++currentRow >= count) ){
138 break;
139 }
140 }
141 db_finalize(&q);
142
143
--- src/json_report.c
+++ src/json_report.c
@@ -153,11 +153,11 @@
153153
**
154154
** Options/arguments:
155155
**
156156
** report=int (CLI: -report # or -r #) is the report number to run.
157157
**
158
-** limit=int (CLI: -limit # or -n #) -n is for compat. with other commands.
158
+** count=int (CLI: -count # or -n #) -n is for compat. with other commands.
159159
**
160160
** format=a|o Specifies result format: a=each row is an arry, o=each
161161
** row is an object. Default=o.
162162
*/
163163
static cson_value * json_report_run(){
@@ -166,11 +166,11 @@
166166
cson_object * pay = NULL;
167167
cson_array * tktList = NULL;
168168
char const * zFmt;
169169
char * zTitle = NULL;
170170
Blob sql = empty_blob;
171
- int limit = 0;
171
+ int count = 0;
172172
cson_value * colNames = NULL;
173173
int i;
174174
175175
if(!g.perm.RdTkt){
176176
json_set_err(FSL_JSON_E_DENIED,
@@ -197,11 +197,11 @@
197197
nReport);
198198
db_finalize(&q);
199199
goto error;
200200
}
201201
202
- limit = json_find_option_int("limit",NULL,"n",-1);
202
+ count = json_find_option_int("count",NULL,"n",-1);
203203
204204
205205
/* Copy over report's SQL...*/
206206
blob_append(&sql, db_column_text(&q,0), -1);
207207
zTitle = mprintf("%s", db_column_text(&q,1));
@@ -211,12 +211,12 @@
211211
/** Build the response... */
212212
pay = cson_new_object();
213213
214214
cson_object_set(pay, "report", json_new_int(nReport));
215215
cson_object_set(pay, "title", json_new_string(zTitle));
216
- if(limit>0){
217
- cson_object_set(pay, "limit", json_new_int((limit<0) ? 0 : limit));
216
+ if(count>0){
217
+ cson_object_set(pay, "count", json_new_int((count<0) ? 0 : count));
218218
}
219219
free(zTitle);
220220
zTitle = NULL;
221221
222222
if(g.perm.TktFmt){
@@ -226,11 +226,11 @@
226226
}
227227
blob_reset(&sql);
228228
229229
colNames = cson_sqlite3_column_names(q.pStmt);
230230
cson_object_set( pay, "columnNames", colNames);
231
- for( i = 0 ; ((limit>0) ?(i < limit) : 1)
231
+ for( i = 0 ; ((count>0) ?(i < count) : 1)
232232
&& (SQLITE_ROW == db_step(&q));
233233
++i){
234234
cson_value * row = ('a'==*zFmt)
235235
? cson_sqlite3_row_to_array(q.pStmt)
236236
: cson_sqlite3_row_to_object2(q.pStmt,
237237
--- src/json_report.c
+++ src/json_report.c
@@ -153,11 +153,11 @@
153 **
154 ** Options/arguments:
155 **
156 ** report=int (CLI: -report # or -r #) is the report number to run.
157 **
158 ** limit=int (CLI: -limit # or -n #) -n is for compat. with other commands.
159 **
160 ** format=a|o Specifies result format: a=each row is an arry, o=each
161 ** row is an object. Default=o.
162 */
163 static cson_value * json_report_run(){
@@ -166,11 +166,11 @@
166 cson_object * pay = NULL;
167 cson_array * tktList = NULL;
168 char const * zFmt;
169 char * zTitle = NULL;
170 Blob sql = empty_blob;
171 int limit = 0;
172 cson_value * colNames = NULL;
173 int i;
174
175 if(!g.perm.RdTkt){
176 json_set_err(FSL_JSON_E_DENIED,
@@ -197,11 +197,11 @@
197 nReport);
198 db_finalize(&q);
199 goto error;
200 }
201
202 limit = json_find_option_int("limit",NULL,"n",-1);
203
204
205 /* Copy over report's SQL...*/
206 blob_append(&sql, db_column_text(&q,0), -1);
207 zTitle = mprintf("%s", db_column_text(&q,1));
@@ -211,12 +211,12 @@
211 /** Build the response... */
212 pay = cson_new_object();
213
214 cson_object_set(pay, "report", json_new_int(nReport));
215 cson_object_set(pay, "title", json_new_string(zTitle));
216 if(limit>0){
217 cson_object_set(pay, "limit", json_new_int((limit<0) ? 0 : limit));
218 }
219 free(zTitle);
220 zTitle = NULL;
221
222 if(g.perm.TktFmt){
@@ -226,11 +226,11 @@
226 }
227 blob_reset(&sql);
228
229 colNames = cson_sqlite3_column_names(q.pStmt);
230 cson_object_set( pay, "columnNames", colNames);
231 for( i = 0 ; ((limit>0) ?(i < limit) : 1)
232 && (SQLITE_ROW == db_step(&q));
233 ++i){
234 cson_value * row = ('a'==*zFmt)
235 ? cson_sqlite3_row_to_array(q.pStmt)
236 : cson_sqlite3_row_to_object2(q.pStmt,
237
--- src/json_report.c
+++ src/json_report.c
@@ -153,11 +153,11 @@
153 **
154 ** Options/arguments:
155 **
156 ** report=int (CLI: -report # or -r #) is the report number to run.
157 **
158 ** count=int (CLI: -count # or -n #) -n is for compat. with other commands.
159 **
160 ** format=a|o Specifies result format: a=each row is an arry, o=each
161 ** row is an object. Default=o.
162 */
163 static cson_value * json_report_run(){
@@ -166,11 +166,11 @@
166 cson_object * pay = NULL;
167 cson_array * tktList = NULL;
168 char const * zFmt;
169 char * zTitle = NULL;
170 Blob sql = empty_blob;
171 int count = 0;
172 cson_value * colNames = NULL;
173 int i;
174
175 if(!g.perm.RdTkt){
176 json_set_err(FSL_JSON_E_DENIED,
@@ -197,11 +197,11 @@
197 nReport);
198 db_finalize(&q);
199 goto error;
200 }
201
202 count = json_find_option_int("count",NULL,"n",-1);
203
204
205 /* Copy over report's SQL...*/
206 blob_append(&sql, db_column_text(&q,0), -1);
207 zTitle = mprintf("%s", db_column_text(&q,1));
@@ -211,12 +211,12 @@
211 /** Build the response... */
212 pay = cson_new_object();
213
214 cson_object_set(pay, "report", json_new_int(nReport));
215 cson_object_set(pay, "title", json_new_string(zTitle));
216 if(count>0){
217 cson_object_set(pay, "count", json_new_int((count<0) ? 0 : count));
218 }
219 free(zTitle);
220 zTitle = NULL;
221
222 if(g.perm.TktFmt){
@@ -226,11 +226,11 @@
226 }
227 blob_reset(&sql);
228
229 colNames = cson_sqlite3_column_names(q.pStmt);
230 cson_object_set( pay, "columnNames", colNames);
231 for( i = 0 ; ((count>0) ?(i < count) : 1)
232 && (SQLITE_ROW == db_step(&q));
233 ++i){
234 cson_value * row = ('a'==*zFmt)
235 ? cson_sqlite3_row_to_array(q.pStmt)
236 : cson_sqlite3_row_to_object2(q.pStmt,
237
+5 -5
--- src/json_tag.c
+++ src/json_tag.c
@@ -198,11 +198,11 @@
198198
char const * zName = NULL;
199199
char const * zType = NULL;
200200
char const * zType2 = NULL;
201201
char fRaw = 0;
202202
Stmt q = empty_Stmt;
203
- int limit = 0;
203
+ int count = 0;
204204
int tagid = 0;
205205
206206
if( !g.perm.Read ){
207207
json_set_err(FSL_JSON_E_DENIED,
208208
"Requires 'o' permissions.");
@@ -230,11 +230,11 @@
230230
case 'w': zType = "w"; zType2 = "wiki"; break;
231231
case 't': zType = "t"; zType2 = "ticket"; break;
232232
}
233233
}
234234
235
- limit = json_find_option_int("limit",NULL,"n",0);
235
+ count = json_find_option_int("count",NULL,"n",0);
236236
fRaw = json_find_option_bool("raw",NULL,NULL,0);
237237
238238
tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%s' || %Q",
239239
fRaw ? "" : "sym-",
240240
zName);
@@ -242,11 +242,11 @@
242242
payV = cson_value_new_object();
243243
pay = cson_value_get_object(payV);
244244
cson_object_set(pay, "name", json_new_string(zName));
245245
cson_object_set(pay, "raw", cson_value_new_bool(fRaw));
246246
cson_object_set(pay, "type", json_new_string(zType2));
247
- cson_object_set(pay, "limit", json_new_int(limit));
247
+ cson_object_set(pay, "count", json_new_int(count));
248248
249249
#if 1
250250
if( tagid<=0 ){
251251
cson_object_set(pay,"artifacts", cson_value_null());
252252
json_warn(FSL_JSON_W_TAG_NOT_FOUND, "Tag not found.");
@@ -260,11 +260,11 @@
260260
" WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)"
261261
" AND tagxref.tagtype>0"
262262
" AND blob.rid=tagxref.rid"
263263
"%s LIMIT %d",
264264
zName,
265
- (limit>0)?"":"--", limit
265
+ (count>0)?"":"--", count
266266
);
267267
while( db_step(&q)==SQLITE_ROW ){
268268
if(!listV){
269269
listV = cson_value_new_array();
270270
list = cson_value_get_array(listV);
@@ -302,11 +302,11 @@
302302
" WHERE tagtype>0 AND tagid=%d"
303303
" )"
304304
" ORDER BY event.mtime DESC"
305305
"%s LIMIT %d",
306306
zSqlBase, zType, tagid,
307
- (limit>0)?"":"--", limit
307
+ (count>0)?"":"--", count
308308
);
309309
listV = json_stmt_to_array_of_obj(&q, NULL);
310310
db_finalize(&q);
311311
}
312312
313313
--- src/json_tag.c
+++ src/json_tag.c
@@ -198,11 +198,11 @@
198 char const * zName = NULL;
199 char const * zType = NULL;
200 char const * zType2 = NULL;
201 char fRaw = 0;
202 Stmt q = empty_Stmt;
203 int limit = 0;
204 int tagid = 0;
205
206 if( !g.perm.Read ){
207 json_set_err(FSL_JSON_E_DENIED,
208 "Requires 'o' permissions.");
@@ -230,11 +230,11 @@
230 case 'w': zType = "w"; zType2 = "wiki"; break;
231 case 't': zType = "t"; zType2 = "ticket"; break;
232 }
233 }
234
235 limit = json_find_option_int("limit",NULL,"n",0);
236 fRaw = json_find_option_bool("raw",NULL,NULL,0);
237
238 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%s' || %Q",
239 fRaw ? "" : "sym-",
240 zName);
@@ -242,11 +242,11 @@
242 payV = cson_value_new_object();
243 pay = cson_value_get_object(payV);
244 cson_object_set(pay, "name", json_new_string(zName));
245 cson_object_set(pay, "raw", cson_value_new_bool(fRaw));
246 cson_object_set(pay, "type", json_new_string(zType2));
247 cson_object_set(pay, "limit", json_new_int(limit));
248
249 #if 1
250 if( tagid<=0 ){
251 cson_object_set(pay,"artifacts", cson_value_null());
252 json_warn(FSL_JSON_W_TAG_NOT_FOUND, "Tag not found.");
@@ -260,11 +260,11 @@
260 " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)"
261 " AND tagxref.tagtype>0"
262 " AND blob.rid=tagxref.rid"
263 "%s LIMIT %d",
264 zName,
265 (limit>0)?"":"--", limit
266 );
267 while( db_step(&q)==SQLITE_ROW ){
268 if(!listV){
269 listV = cson_value_new_array();
270 list = cson_value_get_array(listV);
@@ -302,11 +302,11 @@
302 " WHERE tagtype>0 AND tagid=%d"
303 " )"
304 " ORDER BY event.mtime DESC"
305 "%s LIMIT %d",
306 zSqlBase, zType, tagid,
307 (limit>0)?"":"--", limit
308 );
309 listV = json_stmt_to_array_of_obj(&q, NULL);
310 db_finalize(&q);
311 }
312
313
--- src/json_tag.c
+++ src/json_tag.c
@@ -198,11 +198,11 @@
198 char const * zName = NULL;
199 char const * zType = NULL;
200 char const * zType2 = NULL;
201 char fRaw = 0;
202 Stmt q = empty_Stmt;
203 int count = 0;
204 int tagid = 0;
205
206 if( !g.perm.Read ){
207 json_set_err(FSL_JSON_E_DENIED,
208 "Requires 'o' permissions.");
@@ -230,11 +230,11 @@
230 case 'w': zType = "w"; zType2 = "wiki"; break;
231 case 't': zType = "t"; zType2 = "ticket"; break;
232 }
233 }
234
235 count = json_find_option_int("count",NULL,"n",0);
236 fRaw = json_find_option_bool("raw",NULL,NULL,0);
237
238 tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='%s' || %Q",
239 fRaw ? "" : "sym-",
240 zName);
@@ -242,11 +242,11 @@
242 payV = cson_value_new_object();
243 pay = cson_value_get_object(payV);
244 cson_object_set(pay, "name", json_new_string(zName));
245 cson_object_set(pay, "raw", cson_value_new_bool(fRaw));
246 cson_object_set(pay, "type", json_new_string(zType2));
247 cson_object_set(pay, "count", json_new_int(count));
248
249 #if 1
250 if( tagid<=0 ){
251 cson_object_set(pay,"artifacts", cson_value_null());
252 json_warn(FSL_JSON_W_TAG_NOT_FOUND, "Tag not found.");
@@ -260,11 +260,11 @@
260 " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)"
261 " AND tagxref.tagtype>0"
262 " AND blob.rid=tagxref.rid"
263 "%s LIMIT %d",
264 zName,
265 (count>0)?"":"--", count
266 );
267 while( db_step(&q)==SQLITE_ROW ){
268 if(!listV){
269 listV = cson_value_new_array();
270 list = cson_value_get_array(listV);
@@ -302,11 +302,11 @@
302 " WHERE tagtype>0 AND tagid=%d"
303 " )"
304 " ORDER BY event.mtime DESC"
305 "%s LIMIT %d",
306 zSqlBase, zType, tagid,
307 (count>0)?"":"--", count
308 );
309 listV = json_stmt_to_array_of_obj(&q, NULL);
310 db_finalize(&q);
311 }
312
313
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -224,28 +224,28 @@
224224
}
225225
return rc;
226226
}
227227
228228
/*
229
-** Tries to figure out a timeline query length limit base on
229
+** Tries to figure out a timeline query length count base on
230230
** environment parameters. If it can it returns that value,
231231
** else it returns some statically defined default value.
232232
**
233
-** Never returns a negative value. 0 means no limit.
233
+** Never returns a negative value. 0 means no count.
234234
*/
235
-static int json_timeline_limit(int defaultLimit){
236
- int limit = -1;
235
+static int json_timeline_count(int defaultCount){
236
+ int count = -1;
237237
if(!g.isHTTP){/* CLI mode */
238
- char const * arg = find_option("limit","n",1);
238
+ char const * arg = find_option("count","n",1);
239239
if(arg && *arg){
240
- limit = atoi(arg);
240
+ count = atoi(arg);
241241
}
242242
}
243
- if( (limit<0) && fossil_has_json() ){
244
- limit = json_getenv_int("limit",-1);
243
+ if( (count<0) && fossil_has_json() ){
244
+ count = json_getenv_int("count",-1);
245245
}
246
- return (limit<0) ? defaultLimit : limit;
246
+ return (count<0) ? defaultCount : count;
247247
}
248248
249249
/*
250250
** Internal helper for the json_timeline_EVENTTYPE() family of
251251
** functions. zEventType must be one of (ci, w, t). pSql must be a
@@ -261,26 +261,26 @@
261261
** the returned value should be used as g.json.resultCode.
262262
*/
263263
static int json_timeline_setup_sql( char const * zEventType,
264264
Blob * pSql,
265265
cson_object * pPayload ){
266
- int limit;
266
+ int count;
267267
assert( zEventType && *zEventType && pSql );
268268
json_timeline_temp_table();
269269
blob_append(pSql, "INSERT OR IGNORE INTO json_timeline ", -1);
270270
blob_append(pSql, json_timeline_query(), -1 );
271271
blob_appendf(pSql, " AND event.type IN(%Q) ", zEventType);
272272
if( json_timeline_add_tag_branch_clause(pSql, pPayload) < 0 ){
273273
return FSL_JSON_E_INVALID_ARGS;
274274
}
275275
json_timeline_add_time_clause(pSql);
276
- limit = json_timeline_limit(20);
277
- if(limit>0){
278
- blob_appendf(pSql,"LIMIT %d ",limit);
276
+ count = json_timeline_count(20);
277
+ if(count>0){
278
+ blob_appendf(pSql,"LIMIT %d ",count);
279279
}
280280
if(pPayload){
281
- cson_object_set(pPayload, "limit", json_new_int(limit));
281
+ cson_object_set(pPayload, "count", json_new_int(count));
282282
}
283283
return 0;
284284
}
285285
286286
@@ -342,11 +342,11 @@
342342
343343
static cson_value * json_timeline_branch(){
344344
cson_value * pay = NULL;
345345
Blob sql = empty_blob;
346346
Stmt q = empty_Stmt;
347
- int limit = 0;
347
+ int count = 0;
348348
if(!g.perm.Read){
349349
json_set_err(FSL_JSON_E_DENIED,
350350
"Requires 'o' permissions.");
351351
return NULL;
352352
}
@@ -368,13 +368,13 @@
368368
" AND event.type='ci'"
369369
" AND blob.rid IN (SELECT rid FROM tagxref"
370370
" WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
371371
" ORDER BY event.mtime DESC",
372372
TAG_BRANCH);
373
- limit = json_timeline_limit(20);
374
- if(limit>0){
375
- blob_appendf(&sql," LIMIT %d ",limit);
373
+ count = json_timeline_count(20);
374
+ if(count>0){
375
+ blob_appendf(&sql," LIMIT %d ",count);
376376
}
377377
db_prepare(&q,"%s", blob_str(&sql));
378378
blob_reset(&sql);
379379
pay = json_stmt_to_array_of_obj(&q, NULL);
380380
db_finalize(&q);
@@ -404,12 +404,12 @@
404404
405405
/* now we wrap the payload in an outer shell, for consistency with
406406
other /json/timeline/xyz APIs...
407407
*/
408408
outer = cson_new_object();
409
- if(limit>0){
410
- cson_object_set( outer, "limit", json_new_int(limit) );
409
+ if(count>0){
410
+ cson_object_set( outer, "count", json_new_int(count) );
411411
}
412412
cson_object_set( outer, "timeline", pay );
413413
pay = cson_object_value(outer);
414414
}
415415
return pay;
416416
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -224,28 +224,28 @@
224 }
225 return rc;
226 }
227
228 /*
229 ** Tries to figure out a timeline query length limit base on
230 ** environment parameters. If it can it returns that value,
231 ** else it returns some statically defined default value.
232 **
233 ** Never returns a negative value. 0 means no limit.
234 */
235 static int json_timeline_limit(int defaultLimit){
236 int limit = -1;
237 if(!g.isHTTP){/* CLI mode */
238 char const * arg = find_option("limit","n",1);
239 if(arg && *arg){
240 limit = atoi(arg);
241 }
242 }
243 if( (limit<0) && fossil_has_json() ){
244 limit = json_getenv_int("limit",-1);
245 }
246 return (limit<0) ? defaultLimit : limit;
247 }
248
249 /*
250 ** Internal helper for the json_timeline_EVENTTYPE() family of
251 ** functions. zEventType must be one of (ci, w, t). pSql must be a
@@ -261,26 +261,26 @@
261 ** the returned value should be used as g.json.resultCode.
262 */
263 static int json_timeline_setup_sql( char const * zEventType,
264 Blob * pSql,
265 cson_object * pPayload ){
266 int limit;
267 assert( zEventType && *zEventType && pSql );
268 json_timeline_temp_table();
269 blob_append(pSql, "INSERT OR IGNORE INTO json_timeline ", -1);
270 blob_append(pSql, json_timeline_query(), -1 );
271 blob_appendf(pSql, " AND event.type IN(%Q) ", zEventType);
272 if( json_timeline_add_tag_branch_clause(pSql, pPayload) < 0 ){
273 return FSL_JSON_E_INVALID_ARGS;
274 }
275 json_timeline_add_time_clause(pSql);
276 limit = json_timeline_limit(20);
277 if(limit>0){
278 blob_appendf(pSql,"LIMIT %d ",limit);
279 }
280 if(pPayload){
281 cson_object_set(pPayload, "limit", json_new_int(limit));
282 }
283 return 0;
284 }
285
286
@@ -342,11 +342,11 @@
342
343 static cson_value * json_timeline_branch(){
344 cson_value * pay = NULL;
345 Blob sql = empty_blob;
346 Stmt q = empty_Stmt;
347 int limit = 0;
348 if(!g.perm.Read){
349 json_set_err(FSL_JSON_E_DENIED,
350 "Requires 'o' permissions.");
351 return NULL;
352 }
@@ -368,13 +368,13 @@
368 " AND event.type='ci'"
369 " AND blob.rid IN (SELECT rid FROM tagxref"
370 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
371 " ORDER BY event.mtime DESC",
372 TAG_BRANCH);
373 limit = json_timeline_limit(20);
374 if(limit>0){
375 blob_appendf(&sql," LIMIT %d ",limit);
376 }
377 db_prepare(&q,"%s", blob_str(&sql));
378 blob_reset(&sql);
379 pay = json_stmt_to_array_of_obj(&q, NULL);
380 db_finalize(&q);
@@ -404,12 +404,12 @@
404
405 /* now we wrap the payload in an outer shell, for consistency with
406 other /json/timeline/xyz APIs...
407 */
408 outer = cson_new_object();
409 if(limit>0){
410 cson_object_set( outer, "limit", json_new_int(limit) );
411 }
412 cson_object_set( outer, "timeline", pay );
413 pay = cson_object_value(outer);
414 }
415 return pay;
416
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -224,28 +224,28 @@
224 }
225 return rc;
226 }
227
228 /*
229 ** Tries to figure out a timeline query length count base on
230 ** environment parameters. If it can it returns that value,
231 ** else it returns some statically defined default value.
232 **
233 ** Never returns a negative value. 0 means no count.
234 */
235 static int json_timeline_count(int defaultCount){
236 int count = -1;
237 if(!g.isHTTP){/* CLI mode */
238 char const * arg = find_option("count","n",1);
239 if(arg && *arg){
240 count = atoi(arg);
241 }
242 }
243 if( (count<0) && fossil_has_json() ){
244 count = json_getenv_int("count",-1);
245 }
246 return (count<0) ? defaultCount : count;
247 }
248
249 /*
250 ** Internal helper for the json_timeline_EVENTTYPE() family of
251 ** functions. zEventType must be one of (ci, w, t). pSql must be a
@@ -261,26 +261,26 @@
261 ** the returned value should be used as g.json.resultCode.
262 */
263 static int json_timeline_setup_sql( char const * zEventType,
264 Blob * pSql,
265 cson_object * pPayload ){
266 int count;
267 assert( zEventType && *zEventType && pSql );
268 json_timeline_temp_table();
269 blob_append(pSql, "INSERT OR IGNORE INTO json_timeline ", -1);
270 blob_append(pSql, json_timeline_query(), -1 );
271 blob_appendf(pSql, " AND event.type IN(%Q) ", zEventType);
272 if( json_timeline_add_tag_branch_clause(pSql, pPayload) < 0 ){
273 return FSL_JSON_E_INVALID_ARGS;
274 }
275 json_timeline_add_time_clause(pSql);
276 count = json_timeline_count(20);
277 if(count>0){
278 blob_appendf(pSql,"LIMIT %d ",count);
279 }
280 if(pPayload){
281 cson_object_set(pPayload, "count", json_new_int(count));
282 }
283 return 0;
284 }
285
286
@@ -342,11 +342,11 @@
342
343 static cson_value * json_timeline_branch(){
344 cson_value * pay = NULL;
345 Blob sql = empty_blob;
346 Stmt q = empty_Stmt;
347 int count = 0;
348 if(!g.perm.Read){
349 json_set_err(FSL_JSON_E_DENIED,
350 "Requires 'o' permissions.");
351 return NULL;
352 }
@@ -368,13 +368,13 @@
368 " AND event.type='ci'"
369 " AND blob.rid IN (SELECT rid FROM tagxref"
370 " WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
371 " ORDER BY event.mtime DESC",
372 TAG_BRANCH);
373 count = json_timeline_count(20);
374 if(count>0){
375 blob_appendf(&sql," LIMIT %d ",count);
376 }
377 db_prepare(&q,"%s", blob_str(&sql));
378 blob_reset(&sql);
379 pay = json_stmt_to_array_of_obj(&q, NULL);
380 db_finalize(&q);
@@ -404,12 +404,12 @@
404
405 /* now we wrap the payload in an outer shell, for consistency with
406 other /json/timeline/xyz APIs...
407 */
408 outer = cson_new_object();
409 if(count>0){
410 cson_object_set( outer, "count", json_new_int(count) );
411 }
412 cson_object_set( outer, "timeline", pay );
413 pay = cson_object_value(outer);
414 }
415 return pay;
416

Keyboard Shortcuts

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