Fossil SCM
In "fossil whatis" for an ambiguous name, count a ticket among the meanings, so that it is numbered after the artifacts before it, and omit the separator before a ticket that is the first meaning listed, which made the --json output invalid.
Commit
cf33e7e2ed3eef1bbf1c2c858d448e789147c8763b988c023eb0dc3b1c73b144
Parent
eb35f976d30dabf…
1 file changed
+6
-4
+6
-4
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -1501,14 +1501,16 @@ | ||
| 1501 | 1501 | " ORDER BY mtime LIMIT 1)" |
| 1502 | 1502 | " FROM tag WHERE tagname GLOB 'tkt-%q*'", |
| 1503 | 1503 | zC |
| 1504 | 1504 | ); |
| 1505 | 1505 | while( db_step(&q)==SQLITE_ROW ){ |
| 1506 | - if( pOut ){ | |
| 1507 | - sqlite3_str_append(pOut, ",", 1); | |
| 1508 | - }else{ | |
| 1509 | - fossil_print("%12s---- meaning #%d ----\n", " ", cnt); | |
| 1506 | + if( cnt++ ){ | |
| 1507 | + if( pOut ){ | |
| 1508 | + sqlite3_str_append(pOut, ",", 1); | |
| 1509 | + }else{ | |
| 1510 | + fossil_print("%12s---- meaning #%d ----\n", " ", cnt); | |
| 1511 | + } | |
| 1510 | 1512 | } |
| 1511 | 1513 | whatis_rid(db_column_int(&q, 0), mFlags, pOut); |
| 1512 | 1514 | } |
| 1513 | 1515 | db_finalize(&q); |
| 1514 | 1516 | } |
| 1515 | 1517 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1501,14 +1501,16 @@ | |
| 1501 | " ORDER BY mtime LIMIT 1)" |
| 1502 | " FROM tag WHERE tagname GLOB 'tkt-%q*'", |
| 1503 | zC |
| 1504 | ); |
| 1505 | while( db_step(&q)==SQLITE_ROW ){ |
| 1506 | if( pOut ){ |
| 1507 | sqlite3_str_append(pOut, ",", 1); |
| 1508 | }else{ |
| 1509 | fossil_print("%12s---- meaning #%d ----\n", " ", cnt); |
| 1510 | } |
| 1511 | whatis_rid(db_column_int(&q, 0), mFlags, pOut); |
| 1512 | } |
| 1513 | db_finalize(&q); |
| 1514 | } |
| 1515 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -1501,14 +1501,16 @@ | |
| 1501 | " ORDER BY mtime LIMIT 1)" |
| 1502 | " FROM tag WHERE tagname GLOB 'tkt-%q*'", |
| 1503 | zC |
| 1504 | ); |
| 1505 | while( db_step(&q)==SQLITE_ROW ){ |
| 1506 | if( cnt++ ){ |
| 1507 | if( pOut ){ |
| 1508 | sqlite3_str_append(pOut, ",", 1); |
| 1509 | }else{ |
| 1510 | fossil_print("%12s---- meaning #%d ----\n", " ", cnt); |
| 1511 | } |
| 1512 | } |
| 1513 | whatis_rid(db_column_int(&q, 0), mFlags, pOut); |
| 1514 | } |
| 1515 | db_finalize(&q); |
| 1516 | } |
| 1517 |