Fossil SCM

Teach ci --wiki FILENAME to not send a separate notification for the attached wiki page, per /chat request.

stephan 2026-11-16 21:31 UTC trunk
Commit d7c8ce5267582d02eb1cc14c9d67313bb4642659997c29e77d706d05e880547f
2 files changed +5 -1 +5 -2
+5 -1
--- src/checkin.c
+++ src/checkin.c
@@ -3321,10 +3321,12 @@
33213321
if( zWikiFile ){
33223322
/* Handle --wiki and --wiki-mimetype */
33233323
Blob bWiki = BLOB_INITIALIZER;
33243324
char * zPageName;
33253325
int parentRid = 0;
3326
+ int nrid;
3327
+
33263328
blob_read_from_file(&bWiki, zWikiFile, ExtFILE);
33273329
if( !zWikiMime ){
33283330
if( 0==sqlite3_strglob("*.md", zWikiFile) ){
33293331
zWikiMime = "text/x-markdown";
33303332
}else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){
@@ -3333,14 +3335,16 @@
33333335
zWikiMime = "text/plain";
33343336
}
33353337
}
33363338
zPageName = mprintf("checkin/%s", zUuid);
33373339
zWikiMime = wiki_filter_mimetypes(zWikiMime);
3338
- wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1);
3340
+ nrid = wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1);
33393341
fossil_print("Added %s (%s)\n", zPageName, zWikiMime);
33403342
blob_reset(&bWiki);
33413343
fossil_free(zPageName);
3344
+ assert( nrid > 0 );
3345
+ alert_unqueue('w', nrid);
33423346
}
33433347
33443348
/* Clear the undo/redo stack */
33453349
undo_reset();
33463350
33473351
--- 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 @@
20672067
** The content of the new page is given by the blob pContent.
20682068
**
20692069
** zMimeType specifies the N-card for the wiki page. If it is 0,
20702070
** empty, or "text/x-fossil-wiki" (the default format) then it is
20712071
** ignored.
2072
+**
2073
+** Returns the new page's RID.
20722074
*/
20732075
int wiki_cmd_commit(const char *zPageName, int rid, Blob *pContent,
20742076
const char *zMimeType, int localUser){
20752077
Blob wiki; /* Wiki page content */
20762078
Blob cksum; /* wiki checksum */
20772079
char *zDate; /* timestamp */
2080
+ int nrid;
20782081
20792082
blob_zero(&wiki);
20802083
zDate = date_in_standard_format("now");
20812084
blob_appendf(&wiki, "D %s\n", zDate);
20822085
free(zDate);
@@ -2097,13 +2100,13 @@
20972100
blob_str(pContent) );
20982101
md5sum_blob(&wiki, &cksum);
20992102
blob_appendf(&wiki, "Z %b\n", &cksum);
21002103
blob_reset(&cksum);
21012104
db_begin_transaction();
2102
- wiki_put(&wiki, 0, wiki_need_moderation(localUser));
2105
+ nrid = wiki_put(&wiki, 0, wiki_need_moderation(localUser));
21032106
db_end_transaction(0);
2104
- return 1;
2107
+ return nrid;
21052108
}
21062109
21072110
/*
21082111
** Determine the rid for a tech note given either its id, its timestamp,
21092112
** or its tag. Returns 0 if there is no such item and -1 if the details
21102113
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button