Fossil SCM
Teach ci --wiki FILENAME to not send a separate notification for the attached wiki page, per /chat request.
Commit
d7c8ce5267582d02eb1cc14c9d67313bb4642659997c29e77d706d05e880547f
Parent
7e8ecf0ce4a3c05…
2 files changed
+5
-1
+5
-2
+5
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -3321,10 +3321,12 @@ | ||
| 3321 | 3321 | if( zWikiFile ){ |
| 3322 | 3322 | /* Handle --wiki and --wiki-mimetype */ |
| 3323 | 3323 | Blob bWiki = BLOB_INITIALIZER; |
| 3324 | 3324 | char * zPageName; |
| 3325 | 3325 | int parentRid = 0; |
| 3326 | + int nrid; | |
| 3327 | + | |
| 3326 | 3328 | blob_read_from_file(&bWiki, zWikiFile, ExtFILE); |
| 3327 | 3329 | if( !zWikiMime ){ |
| 3328 | 3330 | if( 0==sqlite3_strglob("*.md", zWikiFile) ){ |
| 3329 | 3331 | zWikiMime = "text/x-markdown"; |
| 3330 | 3332 | }else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){ |
| @@ -3333,14 +3335,16 @@ | ||
| 3333 | 3335 | zWikiMime = "text/plain"; |
| 3334 | 3336 | } |
| 3335 | 3337 | } |
| 3336 | 3338 | zPageName = mprintf("checkin/%s", zUuid); |
| 3337 | 3339 | zWikiMime = wiki_filter_mimetypes(zWikiMime); |
| 3338 | - wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1); | |
| 3340 | + nrid = wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1); | |
| 3339 | 3341 | fossil_print("Added %s (%s)\n", zPageName, zWikiMime); |
| 3340 | 3342 | blob_reset(&bWiki); |
| 3341 | 3343 | fossil_free(zPageName); |
| 3344 | + assert( nrid > 0 ); | |
| 3345 | + alert_unqueue('w', nrid); | |
| 3342 | 3346 | } |
| 3343 | 3347 | |
| 3344 | 3348 | /* Clear the undo/redo stack */ |
| 3345 | 3349 | undo_reset(); |
| 3346 | 3350 | |
| 3347 | 3351 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -3321,10 +3321,12 @@ | |
| 3321 | if( zWikiFile ){ |
| 3322 | /* Handle --wiki and --wiki-mimetype */ |
| 3323 | Blob bWiki = BLOB_INITIALIZER; |
| 3324 | char * zPageName; |
| 3325 | int parentRid = 0; |
| 3326 | blob_read_from_file(&bWiki, zWikiFile, ExtFILE); |
| 3327 | if( !zWikiMime ){ |
| 3328 | if( 0==sqlite3_strglob("*.md", zWikiFile) ){ |
| 3329 | zWikiMime = "text/x-markdown"; |
| 3330 | }else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){ |
| @@ -3333,14 +3335,16 @@ | |
| 3333 | zWikiMime = "text/plain"; |
| 3334 | } |
| 3335 | } |
| 3336 | zPageName = mprintf("checkin/%s", zUuid); |
| 3337 | zWikiMime = wiki_filter_mimetypes(zWikiMime); |
| 3338 | wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1); |
| 3339 | fossil_print("Added %s (%s)\n", zPageName, zWikiMime); |
| 3340 | blob_reset(&bWiki); |
| 3341 | fossil_free(zPageName); |
| 3342 | } |
| 3343 | |
| 3344 | /* Clear the undo/redo stack */ |
| 3345 | undo_reset(); |
| 3346 | |
| 3347 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -3321,10 +3321,12 @@ | |
| 3321 | if( zWikiFile ){ |
| 3322 | /* Handle --wiki and --wiki-mimetype */ |
| 3323 | Blob bWiki = BLOB_INITIALIZER; |
| 3324 | char * zPageName; |
| 3325 | int parentRid = 0; |
| 3326 | int nrid; |
| 3327 | |
| 3328 | blob_read_from_file(&bWiki, zWikiFile, ExtFILE); |
| 3329 | if( !zWikiMime ){ |
| 3330 | if( 0==sqlite3_strglob("*.md", zWikiFile) ){ |
| 3331 | zWikiMime = "text/x-markdown"; |
| 3332 | }else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){ |
| @@ -3333,14 +3335,16 @@ | |
| 3335 | zWikiMime = "text/plain"; |
| 3336 | } |
| 3337 | } |
| 3338 | zPageName = mprintf("checkin/%s", zUuid); |
| 3339 | zWikiMime = wiki_filter_mimetypes(zWikiMime); |
| 3340 | nrid = wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1); |
| 3341 | fossil_print("Added %s (%s)\n", zPageName, zWikiMime); |
| 3342 | blob_reset(&bWiki); |
| 3343 | fossil_free(zPageName); |
| 3344 | assert( nrid > 0 ); |
| 3345 | alert_unqueue('w', nrid); |
| 3346 | } |
| 3347 | |
| 3348 | /* Clear the undo/redo stack */ |
| 3349 | undo_reset(); |
| 3350 | |
| 3351 |
+5
-2
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -2067,16 +2067,19 @@ | ||
| 2067 | 2067 | ** The content of the new page is given by the blob pContent. |
| 2068 | 2068 | ** |
| 2069 | 2069 | ** zMimeType specifies the N-card for the wiki page. If it is 0, |
| 2070 | 2070 | ** empty, or "text/x-fossil-wiki" (the default format) then it is |
| 2071 | 2071 | ** ignored. |
| 2072 | +** | |
| 2073 | +** Returns the new page's RID. | |
| 2072 | 2074 | */ |
| 2073 | 2075 | int wiki_cmd_commit(const char *zPageName, int rid, Blob *pContent, |
| 2074 | 2076 | const char *zMimeType, int localUser){ |
| 2075 | 2077 | Blob wiki; /* Wiki page content */ |
| 2076 | 2078 | Blob cksum; /* wiki checksum */ |
| 2077 | 2079 | char *zDate; /* timestamp */ |
| 2080 | + int nrid; | |
| 2078 | 2081 | |
| 2079 | 2082 | blob_zero(&wiki); |
| 2080 | 2083 | zDate = date_in_standard_format("now"); |
| 2081 | 2084 | blob_appendf(&wiki, "D %s\n", zDate); |
| 2082 | 2085 | free(zDate); |
| @@ -2097,13 +2100,13 @@ | ||
| 2097 | 2100 | blob_str(pContent) ); |
| 2098 | 2101 | md5sum_blob(&wiki, &cksum); |
| 2099 | 2102 | blob_appendf(&wiki, "Z %b\n", &cksum); |
| 2100 | 2103 | blob_reset(&cksum); |
| 2101 | 2104 | db_begin_transaction(); |
| 2102 | - wiki_put(&wiki, 0, wiki_need_moderation(localUser)); | |
| 2105 | + nrid = wiki_put(&wiki, 0, wiki_need_moderation(localUser)); | |
| 2103 | 2106 | db_end_transaction(0); |
| 2104 | - return 1; | |
| 2107 | + return nrid; | |
| 2105 | 2108 | } |
| 2106 | 2109 | |
| 2107 | 2110 | /* |
| 2108 | 2111 | ** Determine the rid for a tech note given either its id, its timestamp, |
| 2109 | 2112 | ** or its tag. Returns 0 if there is no such item and -1 if the details |
| 2110 | 2113 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -2067,16 +2067,19 @@ | |
| 2067 | ** The content of the new page is given by the blob pContent. |
| 2068 | ** |
| 2069 | ** zMimeType specifies the N-card for the wiki page. If it is 0, |
| 2070 | ** empty, or "text/x-fossil-wiki" (the default format) then it is |
| 2071 | ** ignored. |
| 2072 | */ |
| 2073 | int wiki_cmd_commit(const char *zPageName, int rid, Blob *pContent, |
| 2074 | const char *zMimeType, int localUser){ |
| 2075 | Blob wiki; /* Wiki page content */ |
| 2076 | Blob cksum; /* wiki checksum */ |
| 2077 | char *zDate; /* timestamp */ |
| 2078 | |
| 2079 | blob_zero(&wiki); |
| 2080 | zDate = date_in_standard_format("now"); |
| 2081 | blob_appendf(&wiki, "D %s\n", zDate); |
| 2082 | free(zDate); |
| @@ -2097,13 +2100,13 @@ | |
| 2097 | blob_str(pContent) ); |
| 2098 | md5sum_blob(&wiki, &cksum); |
| 2099 | blob_appendf(&wiki, "Z %b\n", &cksum); |
| 2100 | blob_reset(&cksum); |
| 2101 | db_begin_transaction(); |
| 2102 | wiki_put(&wiki, 0, wiki_need_moderation(localUser)); |
| 2103 | db_end_transaction(0); |
| 2104 | return 1; |
| 2105 | } |
| 2106 | |
| 2107 | /* |
| 2108 | ** Determine the rid for a tech note given either its id, its timestamp, |
| 2109 | ** or its tag. Returns 0 if there is no such item and -1 if the details |
| 2110 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -2067,16 +2067,19 @@ | |
| 2067 | ** The content of the new page is given by the blob pContent. |
| 2068 | ** |
| 2069 | ** zMimeType specifies the N-card for the wiki page. If it is 0, |
| 2070 | ** empty, or "text/x-fossil-wiki" (the default format) then it is |
| 2071 | ** ignored. |
| 2072 | ** |
| 2073 | ** Returns the new page's RID. |
| 2074 | */ |
| 2075 | int wiki_cmd_commit(const char *zPageName, int rid, Blob *pContent, |
| 2076 | const char *zMimeType, int localUser){ |
| 2077 | Blob wiki; /* Wiki page content */ |
| 2078 | Blob cksum; /* wiki checksum */ |
| 2079 | char *zDate; /* timestamp */ |
| 2080 | int nrid; |
| 2081 | |
| 2082 | blob_zero(&wiki); |
| 2083 | zDate = date_in_standard_format("now"); |
| 2084 | blob_appendf(&wiki, "D %s\n", zDate); |
| 2085 | free(zDate); |
| @@ -2097,13 +2100,13 @@ | |
| 2100 | blob_str(pContent) ); |
| 2101 | md5sum_blob(&wiki, &cksum); |
| 2102 | blob_appendf(&wiki, "Z %b\n", &cksum); |
| 2103 | blob_reset(&cksum); |
| 2104 | db_begin_transaction(); |
| 2105 | nrid = wiki_put(&wiki, 0, wiki_need_moderation(localUser)); |
| 2106 | db_end_transaction(0); |
| 2107 | return nrid; |
| 2108 | } |
| 2109 | |
| 2110 | /* |
| 2111 | ** Determine the rid for a tech note given either its id, its timestamp, |
| 2112 | ** or its tag. Returns 0 if there is no such item and -1 if the details |
| 2113 |