511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
|
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
|
+
+
+
+
+
+
+
-
+
-
-
-
+
+
|
** 1. The global --comfmtflags (alias --comment-format) command-line option.
** 2. The local (per-repository) "comment-format" setting.
** 3. The global (all-repositories) "comment-format" setting.
** 4. The default value COMMENT_PRINT_DEFAULT.
*/
int get_comment_format(){
int comFmtFlags;
/* We must cache this result, else
** running the timeline can end up querying the comment-format
** setting from the global db once per timeline entry, which brings
** it to a crawl if that db is network-mounted. Discussed in:
** https://fossil-scm.org/forum/forumpost/9aaefe4e536e01bf */
/* The global command-line option is present, or the value has been cached. */
if( g.comFmtFlags!=COMMENT_PRINT_UNSET ){
comFmtFlags = g.comFmtFlags;
return g.comFmtFlags;
return comFmtFlags;
}
/* Load the local (per-repository) or global (all-repositories) value, and use
** g.comFmtFlags as a cache. */
comFmtFlags = db_get_int("comment-format", COMMENT_PRINT_UNSET);
if( comFmtFlags!=COMMENT_PRINT_UNSET ){
g.comFmtFlags = comFmtFlags;
return comFmtFlags;
}
/* Fallback to the default value. */
comFmtFlags = COMMENT_PRINT_DEFAULT;
return comFmtFlags;
g.comFmtFlags = COMMENT_PRINT_DEFAULT;
return g.comFmtFlags;
}
/*
**
** COMMAND: test-comment-format
**
** Usage: %fossil test-comment-format ?OPTIONS? PREFIX TEXT ?ORIGTEXT?
|