Fossil SCM
For the 'tag find' command, move parsing of the -n|--limit option to the innermost scope, to avoid conflicts with the 'tag add' variant of the -n|--dryrun option
Commit
5d5252b8846012b321ab5ee7b43727b559270a40a438341cfa5d1d3a32954578
Parent
df85c3f9abf78e6…
1 file changed
+2
-2
+2
-2
| --- src/tag.c | ||
| +++ src/tag.c | ||
| @@ -435,12 +435,10 @@ | ||
| 435 | 435 | void tag_cmd(void){ |
| 436 | 436 | int n; |
| 437 | 437 | int fRaw = find_option("raw","",0)!=0; |
| 438 | 438 | int fPropagate = find_option("propagate","",0)!=0; |
| 439 | 439 | const char *zPrefix = fRaw ? "" : "sym-"; |
| 440 | - const char *zFindLimit = find_option("limit","n",1); | |
| 441 | - const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000; | |
| 442 | 440 | |
| 443 | 441 | db_find_and_open_repository(0, 0); |
| 444 | 442 | if( g.argc<3 ){ |
| 445 | 443 | goto tag_cmd_usage; |
| 446 | 444 | } |
| @@ -481,10 +479,12 @@ | ||
| 481 | 479 | db_end_transaction(0); |
| 482 | 480 | }else |
| 483 | 481 | |
| 484 | 482 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 485 | 483 | Stmt q; |
| 484 | + const char *zFindLimit = find_option("limit","n",1); | |
| 485 | + const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000; | |
| 486 | 486 | const char *zType = find_option("type","t",1); |
| 487 | 487 | Blob sql = empty_blob; |
| 488 | 488 | if( zType==0 || zType[0]==0 ) zType = "*"; |
| 489 | 489 | if( g.argc!=4 ){ |
| 490 | 490 | usage("find ?--raw? ?-t|--type TYPE? ?-n|--limit #? TAGNAME"); |
| 491 | 491 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -435,12 +435,10 @@ | |
| 435 | void tag_cmd(void){ |
| 436 | int n; |
| 437 | int fRaw = find_option("raw","",0)!=0; |
| 438 | int fPropagate = find_option("propagate","",0)!=0; |
| 439 | const char *zPrefix = fRaw ? "" : "sym-"; |
| 440 | const char *zFindLimit = find_option("limit","n",1); |
| 441 | const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000; |
| 442 | |
| 443 | db_find_and_open_repository(0, 0); |
| 444 | if( g.argc<3 ){ |
| 445 | goto tag_cmd_usage; |
| 446 | } |
| @@ -481,10 +479,12 @@ | |
| 481 | db_end_transaction(0); |
| 482 | }else |
| 483 | |
| 484 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 485 | Stmt q; |
| 486 | const char *zType = find_option("type","t",1); |
| 487 | Blob sql = empty_blob; |
| 488 | if( zType==0 || zType[0]==0 ) zType = "*"; |
| 489 | if( g.argc!=4 ){ |
| 490 | usage("find ?--raw? ?-t|--type TYPE? ?-n|--limit #? TAGNAME"); |
| 491 |
| --- src/tag.c | |
| +++ src/tag.c | |
| @@ -435,12 +435,10 @@ | |
| 435 | void tag_cmd(void){ |
| 436 | int n; |
| 437 | int fRaw = find_option("raw","",0)!=0; |
| 438 | int fPropagate = find_option("propagate","",0)!=0; |
| 439 | const char *zPrefix = fRaw ? "" : "sym-"; |
| 440 | |
| 441 | db_find_and_open_repository(0, 0); |
| 442 | if( g.argc<3 ){ |
| 443 | goto tag_cmd_usage; |
| 444 | } |
| @@ -481,10 +479,12 @@ | |
| 479 | db_end_transaction(0); |
| 480 | }else |
| 481 | |
| 482 | if( strncmp(g.argv[2],"find",n)==0 ){ |
| 483 | Stmt q; |
| 484 | const char *zFindLimit = find_option("limit","n",1); |
| 485 | const int nFindLimit = zFindLimit ? atoi(zFindLimit) : -2000; |
| 486 | const char *zType = find_option("type","t",1); |
| 487 | Blob sql = empty_blob; |
| 488 | if( zType==0 || zType[0]==0 ) zType = "*"; |
| 489 | if( g.argc!=4 ){ |
| 490 | usage("find ?--raw? ?-t|--type TYPE? ?-n|--limit #? TAGNAME"); |
| 491 |