Fossil SCM
Cleaned up some JSON output using the new %jobs format.
Commit
d9fffa4c58686fa563e35310d0bbad10a4c6a0e3f51d165843f4af40f8008bae
Parent
2cccc12d0482cc1…
2 files changed
+10
-10
+2
-2
+10
-10
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -1059,11 +1059,11 @@ | ||
| 1059 | 1059 | Blob content = empty_blob; |
| 1060 | 1060 | va_list vargs; |
| 1061 | 1061 | va_start(vargs,zFmt); |
| 1062 | 1062 | blob_vappendf(&msg, zFmt, vargs); |
| 1063 | 1063 | va_end(vargs); |
| 1064 | - blob_appendf(&content,"{\"error\":\"%j\"}", blob_str(&msg)); | |
| 1064 | + blob_appendf(&content,"{\"error\":%!j}", blob_str(&msg)); | |
| 1065 | 1065 | blob_reset(&msg); |
| 1066 | 1066 | cgi_set_content(&content); |
| 1067 | 1067 | cgi_set_status(httpCode, "Error"); |
| 1068 | 1068 | cgi_set_content_type("application/json"); |
| 1069 | 1069 | } |
| @@ -1526,11 +1526,11 @@ | ||
| 1526 | 1526 | int vid = 0; |
| 1527 | 1527 | if(0==fileedit_ajax_setup_filerev(zCi, &zCiFull, &vid, 0, 0)){ |
| 1528 | 1528 | /* Error already reported */ |
| 1529 | 1529 | return; |
| 1530 | 1530 | } |
| 1531 | - CX("{\"checkin\":\"%j\"," | |
| 1531 | + CX("{\"checkin\":%!j," | |
| 1532 | 1532 | "\"editableFiles\":[", zCiFull); |
| 1533 | 1533 | blob_append_sql(&sql, "SELECT filename FROM files_of_checkin(%Q) " |
| 1534 | 1534 | "ORDER BY filename %s", |
| 1535 | 1535 | zCiFull, filename_collation()); |
| 1536 | 1536 | db_prepare_blob(&q, &sql); |
| @@ -1538,11 +1538,11 @@ | ||
| 1538 | 1538 | const char * zFilename = db_column_text(&q, 0); |
| 1539 | 1539 | if(fileedit_is_editable(zFilename)){ |
| 1540 | 1540 | if(i++){ |
| 1541 | 1541 | CX(","); |
| 1542 | 1542 | } |
| 1543 | - CX("\"%j\"", zFilename); | |
| 1543 | + CX("%!j", zFilename); | |
| 1544 | 1544 | } |
| 1545 | 1545 | } |
| 1546 | 1546 | db_finalize(&q); |
| 1547 | 1547 | CX("]}"); |
| 1548 | 1548 | }else if(P("leaves")!=0){ |
| @@ -1558,13 +1558,13 @@ | ||
| 1558 | 1558 | while( SQLITE_ROW==db_step(&q) ){ |
| 1559 | 1559 | if(i++){ |
| 1560 | 1560 | CX(","); |
| 1561 | 1561 | } |
| 1562 | 1562 | CX("{"); |
| 1563 | - CX("\"checkin\":\"%j\",", db_column_text(&q, 1)); | |
| 1564 | - CX("\"timestamp\":\"%j\",", db_column_text(&q, 2)); | |
| 1565 | - CX("\"branch\":\"%j\"", db_column_text(&q, 7)); | |
| 1563 | + CX("\"checkin\":%!j,", db_column_text(&q, 1)); | |
| 1564 | + CX("\"timestamp\":%!j,", db_column_text(&q, 2)); | |
| 1565 | + CX("\"branch\":%!j", db_column_text(&q, 7)); | |
| 1566 | 1566 | CX("}"); |
| 1567 | 1567 | } |
| 1568 | 1568 | CX("]"); |
| 1569 | 1569 | db_finalize(&q); |
| 1570 | 1570 | }else{ |
| @@ -1631,14 +1631,14 @@ | ||
| 1631 | 1631 | } |
| 1632 | 1632 | assert(newVid>0); |
| 1633 | 1633 | zNewUuid = rid_to_uuid(newVid); |
| 1634 | 1634 | cgi_set_content_type("application/json"); |
| 1635 | 1635 | CX("{"); |
| 1636 | - CX("\"uuid\":\"%j\",", zNewUuid); | |
| 1636 | + CX("\"uuid\":%!j,", zNewUuid); | |
| 1637 | 1637 | CX("\"dryRun\": %s,", |
| 1638 | 1638 | (CIMINI_DRY_RUN & cimi.flags) ? "true" : "false"); |
| 1639 | - CX("\"manifest\": \"%j\"", blob_str(&manifest)); | |
| 1639 | + CX("\"manifest\": %!j", blob_str(&manifest)); | |
| 1640 | 1640 | CX("}"); |
| 1641 | 1641 | db_end_transaction(0/*noting that dry-run mode will have already |
| 1642 | 1642 | ** set this to rollback mode. */); |
| 1643 | 1643 | end_cleanup: |
| 1644 | 1644 | fossil_free(zNewUuid); |
| @@ -2053,17 +2053,17 @@ | ||
| 2053 | 2053 | blob_appendf(&endScript, |
| 2054 | 2054 | "window.addEventListener('load',"); |
| 2055 | 2055 | if(zRev && zFilename){ |
| 2056 | 2056 | assert(0==blob_size(&err)); |
| 2057 | 2057 | blob_appendf(&endScript, |
| 2058 | - "()=>fossil.page.loadFile(\"%j\",'%j')", | |
| 2058 | + "()=>fossil.page.loadFile(%!j,%!j)", | |
| 2059 | 2059 | zFilename, cimi.zParentUuid); |
| 2060 | 2060 | }else{ |
| 2061 | 2061 | blob_appendf(&endScript,"function(){"); |
| 2062 | 2062 | if(blob_size(&err)>0){ |
| 2063 | 2063 | blob_appendf(&endScript, |
| 2064 | - "fossil.error(\"%j\");\n", | |
| 2064 | + "fossil.error(%!j);\n", | |
| 2065 | 2065 | blob_str(&err)); |
| 2066 | 2066 | } |
| 2067 | 2067 | blob_appendf(&endScript, |
| 2068 | 2068 | "fossil.page.tabs.switchToTab(0);\n"); |
| 2069 | 2069 | blob_appendf(&endScript,"}"); |
| 2070 | 2070 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -1059,11 +1059,11 @@ | |
| 1059 | Blob content = empty_blob; |
| 1060 | va_list vargs; |
| 1061 | va_start(vargs,zFmt); |
| 1062 | blob_vappendf(&msg, zFmt, vargs); |
| 1063 | va_end(vargs); |
| 1064 | blob_appendf(&content,"{\"error\":\"%j\"}", blob_str(&msg)); |
| 1065 | blob_reset(&msg); |
| 1066 | cgi_set_content(&content); |
| 1067 | cgi_set_status(httpCode, "Error"); |
| 1068 | cgi_set_content_type("application/json"); |
| 1069 | } |
| @@ -1526,11 +1526,11 @@ | |
| 1526 | int vid = 0; |
| 1527 | if(0==fileedit_ajax_setup_filerev(zCi, &zCiFull, &vid, 0, 0)){ |
| 1528 | /* Error already reported */ |
| 1529 | return; |
| 1530 | } |
| 1531 | CX("{\"checkin\":\"%j\"," |
| 1532 | "\"editableFiles\":[", zCiFull); |
| 1533 | blob_append_sql(&sql, "SELECT filename FROM files_of_checkin(%Q) " |
| 1534 | "ORDER BY filename %s", |
| 1535 | zCiFull, filename_collation()); |
| 1536 | db_prepare_blob(&q, &sql); |
| @@ -1538,11 +1538,11 @@ | |
| 1538 | const char * zFilename = db_column_text(&q, 0); |
| 1539 | if(fileedit_is_editable(zFilename)){ |
| 1540 | if(i++){ |
| 1541 | CX(","); |
| 1542 | } |
| 1543 | CX("\"%j\"", zFilename); |
| 1544 | } |
| 1545 | } |
| 1546 | db_finalize(&q); |
| 1547 | CX("]}"); |
| 1548 | }else if(P("leaves")!=0){ |
| @@ -1558,13 +1558,13 @@ | |
| 1558 | while( SQLITE_ROW==db_step(&q) ){ |
| 1559 | if(i++){ |
| 1560 | CX(","); |
| 1561 | } |
| 1562 | CX("{"); |
| 1563 | CX("\"checkin\":\"%j\",", db_column_text(&q, 1)); |
| 1564 | CX("\"timestamp\":\"%j\",", db_column_text(&q, 2)); |
| 1565 | CX("\"branch\":\"%j\"", db_column_text(&q, 7)); |
| 1566 | CX("}"); |
| 1567 | } |
| 1568 | CX("]"); |
| 1569 | db_finalize(&q); |
| 1570 | }else{ |
| @@ -1631,14 +1631,14 @@ | |
| 1631 | } |
| 1632 | assert(newVid>0); |
| 1633 | zNewUuid = rid_to_uuid(newVid); |
| 1634 | cgi_set_content_type("application/json"); |
| 1635 | CX("{"); |
| 1636 | CX("\"uuid\":\"%j\",", zNewUuid); |
| 1637 | CX("\"dryRun\": %s,", |
| 1638 | (CIMINI_DRY_RUN & cimi.flags) ? "true" : "false"); |
| 1639 | CX("\"manifest\": \"%j\"", blob_str(&manifest)); |
| 1640 | CX("}"); |
| 1641 | db_end_transaction(0/*noting that dry-run mode will have already |
| 1642 | ** set this to rollback mode. */); |
| 1643 | end_cleanup: |
| 1644 | fossil_free(zNewUuid); |
| @@ -2053,17 +2053,17 @@ | |
| 2053 | blob_appendf(&endScript, |
| 2054 | "window.addEventListener('load',"); |
| 2055 | if(zRev && zFilename){ |
| 2056 | assert(0==blob_size(&err)); |
| 2057 | blob_appendf(&endScript, |
| 2058 | "()=>fossil.page.loadFile(\"%j\",'%j')", |
| 2059 | zFilename, cimi.zParentUuid); |
| 2060 | }else{ |
| 2061 | blob_appendf(&endScript,"function(){"); |
| 2062 | if(blob_size(&err)>0){ |
| 2063 | blob_appendf(&endScript, |
| 2064 | "fossil.error(\"%j\");\n", |
| 2065 | blob_str(&err)); |
| 2066 | } |
| 2067 | blob_appendf(&endScript, |
| 2068 | "fossil.page.tabs.switchToTab(0);\n"); |
| 2069 | blob_appendf(&endScript,"}"); |
| 2070 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -1059,11 +1059,11 @@ | |
| 1059 | Blob content = empty_blob; |
| 1060 | va_list vargs; |
| 1061 | va_start(vargs,zFmt); |
| 1062 | blob_vappendf(&msg, zFmt, vargs); |
| 1063 | va_end(vargs); |
| 1064 | blob_appendf(&content,"{\"error\":%!j}", blob_str(&msg)); |
| 1065 | blob_reset(&msg); |
| 1066 | cgi_set_content(&content); |
| 1067 | cgi_set_status(httpCode, "Error"); |
| 1068 | cgi_set_content_type("application/json"); |
| 1069 | } |
| @@ -1526,11 +1526,11 @@ | |
| 1526 | int vid = 0; |
| 1527 | if(0==fileedit_ajax_setup_filerev(zCi, &zCiFull, &vid, 0, 0)){ |
| 1528 | /* Error already reported */ |
| 1529 | return; |
| 1530 | } |
| 1531 | CX("{\"checkin\":%!j," |
| 1532 | "\"editableFiles\":[", zCiFull); |
| 1533 | blob_append_sql(&sql, "SELECT filename FROM files_of_checkin(%Q) " |
| 1534 | "ORDER BY filename %s", |
| 1535 | zCiFull, filename_collation()); |
| 1536 | db_prepare_blob(&q, &sql); |
| @@ -1538,11 +1538,11 @@ | |
| 1538 | const char * zFilename = db_column_text(&q, 0); |
| 1539 | if(fileedit_is_editable(zFilename)){ |
| 1540 | if(i++){ |
| 1541 | CX(","); |
| 1542 | } |
| 1543 | CX("%!j", zFilename); |
| 1544 | } |
| 1545 | } |
| 1546 | db_finalize(&q); |
| 1547 | CX("]}"); |
| 1548 | }else if(P("leaves")!=0){ |
| @@ -1558,13 +1558,13 @@ | |
| 1558 | while( SQLITE_ROW==db_step(&q) ){ |
| 1559 | if(i++){ |
| 1560 | CX(","); |
| 1561 | } |
| 1562 | CX("{"); |
| 1563 | CX("\"checkin\":%!j,", db_column_text(&q, 1)); |
| 1564 | CX("\"timestamp\":%!j,", db_column_text(&q, 2)); |
| 1565 | CX("\"branch\":%!j", db_column_text(&q, 7)); |
| 1566 | CX("}"); |
| 1567 | } |
| 1568 | CX("]"); |
| 1569 | db_finalize(&q); |
| 1570 | }else{ |
| @@ -1631,14 +1631,14 @@ | |
| 1631 | } |
| 1632 | assert(newVid>0); |
| 1633 | zNewUuid = rid_to_uuid(newVid); |
| 1634 | cgi_set_content_type("application/json"); |
| 1635 | CX("{"); |
| 1636 | CX("\"uuid\":%!j,", zNewUuid); |
| 1637 | CX("\"dryRun\": %s,", |
| 1638 | (CIMINI_DRY_RUN & cimi.flags) ? "true" : "false"); |
| 1639 | CX("\"manifest\": %!j", blob_str(&manifest)); |
| 1640 | CX("}"); |
| 1641 | db_end_transaction(0/*noting that dry-run mode will have already |
| 1642 | ** set this to rollback mode. */); |
| 1643 | end_cleanup: |
| 1644 | fossil_free(zNewUuid); |
| @@ -2053,17 +2053,17 @@ | |
| 2053 | blob_appendf(&endScript, |
| 2054 | "window.addEventListener('load',"); |
| 2055 | if(zRev && zFilename){ |
| 2056 | assert(0==blob_size(&err)); |
| 2057 | blob_appendf(&endScript, |
| 2058 | "()=>fossil.page.loadFile(%!j,%!j)", |
| 2059 | zFilename, cimi.zParentUuid); |
| 2060 | }else{ |
| 2061 | blob_appendf(&endScript,"function(){"); |
| 2062 | if(blob_size(&err)>0){ |
| 2063 | blob_appendf(&endScript, |
| 2064 | "fossil.error(%!j);\n", |
| 2065 | blob_str(&err)); |
| 2066 | } |
| 2067 | blob_appendf(&endScript, |
| 2068 | "fossil.page.tabs.switchToTab(0);\n"); |
| 2069 | blob_appendf(&endScript,"}"); |
| 2070 |
+2
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1529,14 +1529,14 @@ | ||
| 1529 | 1529 | /* Set up the generic/app-agnostic parts of window.fossil |
| 1530 | 1530 | ** which require C-level state... */ |
| 1531 | 1531 | style_emit_script_tag(0,0); |
| 1532 | 1532 | CX("(function(){\n" |
| 1533 | 1533 | "if(!window.fossil) window.fossil={};\n" |
| 1534 | - "window.fossil.version = \"%j\";\n" | |
| 1534 | + "window.fossil.version = %!j;\n" | |
| 1535 | 1535 | /* fossil.rootPath is the top-most CGI/server path, |
| 1536 | 1536 | ** including a trailing slash. */ |
| 1537 | - "window.fossil.rootPath = \"%j\"+'/';\n", | |
| 1537 | + "window.fossil.rootPath = %!j+'/';\n", | |
| 1538 | 1538 | get_version(), g.zTop); |
| 1539 | 1539 | /* fossil.config = {...various config-level options...} */ |
| 1540 | 1540 | CX("window.fossil.config = {" |
| 1541 | 1541 | "hashDigits: %d, hashDigitsUrl: %d" |
| 1542 | 1542 | "};\n", hash_digits(0), hash_digits(1)); |
| 1543 | 1543 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1529,14 +1529,14 @@ | |
| 1529 | /* Set up the generic/app-agnostic parts of window.fossil |
| 1530 | ** which require C-level state... */ |
| 1531 | style_emit_script_tag(0,0); |
| 1532 | CX("(function(){\n" |
| 1533 | "if(!window.fossil) window.fossil={};\n" |
| 1534 | "window.fossil.version = \"%j\";\n" |
| 1535 | /* fossil.rootPath is the top-most CGI/server path, |
| 1536 | ** including a trailing slash. */ |
| 1537 | "window.fossil.rootPath = \"%j\"+'/';\n", |
| 1538 | get_version(), g.zTop); |
| 1539 | /* fossil.config = {...various config-level options...} */ |
| 1540 | CX("window.fossil.config = {" |
| 1541 | "hashDigits: %d, hashDigitsUrl: %d" |
| 1542 | "};\n", hash_digits(0), hash_digits(1)); |
| 1543 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -1529,14 +1529,14 @@ | |
| 1529 | /* Set up the generic/app-agnostic parts of window.fossil |
| 1530 | ** which require C-level state... */ |
| 1531 | style_emit_script_tag(0,0); |
| 1532 | CX("(function(){\n" |
| 1533 | "if(!window.fossil) window.fossil={};\n" |
| 1534 | "window.fossil.version = %!j;\n" |
| 1535 | /* fossil.rootPath is the top-most CGI/server path, |
| 1536 | ** including a trailing slash. */ |
| 1537 | "window.fossil.rootPath = %!j+'/';\n", |
| 1538 | get_version(), g.zTop); |
| 1539 | /* fossil.config = {...various config-level options...} */ |
| 1540 | CX("window.fossil.config = {" |
| 1541 | "hashDigits: %d, hashDigitsUrl: %d" |
| 1542 | "};\n", hash_digits(0), hash_digits(1)); |
| 1543 |