Fossil SCM
fix for 'no repo' prompt in the shell for unnamed projects ([https://fossil-scm.org/forum/forumpost/387c0a76f9|/forumpost/387c0a76f9]).
Commit
2d9ad2dbb92aacf1d0780710f3bce3017e468065e074dddcdfeed8a53a6db796
Parent
acbbc133e125a5b…
1 file changed
+5
-1
+5
-1
| --- src/fshell.c | ||
| +++ src/fshell.c | ||
| @@ -60,11 +60,15 @@ | ||
| 60 | 60 | pid_t childPid; |
| 61 | 61 | char *zLine = 0; |
| 62 | 62 | char *zPrompt = 0; |
| 63 | 63 | fDebug = find_option("debug", 0, 0)!=0; |
| 64 | 64 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 65 | - zPrompt = mprintf("fossil (%z)> ", db_get("project-name","no repo")); | |
| 65 | + if(g.zRepositoryName!=0){ | |
| 66 | + zPrompt = mprintf("fossil (%z)> ", db_get("project-name","unnamed")); | |
| 67 | + }else{ | |
| 68 | + zPrompt = mprintf("fossil (no repo)> "); | |
| 69 | + } | |
| 66 | 70 | db_close(0); |
| 67 | 71 | sqlite3_shutdown(); |
| 68 | 72 | linenoiseSetMultiLine(1); |
| 69 | 73 | while( (free(zLine), zLine = linenoise(zPrompt)) ){ |
| 70 | 74 | /* Remember shell history within the current session */ |
| 71 | 75 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -60,11 +60,15 @@ | |
| 60 | pid_t childPid; |
| 61 | char *zLine = 0; |
| 62 | char *zPrompt = 0; |
| 63 | fDebug = find_option("debug", 0, 0)!=0; |
| 64 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 65 | zPrompt = mprintf("fossil (%z)> ", db_get("project-name","no repo")); |
| 66 | db_close(0); |
| 67 | sqlite3_shutdown(); |
| 68 | linenoiseSetMultiLine(1); |
| 69 | while( (free(zLine), zLine = linenoise(zPrompt)) ){ |
| 70 | /* Remember shell history within the current session */ |
| 71 |
| --- src/fshell.c | |
| +++ src/fshell.c | |
| @@ -60,11 +60,15 @@ | |
| 60 | pid_t childPid; |
| 61 | char *zLine = 0; |
| 62 | char *zPrompt = 0; |
| 63 | fDebug = find_option("debug", 0, 0)!=0; |
| 64 | db_find_and_open_repository(OPEN_ANY_SCHEMA|OPEN_OK_NOT_FOUND, 0); |
| 65 | if(g.zRepositoryName!=0){ |
| 66 | zPrompt = mprintf("fossil (%z)> ", db_get("project-name","unnamed")); |
| 67 | }else{ |
| 68 | zPrompt = mprintf("fossil (no repo)> "); |
| 69 | } |
| 70 | db_close(0); |
| 71 | sqlite3_shutdown(); |
| 72 | linenoiseSetMultiLine(1); |
| 73 | while( (free(zLine), zLine = linenoise(zPrompt)) ){ |
| 74 | /* Remember shell history within the current session */ |
| 75 |