Fossil SCM

Rename --wiki-file to --wiki/-w and add -wm alias for --wiki-mimetype. When --wiki is used with --branch, associate the new page with the branch instead of the check-in.

stephan 2026-11-13 10:55 UTC ci-wiki
Commit 033412b16346dba7ea66a38cbf6fab6b49ffd93c86126358264a0ef355ee071a
2 files changed +15 -8 +3 -3
+15 -8
--- src/checkin.c
+++ src/checkin.c
@@ -2534,13 +2534,14 @@
25342534
** --proxy PROXY Use PROXY as http proxy during sync operation
25352535
** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated.
25362536
** --trace Debug tracing
25372537
** --user-override USER Record USER as the login that created the
25382538
** new check-in, rather that the current user.
2539
-** --wiki-file FILE Adds FILE's content as a wiki page associated
2540
-** with this check-in.
2541
-** --wiki-mimetype TYPE Mimetype for --wiki-file. Default is from the
2539
+** -w|--wiki FILE Adds FILE's content as a wiki page associated
2540
+** with this check-in or, if used with --branch,
2541
+** the branch.
2542
+** --wm|--wiki-mimetype TYPE Mimetype for --wiki-file. Default is from the
25422543
** file extension: .md=markdown, .wiki=fossil,
25432544
** otherwise plain text. Accepts "markdown",
25442545
** "wiki", and "plain" as aliases.
25452546
**
25462547
** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]]
@@ -2593,11 +2594,11 @@
25932594
int bIgnoreSkew = 0; /* --ignore-clock-skew flag */
25942595
int mxSize;
25952596
char *zCurBranch = 0; /* The current branch name of checkout */
25962597
char *zNewBranch = 0; /* The branch name after update */
25972598
int ckComFlgs; /* Flags passed to verify_comment() */
2598
- const char * zWikiFile; /* --wiki-file X */
2599
+ const char * zWikiFile; /* --wiki X */
25992600
const char * zWikiMime; /* --wiki-mimetype X */
26002601
26012602
memset(&sCiInfo, 0, sizeof(sCiInfo));
26022603
url_proxy_options();
26032604
/* Undocumented. Supported only for backwards
@@ -2663,12 +2664,12 @@
26632664
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
26642665
useCksum = db_get_boolean("repo-cksum", 1);
26652666
bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0;
26662667
mxSize = db_large_file_size();
26672668
if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0;
2668
- zWikiFile = find_option("wiki-file",0,1);
2669
- zWikiMime = find_option("wiki-mimetype",0,1);
2669
+ zWikiFile = find_option("wiki","w",1);
2670
+ zWikiMime = find_option("wiki-mimetype","wm",1);
26702671
(void)fossil_text_editor();
26712672
verify_all_options();
26722673
26732674
/* The --no-warnings flag and the --force flag each imply
26742675
** the --no-verify-comment flag */
@@ -3320,10 +3321,11 @@
33203321
33213322
if( zWikiFile ){
33223323
/* Handle --wiki-file and --wiki-mimetype */
33233324
Blob bWiki = BLOB_INITIALIZER;
33243325
char * zPageName;
3326
+ int parentRid = 0;
33253327
blob_read_from_file(&bWiki, zWikiFile, ExtFILE);
33263328
if( !zWikiMime ){
33273329
if( 0==sqlite3_strglob("*.md", zWikiFile) ){
33283330
zWikiMime = "text/x-markdown";
33293331
}else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){
@@ -3330,13 +3332,18 @@
33303332
zWikiMime = "text/x-fossil-wiki";
33313333
}else{
33323334
zWikiMime = "text/plain";
33333335
}
33343336
}
3337
+ if( sCiInfo.zBranch ){
3338
+ zPageName = mprintf("branch/%s", sCiInfo.zBranch);
3339
+ wiki_fetch_by_name(zPageName, 0, &parentRid, 0);
3340
+ }else{
3341
+ zPageName = mprintf("checkin/%s", zUuid);
3342
+ }
33353343
zWikiMime = wiki_filter_mimetypes(zWikiMime);
3336
- zPageName = mprintf("checkin/%s", zUuid);
3337
- wiki_cmd_commit(zPageName, 0, &bWiki, zWikiMime, 0);
3344
+ wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1);
33383345
fossil_print("Added %s (%s)\n", zPageName, zWikiMime);
33393346
blob_reset(&bWiki);
33403347
fossil_free(zPageName);
33413348
}
33423349
33433350
--- src/checkin.c
+++ src/checkin.c
@@ -2534,13 +2534,14 @@
2534 ** --proxy PROXY Use PROXY as http proxy during sync operation
2535 ** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated.
2536 ** --trace Debug tracing
2537 ** --user-override USER Record USER as the login that created the
2538 ** new check-in, rather that the current user.
2539 ** --wiki-file FILE Adds FILE's content as a wiki page associated
2540 ** with this check-in.
2541 ** --wiki-mimetype TYPE Mimetype for --wiki-file. Default is from the
 
