Fossil SCM
Add the undocumented "fossil remote config-data" command.
Commit
6cdddee2bd1358bcf9f3e730067e3f42c284c21df177771a598d5cb773d4d4a2
Parent
31361e328f89cbd…
1 file changed
+29
+29
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -613,10 +613,39 @@ | ||
| 613 | 613 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-pw:*'"); |
| 614 | 614 | db_multi_exec("DELETE FROM config WHERE name = 'last-sync-pw'"); |
| 615 | 615 | db_protect_pop(); |
| 616 | 616 | db_commit_transaction(); |
| 617 | 617 | return; |
| 618 | + } | |
| 619 | + if( strncmp(zArg, "config-data", nArg)==0 ){ | |
| 620 | + /* Undocumented command: "fossil remote config-data" | |
| 621 | + ** | |
| 622 | + ** Show the CONFIG table entries that relate to remembering remote URLs | |
| 623 | + */ | |
| 624 | + Stmt q; | |
| 625 | + int n; | |
| 626 | + n = db_int(13, | |
| 627 | + "SELECT max(length(name))" | |
| 628 | + " FROM config" | |
| 629 | + " WHERE name GLOB 'sync-*:*' OR name GLOB 'last-sync-*'" | |
| 630 | + ); | |
| 631 | + db_prepare(&q, | |
| 632 | + "SELECT name," | |
| 633 | + " CASE WHEN name LIKE '%%sync-pw%%'" | |
| 634 | + " THEN printf('%%.*c',length(value),'*') ELSE value END" | |
| 635 | + " FROM config" | |
| 636 | + " WHERE name GLOB 'sync-*:*' OR name GLOB 'last-sync-*'" | |
| 637 | + " ORDER BY name LIKE '%%sync-pw%%', name" | |
| 638 | + ); | |
| 639 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 640 | + fossil_print("%-*s %s\n", | |
| 641 | + n, db_column_text(&q,0), | |
| 642 | + db_column_text(&q,1) | |
| 643 | + ); | |
| 644 | + } | |
| 645 | + db_finalize(&q); | |
| 646 | + return; | |
| 618 | 647 | } |
| 619 | 648 | if( sqlite3_strlike("http://%",zArg,0)==0 |
| 620 | 649 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 621 | 650 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 622 | 651 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 623 | 652 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -613,10 +613,39 @@ | |
| 613 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-pw:*'"); |
| 614 | db_multi_exec("DELETE FROM config WHERE name = 'last-sync-pw'"); |
| 615 | db_protect_pop(); |
| 616 | db_commit_transaction(); |
| 617 | return; |
| 618 | } |
| 619 | if( sqlite3_strlike("http://%",zArg,0)==0 |
| 620 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 621 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 622 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 623 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -613,10 +613,39 @@ | |
| 613 | db_multi_exec("DELETE FROM config WHERE name glob 'sync-pw:*'"); |
| 614 | db_multi_exec("DELETE FROM config WHERE name = 'last-sync-pw'"); |
| 615 | db_protect_pop(); |
| 616 | db_commit_transaction(); |
| 617 | return; |
| 618 | } |
| 619 | if( strncmp(zArg, "config-data", nArg)==0 ){ |
| 620 | /* Undocumented command: "fossil remote config-data" |
| 621 | ** |
| 622 | ** Show the CONFIG table entries that relate to remembering remote URLs |
| 623 | */ |
| 624 | Stmt q; |
| 625 | int n; |
| 626 | n = db_int(13, |
| 627 | "SELECT max(length(name))" |
| 628 | " FROM config" |
| 629 | " WHERE name GLOB 'sync-*:*' OR name GLOB 'last-sync-*'" |
| 630 | ); |
| 631 | db_prepare(&q, |
| 632 | "SELECT name," |
| 633 | " CASE WHEN name LIKE '%%sync-pw%%'" |
| 634 | " THEN printf('%%.*c',length(value),'*') ELSE value END" |
| 635 | " FROM config" |
| 636 | " WHERE name GLOB 'sync-*:*' OR name GLOB 'last-sync-*'" |
| 637 | " ORDER BY name LIKE '%%sync-pw%%', name" |
| 638 | ); |
| 639 | while( db_step(&q)==SQLITE_ROW ){ |
| 640 | fossil_print("%-*s %s\n", |
| 641 | n, db_column_text(&q,0), |
| 642 | db_column_text(&q,1) |
| 643 | ); |
| 644 | } |
| 645 | db_finalize(&q); |
| 646 | return; |
| 647 | } |
| 648 | if( sqlite3_strlike("http://%",zArg,0)==0 |
| 649 | || sqlite3_strlike("https://%",zArg,0)==0 |
| 650 | || sqlite3_strlike("ssh:%",zArg,0)==0 |
| 651 | || sqlite3_strlike("file:%",zArg,0)==0 |
| 652 |