2542 ** file extension: .md=markdown, .wiki=fossil,
2543 ** otherwise plain text. Accepts "markdown",
2544 ** "wiki", and "plain" as aliases.
2545 **
2546 ** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]]
@@ -2593,11 +2594,11 @@
2593 int bIgnoreSkew = 0; /* --ignore-clock-skew flag */
2594 int mxSize;
2595 char *zCurBranch = 0; /* The current branch name of checkout */
2596 char *zNewBranch = 0; /* The branch name after update */
2597 int ckComFlgs; /* Flags passed to verify_comment() */
2598 const char * zWikiFile; /* --wiki-file X */
2599 const char * zWikiMime; /* --wiki-mimetype X */
2600
2601 memset(&sCiInfo, 0, sizeof(sCiInfo));
2602 url_proxy_options();
2603 /* Undocumented. Supported only for backwards
@@ -2663,12 +2664,12 @@
2663 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
2664 useCksum = db_get_boolean("repo-cksum", 1);
2665 bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0;
2666 mxSize = db_large_file_size();
2667 if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0;
2668 zWikiFile = find_option("wiki-file",0,1);
2669 zWikiMime = find_option("wiki-mimetype",0,1);
2670 (void)fossil_text_editor();
2671 verify_all_options();
2672
2673 /* The --no-warnings flag and the --force flag each imply
2674 ** the --no-verify-comment flag */
@@ -3320,10 +3321,11 @@
3320
3321 if( zWikiFile ){
3322 /* Handle --wiki-file and --wiki-mimetype */
3323 Blob bWiki = BLOB_INITIALIZER;
3324 char * zPageName;
 
3325 blob_read_from_file(&bWiki, zWikiFile, ExtFILE);
3326 if( !zWikiMime ){
3327 if( 0==sqlite3_strglob("*.md", zWikiFile) ){
3328 zWikiMime = "text/x-markdown";
3329 }else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){
@@ -3330,13 +3332,18 @@
3330 zWikiMime = "text/x-fossil-wiki";
3331 }else{
3332 zWikiMime = "text/plain";
3333 }
3334 }
 
 
 
 
 
 
3335 zWikiMime = wiki_filter_mimetypes(zWikiMime);
3336 zPageName = mprintf("checkin/%s", zUuid);
3337 wiki_cmd_commit(zPageName, 0, &bWiki, zWikiMime, 0);
3338 fossil_print("Added %s (%s)\n", zPageName, zWikiMime);
3339 blob_reset(&bWiki);
3340 fossil_free(zPageName);
3341 }
3342
3343
--- src/checkin.c
+++ src/checkin.c
@@ -2534,13 +2534,14 @@
2534 ** --proxy PROXY Use PROXY as http proxy during sync operation
2535 ** --tag TAG-NAME Add TAG-NAME to the check-in. May be repeated.
2536 ** --trace Debug tracing
2537 ** --user-override USER Record USER as the login that created the
2538 ** new check-in, rather that the current user.
2539 ** -w|--wiki FILE Adds FILE's content as a wiki page associated
2540 ** with this check-in or, if used with --branch,
2541 ** the branch.
2542 ** --wm|--wiki-mimetype TYPE Mimetype for --wiki-file. Default is from the
2543 ** file extension: .md=markdown, .wiki=fossil,
2544 ** otherwise plain text. Accepts "markdown",
2545 ** "wiki", and "plain" as aliases.
2546 **
2547 ** See also: [[branch]], [[changes]], [[update]], [[extras]], [[sync]]
@@ -2593,11 +2594,11 @@
2594 int bIgnoreSkew = 0; /* --ignore-clock-skew flag */
2595 int mxSize;
2596 char *zCurBranch = 0; /* The current branch name of checkout */
2597 char *zNewBranch = 0; /* The branch name after update */
2598 int ckComFlgs; /* Flags passed to verify_comment() */
2599 const char * zWikiFile; /* --wiki X */
2600 const char * zWikiMime; /* --wiki-mimetype X */
2601
2602 memset(&sCiInfo, 0, sizeof(sCiInfo));
2603 url_proxy_options();
2604 /* Undocumented. Supported only for backwards
@@ -2663,12 +2664,12 @@
2664 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
2665 useCksum = db_get_boolean("repo-cksum", 1);
2666 bIgnoreSkew = find_option("ignore-clock-skew",0,0)!=0;
2667 mxSize = db_large_file_size();
2668 if( find_option("ignore-oversize",0,0)!=0 ) mxSize = 0;
2669 zWikiFile = find_option("wiki","w",1);
2670 zWikiMime = find_option("wiki-mimetype","wm",1);
2671 (void)fossil_text_editor();
2672 verify_all_options();
2673
2674 /* The --no-warnings flag and the --force flag each imply
2675 ** the --no-verify-comment flag */
@@ -3320,10 +3321,11 @@
3321
3322 if( zWikiFile ){
3323 /* Handle --wiki-file and --wiki-mimetype */
3324 Blob bWiki = BLOB_INITIALIZER;
3325 char * zPageName;
3326 int parentRid = 0;
3327 blob_read_from_file(&bWiki, zWikiFile, ExtFILE);
3328 if( !zWikiMime ){
3329 if( 0==sqlite3_strglob("*.md", zWikiFile) ){
3330 zWikiMime = "text/x-markdown";
3331 }else if( 0==sqlite3_strglob("*.wiki", zWikiFile) ){
@@ -3330,13 +3332,18 @@
3332 zWikiMime = "text/x-fossil-wiki";
3333 }else{
3334 zWikiMime = "text/plain";
3335 }
3336 }
3337 if( sCiInfo.zBranch ){
3338 zPageName = mprintf("branch/%s", sCiInfo.zBranch);
3339 wiki_fetch_by_name(zPageName, 0, &parentRid, 0);
3340 }else{
3341 zPageName = mprintf("checkin/%s", zUuid);
3342 }
3343 zWikiMime = wiki_filter_mimetypes(zWikiMime);
3344 wiki_cmd_commit(zPageName, parentRid, &bWiki, zWikiMime, 1);
 
3345 fossil_print("Added %s (%s)\n", zPageName, zWikiMime);
3346 blob_reset(&bWiki);
3347 fossil_free(zPageName);
3348 }
3349
3350
+3 -3
--- src/wiki.c
+++ src/wiki.c
@@ -725,13 +725,13 @@
725725
** If pRid is not NULL then if a result is found *pRid is set to its
726726
** RID. If ppWiki is not NULL then if found *ppWiki is set to the
727727
** loaded wiki object, which the caller is responsible for passing to
728728
** manifest_destroy().
729729
*/
730
-static int wiki_fetch_by_name( const char *zPageName,
731
- unsigned int versionsBack,
732
- int * pRid, Manifest **ppWiki ){
730
+int wiki_fetch_by_name( const char *zPageName,
731
+ unsigned int versionsBack,
732
+ int * pRid, Manifest **ppWiki ){
733733
Manifest *pWiki = 0;
734734
char *zTag = mprintf("wiki-%s", zPageName);
735735
Stmt q = empty_Stmt;
736736
int rid = 0;
737737
738738
--- src/wiki.c
+++ src/wiki.c
@@ -725,13 +725,13 @@
725 ** If pRid is not NULL then if a result is found *pRid is set to its
726 ** RID. If ppWiki is not NULL then if found *ppWiki is set to the
727 ** loaded wiki object, which the caller is responsible for passing to
728 ** manifest_destroy().
729 */
730 static int wiki_fetch_by_name( const char *zPageName,
731 unsigned int versionsBack,
732 int * pRid, Manifest **ppWiki ){
733 Manifest *pWiki = 0;
734 char *zTag = mprintf("wiki-%s", zPageName);
735 Stmt q = empty_Stmt;
736 int rid = 0;
737
738
--- src/wiki.c
+++ src/wiki.c
@@ -725,13 +725,13 @@
725 ** If pRid is not NULL then if a result is found *pRid is set to its
726 ** RID. If ppWiki is not NULL then if found *ppWiki is set to the
727 ** loaded wiki object, which the caller is responsible for passing to
728 ** manifest_destroy().
729 */
730 int wiki_fetch_by_name( const char *zPageName,
731 unsigned int versionsBack,
732 int * pRid, Manifest **ppWiki ){
733 Manifest *pWiki = 0;
734 char *zTag = mprintf("wiki-%s", zPageName);
735 Stmt q = empty_Stmt;
736 int rid = 0;
737
738

Keyboard Shortcuts

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