Fossil SCM
Cache the name of the main branch.
Commit
ca0d66b2e4e74eab6bee5d1229b4461077f44aa3e9c4749fcb21be28d59a0f5c
Parent
3a6dd83947287de…
21 files changed
+15
-5
+2
-2
+2
-2
+1
-1
+1
-1
+1
-2
+3
-3
+1
-1
+4
-2
+2
-2
+3
-3
+3
-3
+1
-1
+1
-1
+1
-1
+2
-2
+2
-2
+1
-2
+1
-1
+1
-2
+1
-2
~
src/branch.c
~
src/browse.c
~
src/checkin.c
~
src/checkout.c
~
src/db.c
~
src/descendants.c
~
src/export.c
~
src/fileedit.c
~
src/finfo.c
~
src/graph.c
~
src/import.c
~
src/info.c
~
src/json_branch.c
~
src/leaf.c
~
src/rebuild.c
~
src/search.c
~
src/setup.c
~
src/tar.c
~
src/timeline.c
~
src/update.c
~
src/zip.c
+15
-5
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -18,10 +18,22 @@ | ||
| 18 | 18 | ** This file contains code used to create new branches within a repository. |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "branch.h" |
| 22 | 22 | #include <assert.h> |
| 23 | + | |
| 24 | +/* | |
| 25 | +** Return the name of the main branch. Cache the result. | |
| 26 | +** | |
| 27 | +** This is the current value of the "main-branch" setting, or its default | |
| 28 | +** value (historically, and as of 2025-10-28: "trunk") if not set. | |
| 29 | +*/ | |
| 30 | +const char *db_main_branch(void){ | |
| 31 | + static char *zMainBranch = 0; | |
| 32 | + if( zMainBranch==0 ) zMainBranch = db_get("main-branch", 0); | |
| 33 | + return zMainBranch; | |
| 34 | +} | |
| 23 | 35 | |
| 24 | 36 | /* |
| 25 | 37 | ** Return true if zBr is the branch name associated with check-in with |
| 26 | 38 | ** blob.uuid value of zUuid |
| 27 | 39 | */ |
| @@ -53,13 +65,11 @@ | ||
| 53 | 65 | if( db_step(&q)==SQLITE_ROW ){ |
| 54 | 66 | zBr = fossil_strdup(db_column_text(&q,0)); |
| 55 | 67 | } |
| 56 | 68 | db_reset(&q); |
| 57 | 69 | if( zBr==0 ){ |
| 58 | - static char *zMain = 0; | |
| 59 | - if( zMain==0 ) zMain = db_get("main-branch",0); | |
| 60 | - zBr = fossil_strdup(zMain); | |
| 70 | + zBr = fossil_strdup(db_main_branch()); | |
| 61 | 71 | } |
| 62 | 72 | return zBr; |
| 63 | 73 | } |
| 64 | 74 | |
| 65 | 75 | /* |
| @@ -837,20 +847,20 @@ | ||
| 837 | 847 | */ |
| 838 | 848 | static void new_brlist_page(void){ |
| 839 | 849 | Stmt q; |
| 840 | 850 | double rNow; |
| 841 | 851 | int show_colors = PB("colors"); |
| 842 | - char *zMainBranch; | |
| 852 | + const char *zMainBranch; | |
| 843 | 853 | login_check_credentials(); |
| 844 | 854 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 845 | 855 | style_set_current_feature("branch"); |
| 846 | 856 | style_header("Branches"); |
| 847 | 857 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 848 | 858 | style_submenu_checkbox("colors", "Use Branch Colors", 0, 0); |
| 849 | 859 | |
| 850 | 860 | login_anonymous_available(); |
| 851 | - zMainBranch = db_get("main-branch", 0); | |
| 861 | + zMainBranch = db_main_branch(); | |
| 852 | 862 | |
| 853 | 863 | brlist_create_temp_table(); |
| 854 | 864 | db_prepare(&q, "SELECT * FROM tmp_brlist ORDER BY mtime DESC"); |
| 855 | 865 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 856 | 866 | @ <script id="brlist-data" type="application/json">\ |
| 857 | 867 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -18,10 +18,22 @@ | |
| 18 | ** This file contains code used to create new branches within a repository. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "branch.h" |
| 22 | #include <assert.h> |
| 23 | |
| 24 | /* |
| 25 | ** Return true if zBr is the branch name associated with check-in with |
| 26 | ** blob.uuid value of zUuid |
| 27 | */ |
| @@ -53,13 +65,11 @@ | |
| 53 | if( db_step(&q)==SQLITE_ROW ){ |
| 54 | zBr = fossil_strdup(db_column_text(&q,0)); |
| 55 | } |
| 56 | db_reset(&q); |
| 57 | if( zBr==0 ){ |
| 58 | static char *zMain = 0; |
| 59 | if( zMain==0 ) zMain = db_get("main-branch",0); |
| 60 | zBr = fossil_strdup(zMain); |
| 61 | } |
| 62 | return zBr; |
| 63 | } |
| 64 | |
| 65 | /* |
| @@ -837,20 +847,20 @@ | |
| 837 | */ |
| 838 | static void new_brlist_page(void){ |
| 839 | Stmt q; |
| 840 | double rNow; |
| 841 | int show_colors = PB("colors"); |
| 842 | char *zMainBranch; |
| 843 | login_check_credentials(); |
| 844 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 845 | style_set_current_feature("branch"); |
| 846 | style_header("Branches"); |
| 847 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 848 | style_submenu_checkbox("colors", "Use Branch Colors", 0, 0); |
| 849 | |
| 850 | login_anonymous_available(); |
| 851 | zMainBranch = db_get("main-branch", 0); |
| 852 | |
| 853 | brlist_create_temp_table(); |
| 854 | db_prepare(&q, "SELECT * FROM tmp_brlist ORDER BY mtime DESC"); |
| 855 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 856 | @ <script id="brlist-data" type="application/json">\ |
| 857 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -18,10 +18,22 @@ | |
| 18 | ** This file contains code used to create new branches within a repository. |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include "branch.h" |
| 22 | #include <assert.h> |
| 23 | |
| 24 | /* |
| 25 | ** Return the name of the main branch. Cache the result. |
| 26 | ** |
| 27 | ** This is the current value of the "main-branch" setting, or its default |
| 28 | ** value (historically, and as of 2025-10-28: "trunk") if not set. |
| 29 | */ |
| 30 | const char *db_main_branch(void){ |
| 31 | static char *zMainBranch = 0; |
| 32 | if( zMainBranch==0 ) zMainBranch = db_get("main-branch", 0); |
| 33 | return zMainBranch; |
| 34 | } |
| 35 | |
| 36 | /* |
| 37 | ** Return true if zBr is the branch name associated with check-in with |
| 38 | ** blob.uuid value of zUuid |
| 39 | */ |
| @@ -53,13 +65,11 @@ | |
| 65 | if( db_step(&q)==SQLITE_ROW ){ |
| 66 | zBr = fossil_strdup(db_column_text(&q,0)); |
| 67 | } |
| 68 | db_reset(&q); |
| 69 | if( zBr==0 ){ |
| 70 | zBr = fossil_strdup(db_main_branch()); |
| 71 | } |
| 72 | return zBr; |
| 73 | } |
| 74 | |
| 75 | /* |
| @@ -837,20 +847,20 @@ | |
| 847 | */ |
| 848 | static void new_brlist_page(void){ |
| 849 | Stmt q; |
| 850 | double rNow; |
| 851 | int show_colors = PB("colors"); |
| 852 | const char *zMainBranch; |
| 853 | login_check_credentials(); |
| 854 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 855 | style_set_current_feature("branch"); |
| 856 | style_header("Branches"); |
| 857 | style_adunit_config(ADUNIT_RIGHT_OK); |
| 858 | style_submenu_checkbox("colors", "Use Branch Colors", 0, 0); |
| 859 | |
| 860 | login_anonymous_available(); |
| 861 | zMainBranch = db_main_branch(); |
| 862 | |
| 863 | brlist_create_temp_table(); |
| 864 | db_prepare(&q, "SELECT * FROM tmp_brlist ORDER BY mtime DESC"); |
| 865 | rNow = db_double(0.0, "SELECT julianday('now')"); |
| 866 | @ <script id="brlist-data" type="application/json">\ |
| 867 |
+2
-2
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -127,11 +127,11 @@ | ||
| 127 | 127 | ** |
| 128 | 128 | ** * Links to files go to /doc (showing the file content directly, |
| 129 | 129 | ** depending on mimetype) rather than to /file (which always shows |
| 130 | 130 | ** the file embedded in a standard Fossil page frame). |
| 131 | 131 | ** |
| 132 | -** * The submenu and the page title is now show. The page is plain. | |
| 132 | +** * The submenu and the page title is not shown. The page is plain. | |
| 133 | 133 | ** |
| 134 | 134 | ** The /docdir page is a shorthand for /dir with the "dx" query parameter. |
| 135 | 135 | ** |
| 136 | 136 | ** Query parameters: |
| 137 | 137 | ** |
| @@ -192,11 +192,11 @@ | ||
| 192 | 192 | |
| 193 | 193 | /* If a specific check-in is requested, fetch and parse it. If the |
| 194 | 194 | ** specific check-in does not exist, clear zCI. zCI==0 will cause all |
| 195 | 195 | ** files from all check-ins to be displayed. |
| 196 | 196 | */ |
| 197 | - if( bDocDir && zCI==0 ) zCI = db_get("main-branch", 0); | |
| 197 | + if( bDocDir && zCI==0 ) zCI = db_main_branch(); | |
| 198 | 198 | if( zCI ){ |
| 199 | 199 | pM = manifest_get_by_name(zCI, &rid); |
| 200 | 200 | if( pM ){ |
| 201 | 201 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 202 | 202 | isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI))!=0); |
| 203 | 203 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -127,11 +127,11 @@ | |
| 127 | ** |
| 128 | ** * Links to files go to /doc (showing the file content directly, |
| 129 | ** depending on mimetype) rather than to /file (which always shows |
| 130 | ** the file embedded in a standard Fossil page frame). |
| 131 | ** |
| 132 | ** * The submenu and the page title is now show. The page is plain. |
| 133 | ** |
| 134 | ** The /docdir page is a shorthand for /dir with the "dx" query parameter. |
| 135 | ** |
| 136 | ** Query parameters: |
| 137 | ** |
| @@ -192,11 +192,11 @@ | |
| 192 | |
| 193 | /* If a specific check-in is requested, fetch and parse it. If the |
| 194 | ** specific check-in does not exist, clear zCI. zCI==0 will cause all |
| 195 | ** files from all check-ins to be displayed. |
| 196 | */ |
| 197 | if( bDocDir && zCI==0 ) zCI = db_get("main-branch", 0); |
| 198 | if( zCI ){ |
| 199 | pM = manifest_get_by_name(zCI, &rid); |
| 200 | if( pM ){ |
| 201 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 202 | isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI))!=0); |
| 203 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -127,11 +127,11 @@ | |
| 127 | ** |
| 128 | ** * Links to files go to /doc (showing the file content directly, |
| 129 | ** depending on mimetype) rather than to /file (which always shows |
| 130 | ** the file embedded in a standard Fossil page frame). |
| 131 | ** |
| 132 | ** * The submenu and the page title is not shown. The page is plain. |
| 133 | ** |
| 134 | ** The /docdir page is a shorthand for /dir with the "dx" query parameter. |
| 135 | ** |
| 136 | ** Query parameters: |
| 137 | ** |
| @@ -192,11 +192,11 @@ | |
| 192 | |
| 193 | /* If a specific check-in is requested, fetch and parse it. If the |
| 194 | ** specific check-in does not exist, clear zCI. zCI==0 will cause all |
| 195 | ** files from all check-ins to be displayed. |
| 196 | */ |
| 197 | if( bDocDir && zCI==0 ) zCI = db_main_branch(); |
| 198 | if( zCI ){ |
| 199 | pM = manifest_get_by_name(zCI, &rid); |
| 200 | if( pM ){ |
| 201 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 202 | isSymbolicCI = (sqlite3_strnicmp(zUuid, zCI, strlen(zCI))!=0); |
| 203 |
+2
-2
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -1627,11 +1627,11 @@ | ||
| 1627 | 1627 | int dryRunFlag /* True for a dry-run only */ |
| 1628 | 1628 | ){ |
| 1629 | 1629 | Blob *pDesc; |
| 1630 | 1630 | char *zTags; |
| 1631 | 1631 | char *zFilename; |
| 1632 | - char *zMainBranch = db_get("main-branch", 0); | |
| 1632 | + const char *zMainBranch = db_main_branch(); | |
| 1633 | 1633 | Blob desc; |
| 1634 | 1634 | blob_init(&desc, 0, 0); |
| 1635 | 1635 | pDesc = &desc; |
| 1636 | 1636 | blob_appendf(pDesc, "checkout %s\n", g.zLocalRoot); |
| 1637 | 1637 | blob_appendf(pDesc, "repository %s\n", g.zRepositoryName); |
| @@ -2625,11 +2625,11 @@ | ||
| 2625 | 2625 | /* Get the ID of the parent manifest artifact */ |
| 2626 | 2626 | vid = db_lget_int("checkout", 0); |
| 2627 | 2627 | if( vid==0 ){ |
| 2628 | 2628 | useCksum = 1; |
| 2629 | 2629 | if( privateFlag==0 && sCiInfo.zBranch==0 ) { |
| 2630 | - sCiInfo.zBranch=db_get("main-branch", 0); | |
| 2630 | + sCiInfo.zBranch = db_main_branch(); | |
| 2631 | 2631 | } |
| 2632 | 2632 | }else{ |
| 2633 | 2633 | privateParent = content_is_private(vid); |
| 2634 | 2634 | } |
| 2635 | 2635 | |
| 2636 | 2636 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1627,11 +1627,11 @@ | |
| 1627 | int dryRunFlag /* True for a dry-run only */ |
| 1628 | ){ |
| 1629 | Blob *pDesc; |
| 1630 | char *zTags; |
| 1631 | char *zFilename; |
| 1632 | char *zMainBranch = db_get("main-branch", 0); |
| 1633 | Blob desc; |
| 1634 | blob_init(&desc, 0, 0); |
| 1635 | pDesc = &desc; |
| 1636 | blob_appendf(pDesc, "checkout %s\n", g.zLocalRoot); |
| 1637 | blob_appendf(pDesc, "repository %s\n", g.zRepositoryName); |
| @@ -2625,11 +2625,11 @@ | |
| 2625 | /* Get the ID of the parent manifest artifact */ |
| 2626 | vid = db_lget_int("checkout", 0); |
| 2627 | if( vid==0 ){ |
| 2628 | useCksum = 1; |
| 2629 | if( privateFlag==0 && sCiInfo.zBranch==0 ) { |
| 2630 | sCiInfo.zBranch=db_get("main-branch", 0); |
| 2631 | } |
| 2632 | }else{ |
| 2633 | privateParent = content_is_private(vid); |
| 2634 | } |
| 2635 | |
| 2636 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -1627,11 +1627,11 @@ | |
| 1627 | int dryRunFlag /* True for a dry-run only */ |
| 1628 | ){ |
| 1629 | Blob *pDesc; |
| 1630 | char *zTags; |
| 1631 | char *zFilename; |
| 1632 | const char *zMainBranch = db_main_branch(); |
| 1633 | Blob desc; |
| 1634 | blob_init(&desc, 0, 0); |
| 1635 | pDesc = &desc; |
| 1636 | blob_appendf(pDesc, "checkout %s\n", g.zLocalRoot); |
| 1637 | blob_appendf(pDesc, "repository %s\n", g.zRepositoryName); |
| @@ -2625,11 +2625,11 @@ | |
| 2625 | /* Get the ID of the parent manifest artifact */ |
| 2626 | vid = db_lget_int("checkout", 0); |
| 2627 | if( vid==0 ){ |
| 2628 | useCksum = 1; |
| 2629 | if( privateFlag==0 && sCiInfo.zBranch==0 ) { |
| 2630 | sCiInfo.zBranch = db_main_branch(); |
| 2631 | } |
| 2632 | }else{ |
| 2633 | privateParent = content_is_private(vid); |
| 2634 | } |
| 2635 | |
| 2636 |
+1
-1
| --- src/checkout.c | ||
| +++ src/checkout.c | ||
| @@ -496,11 +496,11 @@ | ||
| 496 | 496 | verify_all_options(); |
| 497 | 497 | if( g.argc<3 || g.argc>4 ){ |
| 498 | 498 | usage("URL ?VERSION? ?OPTIONS?"); |
| 499 | 499 | } |
| 500 | 500 | zUrl = g.argv[2]; |
| 501 | - zVers = g.argc==4 ? g.argv[3] : db_get("main-branch", 0); | |
| 501 | + zVers = g.argc==4 ? g.argv[3] : db_main_branch(); | |
| 502 | 502 | |
| 503 | 503 | /* Parse the URL of the repository */ |
| 504 | 504 | url_parse(zUrl, 0); |
| 505 | 505 | |
| 506 | 506 | /* Construct an appropriate name for the destination directory */ |
| 507 | 507 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -496,11 +496,11 @@ | |
| 496 | verify_all_options(); |
| 497 | if( g.argc<3 || g.argc>4 ){ |
| 498 | usage("URL ?VERSION? ?OPTIONS?"); |
| 499 | } |
| 500 | zUrl = g.argv[2]; |
| 501 | zVers = g.argc==4 ? g.argv[3] : db_get("main-branch", 0); |
| 502 | |
| 503 | /* Parse the URL of the repository */ |
| 504 | url_parse(zUrl, 0); |
| 505 | |
| 506 | /* Construct an appropriate name for the destination directory */ |
| 507 |
| --- src/checkout.c | |
| +++ src/checkout.c | |
| @@ -496,11 +496,11 @@ | |
| 496 | verify_all_options(); |
| 497 | if( g.argc<3 || g.argc>4 ){ |
| 498 | usage("URL ?VERSION? ?OPTIONS?"); |
| 499 | } |
| 500 | zUrl = g.argv[2]; |
| 501 | zVers = g.argc==4 ? g.argv[3] : db_main_branch(); |
| 502 | |
| 503 | /* Parse the URL of the repository */ |
| 504 | url_parse(zUrl, 0); |
| 505 | |
| 506 | /* Construct an appropriate name for the destination directory */ |
| 507 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -4403,11 +4403,11 @@ | ||
| 4403 | 4403 | /* Figure out which revision to open. */ |
| 4404 | 4404 | if( !emptyFlag ){ |
| 4405 | 4405 | if( g.argc==4 ){ |
| 4406 | 4406 | g.zOpenRevision = g.argv[3]; |
| 4407 | 4407 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 4408 | - g.zOpenRevision = db_get("main-branch", 0); | |
| 4408 | + g.zOpenRevision = fossil_strdup(db_main_branch()); | |
| 4409 | 4409 | } |
| 4410 | 4410 | if( autosync_loop(SYNC_PULL, !bForce, "open") && !bForce ){ |
| 4411 | 4411 | fossil_fatal("unable to auto-sync the repository"); |
| 4412 | 4412 | } |
| 4413 | 4413 | } |
| 4414 | 4414 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -4403,11 +4403,11 @@ | |
| 4403 | /* Figure out which revision to open. */ |
| 4404 | if( !emptyFlag ){ |
| 4405 | if( g.argc==4 ){ |
| 4406 | g.zOpenRevision = g.argv[3]; |
| 4407 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 4408 | g.zOpenRevision = db_get("main-branch", 0); |
| 4409 | } |
| 4410 | if( autosync_loop(SYNC_PULL, !bForce, "open") && !bForce ){ |
| 4411 | fossil_fatal("unable to auto-sync the repository"); |
| 4412 | } |
| 4413 | } |
| 4414 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -4403,11 +4403,11 @@ | |
| 4403 | /* Figure out which revision to open. */ |
| 4404 | if( !emptyFlag ){ |
| 4405 | if( g.argc==4 ){ |
| 4406 | g.zOpenRevision = g.argv[3]; |
| 4407 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 4408 | g.zOpenRevision = fossil_strdup(db_main_branch()); |
| 4409 | } |
| 4410 | if( autosync_loop(SYNC_PULL, !bForce, "open") && !bForce ){ |
| 4411 | fossil_fatal("unable to auto-sync the repository"); |
| 4412 | } |
| 4413 | } |
| 4414 |
+1
-2
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -437,11 +437,11 @@ | ||
| 437 | 437 | int multipleFlag = find_option("multiple","m",0)!=0; |
| 438 | 438 | const char *zWidth = find_option("width","W",1); |
| 439 | 439 | char *zLastBr = 0; |
| 440 | 440 | int n, width; |
| 441 | 441 | char zLineNo[10]; |
| 442 | - char *zMainBranch = db_get("main-branch", 0); | |
| 442 | + const char *zMainBranch = db_main_branch(); | |
| 443 | 443 | |
| 444 | 444 | if( multipleFlag ) byBranch = 1; |
| 445 | 445 | if( zWidth ){ |
| 446 | 446 | width = atoi(zWidth); |
| 447 | 447 | if( (width!=0) && (width<=39) ){ |
| @@ -535,11 +535,10 @@ | ||
| 535 | 535 | zBranchPoint ? zBranchPoint : ""); |
| 536 | 536 | comment_print(z, zCom, 7, width, get_comment_format()); |
| 537 | 537 | fossil_free(z); |
| 538 | 538 | fossil_free(zBranchPoint); |
| 539 | 539 | } |
| 540 | - fossil_free(zMainBranch); | |
| 541 | 540 | fossil_free(zLastBr); |
| 542 | 541 | db_finalize(&q); |
| 543 | 542 | } |
| 544 | 543 | |
| 545 | 544 | /* |
| 546 | 545 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -437,11 +437,11 @@ | |
| 437 | int multipleFlag = find_option("multiple","m",0)!=0; |
| 438 | const char *zWidth = find_option("width","W",1); |
| 439 | char *zLastBr = 0; |
| 440 | int n, width; |
| 441 | char zLineNo[10]; |
| 442 | char *zMainBranch = db_get("main-branch", 0); |
| 443 | |
| 444 | if( multipleFlag ) byBranch = 1; |
| 445 | if( zWidth ){ |
| 446 | width = atoi(zWidth); |
| 447 | if( (width!=0) && (width<=39) ){ |
| @@ -535,11 +535,10 @@ | |
| 535 | zBranchPoint ? zBranchPoint : ""); |
| 536 | comment_print(z, zCom, 7, width, get_comment_format()); |
| 537 | fossil_free(z); |
| 538 | fossil_free(zBranchPoint); |
| 539 | } |
| 540 | fossil_free(zMainBranch); |
| 541 | fossil_free(zLastBr); |
| 542 | db_finalize(&q); |
| 543 | } |
| 544 | |
| 545 | /* |
| 546 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -437,11 +437,11 @@ | |
| 437 | int multipleFlag = find_option("multiple","m",0)!=0; |
| 438 | const char *zWidth = find_option("width","W",1); |
| 439 | char *zLastBr = 0; |
| 440 | int n, width; |
| 441 | char zLineNo[10]; |
| 442 | const char *zMainBranch = db_main_branch(); |
| 443 | |
| 444 | if( multipleFlag ) byBranch = 1; |
| 445 | if( zWidth ){ |
| 446 | width = atoi(zWidth); |
| 447 | if( (width!=0) && (width<=39) ){ |
| @@ -535,11 +535,10 @@ | |
| 535 | zBranchPoint ? zBranchPoint : ""); |
| 536 | comment_print(z, zCom, 7, width, get_comment_format()); |
| 537 | fossil_free(z); |
| 538 | fossil_free(zBranchPoint); |
| 539 | } |
| 540 | fossil_free(zLastBr); |
| 541 | db_finalize(&q); |
| 542 | } |
| 543 | |
| 544 | /* |
| 545 |
+3
-3
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -491,11 +491,11 @@ | ||
| 491 | 491 | Stmt q, q2, q3; |
| 492 | 492 | Bag blobs, vers; |
| 493 | 493 | unsigned int unused_mark = 1; |
| 494 | 494 | const char *markfile_in; |
| 495 | 495 | const char *markfile_out; |
| 496 | - char *zMainBranch = db_get("main-branch", 0); | |
| 496 | + const char *zMainBranch = db_main_branch(); | |
| 497 | 497 | |
| 498 | 498 | bag_init(&blobs); |
| 499 | 499 | bag_init(&vers); |
| 500 | 500 | |
| 501 | 501 | find_option("git", 0, 0); /* Ignore the --git option for now */ |
| @@ -1091,11 +1091,11 @@ | ||
| 1091 | 1091 | int bPhantomOk; /* True if phantom files should be ignored */ |
| 1092 | 1092 | char buf[24]; |
| 1093 | 1093 | char *zEmail; /* Contact info for Git committer field */ |
| 1094 | 1094 | int fManifest; /* Should the manifest files be included? */ |
| 1095 | 1095 | int fPManifest = 0; /* OR of the manifest files for all parents */ |
| 1096 | - char *zMainBranch; | |
| 1096 | + const char *zMainBranch; | |
| 1097 | 1097 | |
| 1098 | 1098 | pMan = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1099 | 1099 | if( pMan==0 ){ |
| 1100 | 1100 | /* Must be a phantom. Return without doing anything, and in particular |
| 1101 | 1101 | ** without creating a mark for this check-in. */ |
| @@ -1151,11 +1151,11 @@ | ||
| 1151 | 1151 | /* Figure out which branch this check-in is a member of */ |
| 1152 | 1152 | zBranch = db_text(0, |
| 1153 | 1153 | "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=%d", |
| 1154 | 1154 | TAG_BRANCH, rid |
| 1155 | 1155 | ); |
| 1156 | - zMainBranch = db_get("main-branch", 0); | |
| 1156 | + zMainBranch = db_main_branch(); | |
| 1157 | 1157 | if( fossil_strcmp(zBranch, zMainBranch)==0 ){ |
| 1158 | 1158 | assert( gitmirror_mainbranch!=0 ); |
| 1159 | 1159 | fossil_free(zBranch); |
| 1160 | 1160 | zBranch = fossil_strdup(gitmirror_mainbranch); |
| 1161 | 1161 | }else if( zBranch==0 ){ |
| 1162 | 1162 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -491,11 +491,11 @@ | |
| 491 | Stmt q, q2, q3; |
| 492 | Bag blobs, vers; |
| 493 | unsigned int unused_mark = 1; |
| 494 | const char *markfile_in; |
| 495 | const char *markfile_out; |
| 496 | char *zMainBranch = db_get("main-branch", 0); |
| 497 | |
| 498 | bag_init(&blobs); |
| 499 | bag_init(&vers); |
| 500 | |
| 501 | find_option("git", 0, 0); /* Ignore the --git option for now */ |
| @@ -1091,11 +1091,11 @@ | |
| 1091 | int bPhantomOk; /* True if phantom files should be ignored */ |
| 1092 | char buf[24]; |
| 1093 | char *zEmail; /* Contact info for Git committer field */ |
| 1094 | int fManifest; /* Should the manifest files be included? */ |
| 1095 | int fPManifest = 0; /* OR of the manifest files for all parents */ |
| 1096 | char *zMainBranch; |
| 1097 | |
| 1098 | pMan = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1099 | if( pMan==0 ){ |
| 1100 | /* Must be a phantom. Return without doing anything, and in particular |
| 1101 | ** without creating a mark for this check-in. */ |
| @@ -1151,11 +1151,11 @@ | |
| 1151 | /* Figure out which branch this check-in is a member of */ |
| 1152 | zBranch = db_text(0, |
| 1153 | "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=%d", |
| 1154 | TAG_BRANCH, rid |
| 1155 | ); |
| 1156 | zMainBranch = db_get("main-branch", 0); |
| 1157 | if( fossil_strcmp(zBranch, zMainBranch)==0 ){ |
| 1158 | assert( gitmirror_mainbranch!=0 ); |
| 1159 | fossil_free(zBranch); |
| 1160 | zBranch = fossil_strdup(gitmirror_mainbranch); |
| 1161 | }else if( zBranch==0 ){ |
| 1162 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -491,11 +491,11 @@ | |
| 491 | Stmt q, q2, q3; |
| 492 | Bag blobs, vers; |
| 493 | unsigned int unused_mark = 1; |
| 494 | const char *markfile_in; |
| 495 | const char *markfile_out; |
| 496 | const char *zMainBranch = db_main_branch(); |
| 497 | |
| 498 | bag_init(&blobs); |
| 499 | bag_init(&vers); |
| 500 | |
| 501 | find_option("git", 0, 0); /* Ignore the --git option for now */ |
| @@ -1091,11 +1091,11 @@ | |
| 1091 | int bPhantomOk; /* True if phantom files should be ignored */ |
| 1092 | char buf[24]; |
| 1093 | char *zEmail; /* Contact info for Git committer field */ |
| 1094 | int fManifest; /* Should the manifest files be included? */ |
| 1095 | int fPManifest = 0; /* OR of the manifest files for all parents */ |
| 1096 | const char *zMainBranch; |
| 1097 | |
| 1098 | pMan = manifest_get(rid, CFTYPE_MANIFEST, 0); |
| 1099 | if( pMan==0 ){ |
| 1100 | /* Must be a phantom. Return without doing anything, and in particular |
| 1101 | ** without creating a mark for this check-in. */ |
| @@ -1151,11 +1151,11 @@ | |
| 1151 | /* Figure out which branch this check-in is a member of */ |
| 1152 | zBranch = db_text(0, |
| 1153 | "SELECT value FROM tagxref WHERE tagid=%d AND tagtype>0 AND rid=%d", |
| 1154 | TAG_BRANCH, rid |
| 1155 | ); |
| 1156 | zMainBranch = db_main_branch(); |
| 1157 | if( fossil_strcmp(zBranch, zMainBranch)==0 ){ |
| 1158 | assert( gitmirror_mainbranch!=0 ); |
| 1159 | fossil_free(zBranch); |
| 1160 | zBranch = fossil_strdup(gitmirror_mainbranch); |
| 1161 | }else if( zBranch==0 ){ |
| 1162 |
+1
-1
| --- src/fileedit.c | ||
| +++ src/fileedit.c | ||
| @@ -833,11 +833,11 @@ | ||
| 833 | 833 | } |
| 834 | 834 | if(zRevision==0 || zRevision[0]==0){ |
| 835 | 835 | if(g.localOpen/*check-out*/){ |
| 836 | 836 | zRevision = db_lget("checkout-hash", 0)/*leak*/; |
| 837 | 837 | }else{ |
| 838 | - zRevision = db_get("main-branch", 0); | |
| 838 | + zRevision = db_main_branch(); | |
| 839 | 839 | } |
| 840 | 840 | } |
| 841 | 841 | name_to_uuid2(zRevision, "ci", &cimi.zParentUuid); |
| 842 | 842 | if(cimi.zParentUuid==0){ |
| 843 | 843 | fossil_fatal("Cannot determine version to commit to."); |
| 844 | 844 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | } |
| 834 | if(zRevision==0 || zRevision[0]==0){ |
| 835 | if(g.localOpen/*check-out*/){ |
| 836 | zRevision = db_lget("checkout-hash", 0)/*leak*/; |
| 837 | }else{ |
| 838 | zRevision = db_get("main-branch", 0); |
| 839 | } |
| 840 | } |
| 841 | name_to_uuid2(zRevision, "ci", &cimi.zParentUuid); |
| 842 | if(cimi.zParentUuid==0){ |
| 843 | fossil_fatal("Cannot determine version to commit to."); |
| 844 |
| --- src/fileedit.c | |
| +++ src/fileedit.c | |
| @@ -833,11 +833,11 @@ | |
| 833 | } |
| 834 | if(zRevision==0 || zRevision[0]==0){ |
| 835 | if(g.localOpen/*check-out*/){ |
| 836 | zRevision = db_lget("checkout-hash", 0)/*leak*/; |
| 837 | }else{ |
| 838 | zRevision = db_main_branch(); |
| 839 | } |
| 840 | } |
| 841 | name_to_uuid2(zRevision, "ci", &cimi.zParentUuid); |
| 842 | if(cimi.zParentUuid==0){ |
| 843 | fossil_fatal("Cannot determine version to commit to."); |
| 844 |
+4
-2
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -176,11 +176,11 @@ | ||
| 176 | 176 | const char *zFilename; |
| 177 | 177 | const char *zLimit; |
| 178 | 178 | const char *zWidth; |
| 179 | 179 | const char *zOffset; |
| 180 | 180 | int iLimit, iOffset, iBrief, iWidth; |
| 181 | - char *zMainBranch = db_get("main-branch", 0); | |
| 181 | + const char *zMainBranch; | |
| 182 | 182 | |
| 183 | 183 | if( find_option("log","l",0) ){ |
| 184 | 184 | /* this is the default, no-op */ |
| 185 | 185 | } |
| 186 | 186 | zLimit = find_option("limit","n",1); |
| @@ -232,10 +232,11 @@ | ||
| 232 | 232 | ); |
| 233 | 233 | blob_zero(&line); |
| 234 | 234 | if( iBrief == 0 ){ |
| 235 | 235 | fossil_print("History for %s\n", blob_str(&fname)); |
| 236 | 236 | } |
| 237 | + zMainBranch = db_main_branch(); | |
| 237 | 238 | while( db_step(&q)==SQLITE_ROW ){ |
| 238 | 239 | const char *zFileUuid = db_column_text(&q, 0); |
| 239 | 240 | const char *zCiUuid = db_column_text(&q,1); |
| 240 | 241 | const char *zDate = db_column_text(&q, 2); |
| 241 | 242 | const char *zCom = db_column_text(&q, 3); |
| @@ -377,11 +378,11 @@ | ||
| 377 | 378 | int tmFlags = 0; /* Viewing mode */ |
| 378 | 379 | const char *zStyle; /* Viewing mode name */ |
| 379 | 380 | const char *zMark; /* Mark this version of the file */ |
| 380 | 381 | int selRid = 0; /* RID of the marked file version */ |
| 381 | 382 | int mxfnid; /* Maximum filename.fnid value */ |
| 382 | - char *zMainBranch = db_get("main-branch", 0); | |
| 383 | + const char *zMainBranch; | |
| 383 | 384 | |
| 384 | 385 | login_check_credentials(); |
| 385 | 386 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 386 | 387 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| 387 | 388 | ridCi = zCI ? name_to_rid_www("ci") : 0; |
| @@ -635,10 +636,11 @@ | ||
| 635 | 636 | while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ |
| 636 | 637 | aParent[nParent] = db_column_int64(&qparent, 0); |
| 637 | 638 | nParent++; |
| 638 | 639 | } |
| 639 | 640 | db_reset(&qparent); |
| 641 | + zMainBranch = db_main_branch(); | |
| 640 | 642 | if( zBr==0 ) zBr = fossil_strdup(zMainBranch); |
| 641 | 643 | if( uBg ){ |
| 642 | 644 | zBgClr = user_color(zUser); |
| 643 | 645 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 644 | 646 | zBgClr = strcmp(zBr, zMainBranch)==0 ? "" : hash_color(zBr); |
| 645 | 647 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -176,11 +176,11 @@ | |
| 176 | const char *zFilename; |
| 177 | const char *zLimit; |
| 178 | const char *zWidth; |
| 179 | const char *zOffset; |
| 180 | int iLimit, iOffset, iBrief, iWidth; |
| 181 | char *zMainBranch = db_get("main-branch", 0); |
| 182 | |
| 183 | if( find_option("log","l",0) ){ |
| 184 | /* this is the default, no-op */ |
| 185 | } |
| 186 | zLimit = find_option("limit","n",1); |
| @@ -232,10 +232,11 @@ | |
| 232 | ); |
| 233 | blob_zero(&line); |
| 234 | if( iBrief == 0 ){ |
| 235 | fossil_print("History for %s\n", blob_str(&fname)); |
| 236 | } |
| 237 | while( db_step(&q)==SQLITE_ROW ){ |
| 238 | const char *zFileUuid = db_column_text(&q, 0); |
| 239 | const char *zCiUuid = db_column_text(&q,1); |
| 240 | const char *zDate = db_column_text(&q, 2); |
| 241 | const char *zCom = db_column_text(&q, 3); |
| @@ -377,11 +378,11 @@ | |
| 377 | int tmFlags = 0; /* Viewing mode */ |
| 378 | const char *zStyle; /* Viewing mode name */ |
| 379 | const char *zMark; /* Mark this version of the file */ |
| 380 | int selRid = 0; /* RID of the marked file version */ |
| 381 | int mxfnid; /* Maximum filename.fnid value */ |
| 382 | char *zMainBranch = db_get("main-branch", 0); |
| 383 | |
| 384 | login_check_credentials(); |
| 385 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 386 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| 387 | ridCi = zCI ? name_to_rid_www("ci") : 0; |
| @@ -635,10 +636,11 @@ | |
| 635 | while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ |
| 636 | aParent[nParent] = db_column_int64(&qparent, 0); |
| 637 | nParent++; |
| 638 | } |
| 639 | db_reset(&qparent); |
| 640 | if( zBr==0 ) zBr = fossil_strdup(zMainBranch); |
| 641 | if( uBg ){ |
| 642 | zBgClr = user_color(zUser); |
| 643 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 644 | zBgClr = strcmp(zBr, zMainBranch)==0 ? "" : hash_color(zBr); |
| 645 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -176,11 +176,11 @@ | |
| 176 | const char *zFilename; |
| 177 | const char *zLimit; |
| 178 | const char *zWidth; |
| 179 | const char *zOffset; |
| 180 | int iLimit, iOffset, iBrief, iWidth; |
| 181 | const char *zMainBranch; |
| 182 | |
| 183 | if( find_option("log","l",0) ){ |
| 184 | /* this is the default, no-op */ |
| 185 | } |
| 186 | zLimit = find_option("limit","n",1); |
| @@ -232,10 +232,11 @@ | |
| 232 | ); |
| 233 | blob_zero(&line); |
| 234 | if( iBrief == 0 ){ |
| 235 | fossil_print("History for %s\n", blob_str(&fname)); |
| 236 | } |
| 237 | zMainBranch = db_main_branch(); |
| 238 | while( db_step(&q)==SQLITE_ROW ){ |
| 239 | const char *zFileUuid = db_column_text(&q, 0); |
| 240 | const char *zCiUuid = db_column_text(&q,1); |
| 241 | const char *zDate = db_column_text(&q, 2); |
| 242 | const char *zCom = db_column_text(&q, 3); |
| @@ -377,11 +378,11 @@ | |
| 378 | int tmFlags = 0; /* Viewing mode */ |
| 379 | const char *zStyle; /* Viewing mode name */ |
| 380 | const char *zMark; /* Mark this version of the file */ |
| 381 | int selRid = 0; /* RID of the marked file version */ |
| 382 | int mxfnid; /* Maximum filename.fnid value */ |
| 383 | const char *zMainBranch; |
| 384 | |
| 385 | login_check_credentials(); |
| 386 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 387 | fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename); |
| 388 | ridCi = zCI ? name_to_rid_www("ci") : 0; |
| @@ -635,10 +636,11 @@ | |
| 636 | while( db_step(&qparent)==SQLITE_ROW && nParent<count(aParent) ){ |
| 637 | aParent[nParent] = db_column_int64(&qparent, 0); |
| 638 | nParent++; |
| 639 | } |
| 640 | db_reset(&qparent); |
| 641 | zMainBranch = db_main_branch(); |
| 642 | if( zBr==0 ) zBr = fossil_strdup(zMainBranch); |
| 643 | if( uBg ){ |
| 644 | zBgClr = user_color(zUser); |
| 645 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 646 | zBgClr = strcmp(zBr, zMainBranch)==0 ? "" : hash_color(zBr); |
| 647 |
+2
-2
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -513,11 +513,11 @@ | ||
| 513 | 513 | GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent; |
| 514 | 514 | int i, j; |
| 515 | 515 | u64 mask; |
| 516 | 516 | int hasDup = 0; /* True if one or more isDup entries */ |
| 517 | 517 | const char *zTrunk; |
| 518 | - char *zMainBranch; | |
| 518 | + const char *zMainBranch; | |
| 519 | 519 | u8 *aMap; /* Copy of p->aiRailMap */ |
| 520 | 520 | int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0; |
| 521 | 521 | int nTimewarp = 0; |
| 522 | 522 | int riserMargin = (tmFlags & TIMELINE_DISJOINT) ? 0 : RISER_MARGIN; |
| 523 | 523 | |
| @@ -709,11 +709,11 @@ | ||
| 709 | 709 | /* Identify rows where the primary parent is off screen. Assign |
| 710 | 710 | ** each to a rail and draw descenders downward. |
| 711 | 711 | ** |
| 712 | 712 | ** Strive to put the main branch (usually "trunk") on far left. |
| 713 | 713 | */ |
| 714 | - zMainBranch = db_get("main-branch", 0); | |
| 714 | + zMainBranch = db_main_branch(); | |
| 715 | 715 | zTrunk = persistBranchName(p, zMainBranch); |
| 716 | 716 | for(i=0; i<2; i++){ |
| 717 | 717 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 718 | 718 | if( i==0 && pRow->zBranch!=zTrunk ) continue; |
| 719 | 719 | if( pRow->iRail>=0 ) continue; |
| 720 | 720 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -513,11 +513,11 @@ | |
| 513 | GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent; |
| 514 | int i, j; |
| 515 | u64 mask; |
| 516 | int hasDup = 0; /* True if one or more isDup entries */ |
| 517 | const char *zTrunk; |
| 518 | char *zMainBranch; |
| 519 | u8 *aMap; /* Copy of p->aiRailMap */ |
| 520 | int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0; |
| 521 | int nTimewarp = 0; |
| 522 | int riserMargin = (tmFlags & TIMELINE_DISJOINT) ? 0 : RISER_MARGIN; |
| 523 | |
| @@ -709,11 +709,11 @@ | |
| 709 | /* Identify rows where the primary parent is off screen. Assign |
| 710 | ** each to a rail and draw descenders downward. |
| 711 | ** |
| 712 | ** Strive to put the main branch (usually "trunk") on far left. |
| 713 | */ |
| 714 | zMainBranch = db_get("main-branch", 0); |
| 715 | zTrunk = persistBranchName(p, zMainBranch); |
| 716 | for(i=0; i<2; i++){ |
| 717 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 718 | if( i==0 && pRow->zBranch!=zTrunk ) continue; |
| 719 | if( pRow->iRail>=0 ) continue; |
| 720 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -513,11 +513,11 @@ | |
| 513 | GraphRow *pRow, *pDesc, *pDup, *pLoop, *pParent; |
| 514 | int i, j; |
| 515 | u64 mask; |
| 516 | int hasDup = 0; /* True if one or more isDup entries */ |
| 517 | const char *zTrunk; |
| 518 | const char *zMainBranch; |
| 519 | u8 *aMap; /* Copy of p->aiRailMap */ |
| 520 | int omitDescenders = (tmFlags & TIMELINE_DISJOINT)!=0; |
| 521 | int nTimewarp = 0; |
| 522 | int riserMargin = (tmFlags & TIMELINE_DISJOINT) ? 0 : RISER_MARGIN; |
| 523 | |
| @@ -709,11 +709,11 @@ | |
| 709 | /* Identify rows where the primary parent is off screen. Assign |
| 710 | ** each to a rail and draw descenders downward. |
| 711 | ** |
| 712 | ** Strive to put the main branch (usually "trunk") on far left. |
| 713 | */ |
| 714 | zMainBranch = db_main_branch(); |
| 715 | zTrunk = persistBranchName(p, zMainBranch); |
| 716 | for(i=0; i<2; i++){ |
| 717 | for(pRow=p->pLast; pRow; pRow=pRow->pPrev){ |
| 718 | if( i==0 && pRow->zBranch!=zTrunk ) continue; |
| 719 | if( pRow->iRail>=0 ) continue; |
| 720 |
+3
-3
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1263,11 +1263,11 @@ | ||
| 1263 | 1263 | ** Return 0 if not a branch, tag, or trunk, or if ignored by --ignore-tree. |
| 1264 | 1264 | */ |
| 1265 | 1265 | static int svn_parse_path(char *zPath, char **zFile, int *type){ |
| 1266 | 1266 | char *zBranch = 0; |
| 1267 | 1267 | int branchId = 0; |
| 1268 | - char *zMainBranch = db_get("main-branch", 0); | |
| 1268 | + const char *zMainBranch; | |
| 1269 | 1269 | if( gsvn.azIgnTree ){ |
| 1270 | 1270 | const char **pzIgnTree; |
| 1271 | 1271 | unsigned nPath = strlen(zPath); |
| 1272 | 1272 | for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){ |
| 1273 | 1273 | const char *zIgn = *pzIgnTree; |
| @@ -1278,10 +1278,11 @@ | ||
| 1278 | 1278 | } |
| 1279 | 1279 | } |
| 1280 | 1280 | } |
| 1281 | 1281 | *type = SVN_UNKNOWN; |
| 1282 | 1282 | *zFile = 0; |
| 1283 | + zMainBranch = db_main_branch(); | |
| 1283 | 1284 | if( gsvn.lenTrunk==0 ){ |
| 1284 | 1285 | zBranch = fossil_strdup(zMainBranch); |
| 1285 | 1286 | *zFile = zPath; |
| 1286 | 1287 | *type = SVN_TRUNK; |
| 1287 | 1288 | }else |
| @@ -1728,11 +1729,10 @@ | ||
| 1728 | 1729 | int svnFlag = find_option("svn", 0, 0)!=0; |
| 1729 | 1730 | int gitFlag = find_option("git", 0, 0)!=0; |
| 1730 | 1731 | int omitRebuild = find_option("no-rebuild",0,0)!=0; |
| 1731 | 1732 | int omitVacuum = find_option("no-vacuum",0,0)!=0; |
| 1732 | 1733 | const char *zDefaultUser = find_option("admin-user","A",1); |
| 1733 | - char *zMainBranch = db_get("main-branch", 0); | |
| 1734 | 1734 | |
| 1735 | 1735 | /* Options common to all input formats */ |
| 1736 | 1736 | int incrFlag = find_option("incremental", "i", 0)!=0; |
| 1737 | 1737 | |
| 1738 | 1738 | /* Options for --svn only */ |
| @@ -1772,11 +1772,11 @@ | ||
| 1772 | 1772 | *renOpt->varSuf = renOpt->zDefaultSuf; |
| 1773 | 1773 | } |
| 1774 | 1774 | } |
| 1775 | 1775 | } |
| 1776 | 1776 | if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){ |
| 1777 | - gimport.zTrunkName = fossil_strdup(zMainBranch); | |
| 1777 | + gimport.zTrunkName = fossil_strdup(db_main_branch()); | |
| 1778 | 1778 | } |
| 1779 | 1779 | |
| 1780 | 1780 | if( svnFlag ){ |
| 1781 | 1781 | /* Get --svn related options here, so verify_all_options() fails when |
| 1782 | 1782 | * svn-only options are specified with --git |
| 1783 | 1783 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1263,11 +1263,11 @@ | |
| 1263 | ** Return 0 if not a branch, tag, or trunk, or if ignored by --ignore-tree. |
| 1264 | */ |
| 1265 | static int svn_parse_path(char *zPath, char **zFile, int *type){ |
| 1266 | char *zBranch = 0; |
| 1267 | int branchId = 0; |
| 1268 | char *zMainBranch = db_get("main-branch", 0); |
| 1269 | if( gsvn.azIgnTree ){ |
| 1270 | const char **pzIgnTree; |
| 1271 | unsigned nPath = strlen(zPath); |
| 1272 | for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){ |
| 1273 | const char *zIgn = *pzIgnTree; |
| @@ -1278,10 +1278,11 @@ | |
| 1278 | } |
| 1279 | } |
| 1280 | } |
| 1281 | *type = SVN_UNKNOWN; |
| 1282 | *zFile = 0; |
| 1283 | if( gsvn.lenTrunk==0 ){ |
| 1284 | zBranch = fossil_strdup(zMainBranch); |
| 1285 | *zFile = zPath; |
| 1286 | *type = SVN_TRUNK; |
| 1287 | }else |
| @@ -1728,11 +1729,10 @@ | |
| 1728 | int svnFlag = find_option("svn", 0, 0)!=0; |
| 1729 | int gitFlag = find_option("git", 0, 0)!=0; |
| 1730 | int omitRebuild = find_option("no-rebuild",0,0)!=0; |
| 1731 | int omitVacuum = find_option("no-vacuum",0,0)!=0; |
| 1732 | const char *zDefaultUser = find_option("admin-user","A",1); |
| 1733 | char *zMainBranch = db_get("main-branch", 0); |
| 1734 | |
| 1735 | /* Options common to all input formats */ |
| 1736 | int incrFlag = find_option("incremental", "i", 0)!=0; |
| 1737 | |
| 1738 | /* Options for --svn only */ |
| @@ -1772,11 +1772,11 @@ | |
| 1772 | *renOpt->varSuf = renOpt->zDefaultSuf; |
| 1773 | } |
| 1774 | } |
| 1775 | } |
| 1776 | if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){ |
| 1777 | gimport.zTrunkName = fossil_strdup(zMainBranch); |
| 1778 | } |
| 1779 | |
| 1780 | if( svnFlag ){ |
| 1781 | /* Get --svn related options here, so verify_all_options() fails when |
| 1782 | * svn-only options are specified with --git |
| 1783 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1263,11 +1263,11 @@ | |
| 1263 | ** Return 0 if not a branch, tag, or trunk, or if ignored by --ignore-tree. |
| 1264 | */ |
| 1265 | static int svn_parse_path(char *zPath, char **zFile, int *type){ |
| 1266 | char *zBranch = 0; |
| 1267 | int branchId = 0; |
| 1268 | const char *zMainBranch; |
| 1269 | if( gsvn.azIgnTree ){ |
| 1270 | const char **pzIgnTree; |
| 1271 | unsigned nPath = strlen(zPath); |
| 1272 | for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){ |
| 1273 | const char *zIgn = *pzIgnTree; |
| @@ -1278,10 +1278,11 @@ | |
| 1278 | } |
| 1279 | } |
| 1280 | } |
| 1281 | *type = SVN_UNKNOWN; |
| 1282 | *zFile = 0; |
| 1283 | zMainBranch = db_main_branch(); |
| 1284 | if( gsvn.lenTrunk==0 ){ |
| 1285 | zBranch = fossil_strdup(zMainBranch); |
| 1286 | *zFile = zPath; |
| 1287 | *type = SVN_TRUNK; |
| 1288 | }else |
| @@ -1728,11 +1729,10 @@ | |
| 1729 | int svnFlag = find_option("svn", 0, 0)!=0; |
| 1730 | int gitFlag = find_option("git", 0, 0)!=0; |
| 1731 | int omitRebuild = find_option("no-rebuild",0,0)!=0; |
| 1732 | int omitVacuum = find_option("no-vacuum",0,0)!=0; |
| 1733 | const char *zDefaultUser = find_option("admin-user","A",1); |
| 1734 | |
| 1735 | /* Options common to all input formats */ |
| 1736 | int incrFlag = find_option("incremental", "i", 0)!=0; |
| 1737 | |
| 1738 | /* Options for --svn only */ |
| @@ -1772,11 +1772,11 @@ | |
| 1772 | *renOpt->varSuf = renOpt->zDefaultSuf; |
| 1773 | } |
| 1774 | } |
| 1775 | } |
| 1776 | if( !(gimport.zTrunkName = find_option("rename-trunk", 0, 1)) ){ |
| 1777 | gimport.zTrunkName = fossil_strdup(db_main_branch()); |
| 1778 | } |
| 1779 | |
| 1780 | if( svnFlag ){ |
| 1781 | /* Get --svn related options here, so verify_all_options() fails when |
| 1782 | * svn-only options are specified with --git |
| 1783 |
+3
-3
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1141,11 +1141,11 @@ | ||
| 1141 | 1141 | } |
| 1142 | 1142 | @ %s(zLinks)</td></tr> |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | if( g.perm.Hyperlink ){ |
| 1146 | - char *zMainBranch = db_get("main-branch", 0); | |
| 1146 | + const char *zMainBranch = db_main_branch(); | |
| 1147 | 1147 | @ <tr><th>Other Links:</th> |
| 1148 | 1148 | @ <td> |
| 1149 | 1149 | if( fossil_strcmp(zBrName, zMainBranch)!=0 ){ |
| 1150 | 1150 | @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> | |
| 1151 | 1151 | } |
| @@ -3718,11 +3718,11 @@ | ||
| 3718 | 3718 | style_header("Edit Check-in [%s]", zUuid); |
| 3719 | 3719 | if( P("preview") ){ |
| 3720 | 3720 | Blob suffix; |
| 3721 | 3721 | int nTag = 0; |
| 3722 | 3722 | const char *zDplyBr; /* Branch name used to determine BG color */ |
| 3723 | - char *zMainBranch = db_get("main-branch", 0); | |
| 3723 | + const char *zMainBranch = db_main_branch(); | |
| 3724 | 3724 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| 3725 | 3725 | zDplyBr = zNewBranch; |
| 3726 | 3726 | }else{ |
| 3727 | 3727 | zDplyBr = zBranchName; |
| 3728 | 3728 | } |
| @@ -3857,11 +3857,11 @@ | ||
| 3857 | 3857 | } |
| 3858 | 3858 | db_finalize(&q); |
| 3859 | 3859 | @ </td></tr> |
| 3860 | 3860 | |
| 3861 | 3861 | if( !zBranchName ){ |
| 3862 | - zBranchName = db_get("main-branch", 0); | |
| 3862 | + zBranchName = fossil_strdup(db_main_branch()); | |
| 3863 | 3863 | } |
| 3864 | 3864 | if( !zNewBranch || !zNewBranch[0]){ |
| 3865 | 3865 | zNewBranch = zBranchName; |
| 3866 | 3866 | } |
| 3867 | 3867 | @ <tr><th align="right" valign="top">Branching:</th> |
| 3868 | 3868 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1141,11 +1141,11 @@ | |
| 1141 | } |
| 1142 | @ %s(zLinks)</td></tr> |
| 1143 | } |
| 1144 | |
| 1145 | if( g.perm.Hyperlink ){ |
| 1146 | char *zMainBranch = db_get("main-branch", 0); |
| 1147 | @ <tr><th>Other Links:</th> |
| 1148 | @ <td> |
| 1149 | if( fossil_strcmp(zBrName, zMainBranch)!=0 ){ |
| 1150 | @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> | |
| 1151 | } |
| @@ -3718,11 +3718,11 @@ | |
| 3718 | style_header("Edit Check-in [%s]", zUuid); |
| 3719 | if( P("preview") ){ |
| 3720 | Blob suffix; |
| 3721 | int nTag = 0; |
| 3722 | const char *zDplyBr; /* Branch name used to determine BG color */ |
| 3723 | char *zMainBranch = db_get("main-branch", 0); |
| 3724 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| 3725 | zDplyBr = zNewBranch; |
| 3726 | }else{ |
| 3727 | zDplyBr = zBranchName; |
| 3728 | } |
| @@ -3857,11 +3857,11 @@ | |
| 3857 | } |
| 3858 | db_finalize(&q); |
| 3859 | @ </td></tr> |
| 3860 | |
| 3861 | if( !zBranchName ){ |
| 3862 | zBranchName = db_get("main-branch", 0); |
| 3863 | } |
| 3864 | if( !zNewBranch || !zNewBranch[0]){ |
| 3865 | zNewBranch = zBranchName; |
| 3866 | } |
| 3867 | @ <tr><th align="right" valign="top">Branching:</th> |
| 3868 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1141,11 +1141,11 @@ | |
| 1141 | } |
| 1142 | @ %s(zLinks)</td></tr> |
| 1143 | } |
| 1144 | |
| 1145 | if( g.perm.Hyperlink ){ |
| 1146 | const char *zMainBranch = db_main_branch(); |
| 1147 | @ <tr><th>Other Links:</th> |
| 1148 | @ <td> |
| 1149 | if( fossil_strcmp(zBrName, zMainBranch)!=0 ){ |
| 1150 | @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> | |
| 1151 | } |
| @@ -3718,11 +3718,11 @@ | |
| 3718 | style_header("Edit Check-in [%s]", zUuid); |
| 3719 | if( P("preview") ){ |
| 3720 | Blob suffix; |
| 3721 | int nTag = 0; |
| 3722 | const char *zDplyBr; /* Branch name used to determine BG color */ |
| 3723 | const char *zMainBranch = db_main_branch(); |
| 3724 | if( zNewBrFlag[0] && zNewBranch[0] ){ |
| 3725 | zDplyBr = zNewBranch; |
| 3726 | }else{ |
| 3727 | zDplyBr = zBranchName; |
| 3728 | } |
| @@ -3857,11 +3857,11 @@ | |
| 3857 | } |
| 3858 | db_finalize(&q); |
| 3859 | @ </td></tr> |
| 3860 | |
| 3861 | if( !zBranchName ){ |
| 3862 | zBranchName = fossil_strdup(db_main_branch()); |
| 3863 | } |
| 3864 | if( !zNewBranch || !zNewBranch[0]){ |
| 3865 | zNewBranch = zBranchName; |
| 3866 | } |
| 3867 | @ <tr><th align="right" valign="top">Branching:</th> |
| 3868 |
+1
-1
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -313,11 +313,11 @@ | ||
| 313 | 313 | cson_value * payV = NULL; |
| 314 | 314 | cson_object * pay = NULL; |
| 315 | 315 | int rc = 0; |
| 316 | 316 | BranchCreateOptions opt; |
| 317 | 317 | char * zUuid = NULL; |
| 318 | - char *zMainBranch = db_get("main-branch", 0); | |
| 318 | + const char *zMainBranch = db_main_branch(); | |
| 319 | 319 | int rid = 0; |
| 320 | 320 | if( !g.perm.Write ){ |
| 321 | 321 | json_set_err(FSL_JSON_E_DENIED, |
| 322 | 322 | "Requires 'i' permissions."); |
| 323 | 323 | return NULL; |
| 324 | 324 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -313,11 +313,11 @@ | |
| 313 | cson_value * payV = NULL; |
| 314 | cson_object * pay = NULL; |
| 315 | int rc = 0; |
| 316 | BranchCreateOptions opt; |
| 317 | char * zUuid = NULL; |
| 318 | char *zMainBranch = db_get("main-branch", 0); |
| 319 | int rid = 0; |
| 320 | if( !g.perm.Write ){ |
| 321 | json_set_err(FSL_JSON_E_DENIED, |
| 322 | "Requires 'i' permissions."); |
| 323 | return NULL; |
| 324 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -313,11 +313,11 @@ | |
| 313 | cson_value * payV = NULL; |
| 314 | cson_object * pay = NULL; |
| 315 | int rc = 0; |
| 316 | BranchCreateOptions opt; |
| 317 | char * zUuid = NULL; |
| 318 | const char *zMainBranch = db_main_branch(); |
| 319 | int rid = 0; |
| 320 | if( !g.perm.Write ){ |
| 321 | json_set_err(FSL_JSON_E_DENIED, |
| 322 | "Requires 'i' permissions."); |
| 323 | return NULL; |
| 324 |
+1
-1
| --- src/leaf.c | ||
| +++ src/leaf.c | ||
| @@ -228,11 +228,11 @@ | ||
| 228 | 228 | Stmt q; |
| 229 | 229 | int n = 0; |
| 230 | 230 | Blob msg; |
| 231 | 231 | const char *zMainBranch; |
| 232 | 232 | if( leaf_ambiguity(rid)==0 ) return 0; |
| 233 | - zMainBranch = db_get("main-branch", 0); | |
| 233 | + zMainBranch = db_main_branch(); | |
| 234 | 234 | zBr = db_text(0, "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 235 | 235 | TAG_BRANCH, rid); |
| 236 | 236 | if( zBr==0 ) zBr = fossil_strdup(zMainBranch); |
| 237 | 237 | blob_init(&msg, 0, 0); |
| 238 | 238 | blob_appendf(&msg, "WARNING: multiple open leaf check-ins on %s:", zBr); |
| 239 | 239 |
| --- src/leaf.c | |
| +++ src/leaf.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | Stmt q; |
| 229 | int n = 0; |
| 230 | Blob msg; |
| 231 | const char *zMainBranch; |
| 232 | if( leaf_ambiguity(rid)==0 ) return 0; |
| 233 | zMainBranch = db_get("main-branch", 0); |
| 234 | zBr = db_text(0, "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 235 | TAG_BRANCH, rid); |
| 236 | if( zBr==0 ) zBr = fossil_strdup(zMainBranch); |
| 237 | blob_init(&msg, 0, 0); |
| 238 | blob_appendf(&msg, "WARNING: multiple open leaf check-ins on %s:", zBr); |
| 239 |
| --- src/leaf.c | |
| +++ src/leaf.c | |
| @@ -228,11 +228,11 @@ | |
| 228 | Stmt q; |
| 229 | int n = 0; |
| 230 | Blob msg; |
| 231 | const char *zMainBranch; |
| 232 | if( leaf_ambiguity(rid)==0 ) return 0; |
| 233 | zMainBranch = db_main_branch(); |
| 234 | zBr = db_text(0, "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 235 | TAG_BRANCH, rid); |
| 236 | if( zBr==0 ) zBr = fossil_strdup(zMainBranch); |
| 237 | blob_init(&msg, 0, 0); |
| 238 | blob_appendf(&msg, "WARNING: multiple open leaf check-ins on %s:", zBr); |
| 239 |
+1
-1
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -351,11 +351,11 @@ | ||
| 351 | 351 | /* |
| 352 | 352 | ** Check to see if the "sym-trunk" tag exists. If not, create it |
| 353 | 353 | ** and attach it to the very first check-in. |
| 354 | 354 | */ |
| 355 | 355 | static void rebuild_tag_trunk(void){ |
| 356 | - char *zMainBranch = db_get("main-branch", 0); | |
| 356 | + const char *zMainBranch = db_main_branch(); | |
| 357 | 357 | int tagid = db_int(0, "SELECT 1 FROM tag WHERE tagname='sym-%q'",zMainBranch); |
| 358 | 358 | int rid; |
| 359 | 359 | char *zUuid; |
| 360 | 360 | |
| 361 | 361 | if( tagid>0 ) return; |
| 362 | 362 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -351,11 +351,11 @@ | |
| 351 | /* |
| 352 | ** Check to see if the "sym-trunk" tag exists. If not, create it |
| 353 | ** and attach it to the very first check-in. |
| 354 | */ |
| 355 | static void rebuild_tag_trunk(void){ |
| 356 | char *zMainBranch = db_get("main-branch", 0); |
| 357 | int tagid = db_int(0, "SELECT 1 FROM tag WHERE tagname='sym-%q'",zMainBranch); |
| 358 | int rid; |
| 359 | char *zUuid; |
| 360 | |
| 361 | if( tagid>0 ) return; |
| 362 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -351,11 +351,11 @@ | |
| 351 | /* |
| 352 | ** Check to see if the "sym-trunk" tag exists. If not, create it |
| 353 | ** and attach it to the very first check-in. |
| 354 | */ |
| 355 | static void rebuild_tag_trunk(void){ |
| 356 | const char *zMainBranch = db_main_branch(); |
| 357 | int tagid = db_int(0, "SELECT 1 FROM tag WHERE tagname='sym-%q'",zMainBranch); |
| 358 | int rid; |
| 359 | char *zUuid; |
| 360 | |
| 361 | if( tagid>0 ) return; |
| 362 |
+2
-2
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -852,11 +852,11 @@ | ||
| 852 | 852 | ){ |
| 853 | 853 | search_init(zPattern, "<mark>", "</mark>", " ... ", |
| 854 | 854 | SRCHFLG_STATIC|SRCHFLG_HTML); |
| 855 | 855 | if( (srchFlags & SRCH_DOC)!=0 ){ |
| 856 | 856 | char *zDocGlob = db_get("doc-glob",""); |
| 857 | - char *zMainBranch = db_get("main-branch", 0); | |
| 857 | + const char *zMainBranch = db_main_branch(); | |
| 858 | 858 | char *zDocBr = db_get("doc-branch", zMainBranch); |
| 859 | 859 | if( zDocGlob && zDocGlob[0] && zDocBr && zDocBr[0] ){ |
| 860 | 860 | Glob * pGlob = glob_create(zDocBr) |
| 861 | 861 | /* We're misusing a Glob as a list of comma-/space-delimited |
| 862 | 862 | ** tokens. We're not actually doing glob matches here. */; |
| @@ -1987,11 +1987,11 @@ | ||
| 1987 | 1987 | ** and if the latest check-in on doc-br is in the unindexed set of |
| 1988 | 1988 | ** check-ins, then update all 'd' entries in FTSDOCS that have |
| 1989 | 1989 | ** changed. |
| 1990 | 1990 | */ |
| 1991 | 1991 | static void search_update_doc_index(void){ |
| 1992 | - char *zMainBranch = db_get("main-branch", 0); | |
| 1992 | + const char *zMainBranch = db_main_branch(); | |
| 1993 | 1993 | const char *zDocBranches = db_get("doc-branch", zMainBranch); |
| 1994 | 1994 | int i; |
| 1995 | 1995 | Glob * pGlob = glob_create(zDocBranches) |
| 1996 | 1996 | /* We're misusing a Glob as a list of comma-/space-delimited |
| 1997 | 1997 | ** tokens. We're not actually doing glob matches here. */; |
| 1998 | 1998 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -852,11 +852,11 @@ | |
| 852 | ){ |
| 853 | search_init(zPattern, "<mark>", "</mark>", " ... ", |
| 854 | SRCHFLG_STATIC|SRCHFLG_HTML); |
| 855 | if( (srchFlags & SRCH_DOC)!=0 ){ |
| 856 | char *zDocGlob = db_get("doc-glob",""); |
| 857 | char *zMainBranch = db_get("main-branch", 0); |
| 858 | char *zDocBr = db_get("doc-branch", zMainBranch); |
| 859 | if( zDocGlob && zDocGlob[0] && zDocBr && zDocBr[0] ){ |
| 860 | Glob * pGlob = glob_create(zDocBr) |
| 861 | /* We're misusing a Glob as a list of comma-/space-delimited |
| 862 | ** tokens. We're not actually doing glob matches here. */; |
| @@ -1987,11 +1987,11 @@ | |
| 1987 | ** and if the latest check-in on doc-br is in the unindexed set of |
| 1988 | ** check-ins, then update all 'd' entries in FTSDOCS that have |
| 1989 | ** changed. |
| 1990 | */ |
| 1991 | static void search_update_doc_index(void){ |
| 1992 | char *zMainBranch = db_get("main-branch", 0); |
| 1993 | const char *zDocBranches = db_get("doc-branch", zMainBranch); |
| 1994 | int i; |
| 1995 | Glob * pGlob = glob_create(zDocBranches) |
| 1996 | /* We're misusing a Glob as a list of comma-/space-delimited |
| 1997 | ** tokens. We're not actually doing glob matches here. */; |
| 1998 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -852,11 +852,11 @@ | |
| 852 | ){ |
| 853 | search_init(zPattern, "<mark>", "</mark>", " ... ", |
| 854 | SRCHFLG_STATIC|SRCHFLG_HTML); |
| 855 | if( (srchFlags & SRCH_DOC)!=0 ){ |
| 856 | char *zDocGlob = db_get("doc-glob",""); |
| 857 | const char *zMainBranch = db_main_branch(); |
| 858 | char *zDocBr = db_get("doc-branch", zMainBranch); |
| 859 | if( zDocGlob && zDocGlob[0] && zDocBr && zDocBr[0] ){ |
| 860 | Glob * pGlob = glob_create(zDocBr) |
| 861 | /* We're misusing a Glob as a list of comma-/space-delimited |
| 862 | ** tokens. We're not actually doing glob matches here. */; |
| @@ -1987,11 +1987,11 @@ | |
| 1987 | ** and if the latest check-in on doc-br is in the unindexed set of |
| 1988 | ** check-ins, then update all 'd' entries in FTSDOCS that have |
| 1989 | ** changed. |
| 1990 | */ |
| 1991 | static void search_update_doc_index(void){ |
| 1992 | const char *zMainBranch = db_main_branch(); |
| 1993 | const char *zDocBranches = db_get("doc-branch", zMainBranch); |
| 1994 | int i; |
| 1995 | Glob * pGlob = glob_create(zDocBranches) |
| 1996 | /* We're misusing a Glob as a list of comma-/space-delimited |
| 1997 | ** tokens. We're not actually doing glob matches here. */; |
| 1998 |
+2
-2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -2282,11 +2282,11 @@ | ||
| 2282 | 2282 | ** WEBPAGE: srchsetup |
| 2283 | 2283 | ** |
| 2284 | 2284 | ** Configure the search engine. Requires Admin privilege. |
| 2285 | 2285 | */ |
| 2286 | 2286 | void page_srchsetup(){ |
| 2287 | - char *zMainBranch; | |
| 2287 | + const char *zMainBranch; | |
| 2288 | 2288 | login_check_credentials(); |
| 2289 | 2289 | if( !g.perm.Admin ){ |
| 2290 | 2290 | login_needed(0); |
| 2291 | 2291 | return; |
| 2292 | 2292 | } |
| @@ -2313,11 +2313,11 @@ | ||
| 2313 | 2313 | @ <tr><td>*<td><td>Search all checked-in files</tr> |
| 2314 | 2314 | @ <tr><td><i>(blank)</i><td> |
| 2315 | 2315 | @ <td>Search nothing. (Disables document search).</tr> |
| 2316 | 2316 | @ </table> |
| 2317 | 2317 | @ <hr> |
| 2318 | - zMainBranch = db_get("main-branch", 0); | |
| 2318 | + zMainBranch = db_main_branch(); | |
| 2319 | 2319 | entry_attribute("Document Branches", 20, "doc-branch", "db", zMainBranch, 0); |
| 2320 | 2320 | @ <p>When searching documents, use the versions of the files found at the |
| 2321 | 2321 | @ type of the "Document Branches" branch. Recommended value: the name of |
| 2322 | 2322 | @ the main branch (usually "trunk"). |
| 2323 | 2323 | @ Document search is disabled if blank. It may be a list of branch names |
| 2324 | 2324 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -2282,11 +2282,11 @@ | |
| 2282 | ** WEBPAGE: srchsetup |
| 2283 | ** |
| 2284 | ** Configure the search engine. Requires Admin privilege. |
| 2285 | */ |
| 2286 | void page_srchsetup(){ |
| 2287 | char *zMainBranch; |
| 2288 | login_check_credentials(); |
| 2289 | if( !g.perm.Admin ){ |
| 2290 | login_needed(0); |
| 2291 | return; |
| 2292 | } |
| @@ -2313,11 +2313,11 @@ | |
| 2313 | @ <tr><td>*<td><td>Search all checked-in files</tr> |
| 2314 | @ <tr><td><i>(blank)</i><td> |
| 2315 | @ <td>Search nothing. (Disables document search).</tr> |
| 2316 | @ </table> |
| 2317 | @ <hr> |
| 2318 | zMainBranch = db_get("main-branch", 0); |
| 2319 | entry_attribute("Document Branches", 20, "doc-branch", "db", zMainBranch, 0); |
| 2320 | @ <p>When searching documents, use the versions of the files found at the |
| 2321 | @ type of the "Document Branches" branch. Recommended value: the name of |
| 2322 | @ the main branch (usually "trunk"). |
| 2323 | @ Document search is disabled if blank. It may be a list of branch names |
| 2324 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -2282,11 +2282,11 @@ | |
| 2282 | ** WEBPAGE: srchsetup |
| 2283 | ** |
| 2284 | ** Configure the search engine. Requires Admin privilege. |
| 2285 | */ |
| 2286 | void page_srchsetup(){ |
| 2287 | const char *zMainBranch; |
| 2288 | login_check_credentials(); |
| 2289 | if( !g.perm.Admin ){ |
| 2290 | login_needed(0); |
| 2291 | return; |
| 2292 | } |
| @@ -2313,11 +2313,11 @@ | |
| 2313 | @ <tr><td>*<td><td>Search all checked-in files</tr> |
| 2314 | @ <tr><td><i>(blank)</i><td> |
| 2315 | @ <td>Search nothing. (Disables document search).</tr> |
| 2316 | @ </table> |
| 2317 | @ <hr> |
| 2318 | zMainBranch = db_main_branch(); |
| 2319 | entry_attribute("Document Branches", 20, "doc-branch", "db", zMainBranch, 0); |
| 2320 | @ <p>When searching documents, use the versions of the files found at the |
| 2321 | @ type of the "Document Branches" branch. Recommended value: the name of |
| 2322 | @ the main branch (usually "trunk"). |
| 2323 | @ Document search is disabled if blank. It may be a list of branch names |
| 2324 |
+1
-2
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -949,21 +949,20 @@ | ||
| 949 | 949 | Blob cacheKey; /* The key to cache */ |
| 950 | 950 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 951 | 951 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 952 | 952 | Blob tarball; /* Tarball accumulated here */ |
| 953 | 953 | const char *z; |
| 954 | - char *zMainBranch = db_get("main-branch", 0); | |
| 955 | 954 | |
| 956 | 955 | login_check_credentials(); |
| 957 | 956 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 958 | 957 | if( robot_restrict("zip") ) return; |
| 959 | 958 | fossil_nice_default(); |
| 960 | 959 | zName = fossil_strdup(PD("name","")); |
| 961 | 960 | z = P("r"); |
| 962 | 961 | if( z==0 ) z = P("uuid"); |
| 963 | 962 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 964 | - if( z==0 ) z = fossil_strdup(zMainBranch); | |
| 963 | + if( z==0 ) z = fossil_strdup(db_main_branch()); | |
| 965 | 964 | g.zOpenRevision = zRid = fossil_strdup(z); |
| 966 | 965 | nRid = strlen(zRid); |
| 967 | 966 | zInclude = P("in"); |
| 968 | 967 | if( zInclude ) pInclude = glob_create(zInclude); |
| 969 | 968 | zExclude = P("ex"); |
| 970 | 969 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -949,21 +949,20 @@ | |
| 949 | Blob cacheKey; /* The key to cache */ |
| 950 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 951 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 952 | Blob tarball; /* Tarball accumulated here */ |
| 953 | const char *z; |
| 954 | char *zMainBranch = db_get("main-branch", 0); |
| 955 | |
| 956 | login_check_credentials(); |
| 957 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 958 | if( robot_restrict("zip") ) return; |
| 959 | fossil_nice_default(); |
| 960 | zName = fossil_strdup(PD("name","")); |
| 961 | z = P("r"); |
| 962 | if( z==0 ) z = P("uuid"); |
| 963 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 964 | if( z==0 ) z = fossil_strdup(zMainBranch); |
| 965 | g.zOpenRevision = zRid = fossil_strdup(z); |
| 966 | nRid = strlen(zRid); |
| 967 | zInclude = P("in"); |
| 968 | if( zInclude ) pInclude = glob_create(zInclude); |
| 969 | zExclude = P("ex"); |
| 970 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -949,21 +949,20 @@ | |
| 949 | Blob cacheKey; /* The key to cache */ |
| 950 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 951 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 952 | Blob tarball; /* Tarball accumulated here */ |
| 953 | const char *z; |
| 954 | |
| 955 | login_check_credentials(); |
| 956 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 957 | if( robot_restrict("zip") ) return; |
| 958 | fossil_nice_default(); |
| 959 | zName = fossil_strdup(PD("name","")); |
| 960 | z = P("r"); |
| 961 | if( z==0 ) z = P("uuid"); |
| 962 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 963 | if( z==0 ) z = fossil_strdup(db_main_branch()); |
| 964 | g.zOpenRevision = zRid = fossil_strdup(z); |
| 965 | nRid = strlen(zRid); |
| 966 | zInclude = P("in"); |
| 967 | if( zInclude ) pInclude = glob_create(zInclude); |
| 968 | zExclude = P("ex"); |
| 969 |
+1
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -388,11 +388,11 @@ | ||
| 388 | 388 | const char *zStyle; /* Sub-name for classes for the style */ |
| 389 | 389 | const char *zDateFmt; |
| 390 | 390 | int iTableId = timeline_tableid(); |
| 391 | 391 | int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info |
| 392 | 392 | ** page rather than the /timeline page */ |
| 393 | - char *zMainBranch = db_get("main-branch","trunk"); | |
| 393 | + const char *zMainBranch = db_main_branch(); | |
| 394 | 394 | |
| 395 | 395 | |
| 396 | 396 | if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){ |
| 397 | 397 | vid = db_lget_int("checkout", 0); |
| 398 | 398 | } |
| 399 | 399 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -388,11 +388,11 @@ | |
| 388 | const char *zStyle; /* Sub-name for classes for the style */ |
| 389 | const char *zDateFmt; |
| 390 | int iTableId = timeline_tableid(); |
| 391 | int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info |
| 392 | ** page rather than the /timeline page */ |
| 393 | char *zMainBranch = db_get("main-branch","trunk"); |
| 394 | |
| 395 | |
| 396 | if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){ |
| 397 | vid = db_lget_int("checkout", 0); |
| 398 | } |
| 399 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -388,11 +388,11 @@ | |
| 388 | const char *zStyle; /* Sub-name for classes for the style */ |
| 389 | const char *zDateFmt; |
| 390 | int iTableId = timeline_tableid(); |
| 391 | int bTimestampLinksToInfo; /* True if timestamp hyperlinks go to the /info |
| 392 | ** page rather than the /timeline page */ |
| 393 | const char *zMainBranch = db_main_branch(); |
| 394 | |
| 395 | |
| 396 | if( cgi_is_loopback(g.zIpAddr) && db_open_local(0) ){ |
| 397 | vid = db_lget_int("checkout", 0); |
| 398 | } |
| 399 |
+1
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -751,17 +751,16 @@ | ||
| 751 | 751 | Manifest *historical_manifest( |
| 752 | 752 | const char *zRevision /* The check-in to query, or NULL for current */ |
| 753 | 753 | ){ |
| 754 | 754 | int vid; |
| 755 | 755 | Manifest *pManifest; |
| 756 | - char *zMainBranch = db_get("main-branch", 0); | |
| 757 | 756 | |
| 758 | 757 | /* Determine the check-in manifest artifact ID. Panic on failure. */ |
| 759 | 758 | if( zRevision ){ |
| 760 | 759 | vid = name_to_typed_rid(zRevision, "ci"); |
| 761 | 760 | }else if( !g.localOpen ){ |
| 762 | - vid = name_to_typed_rid(zMainBranch, "ci"); | |
| 761 | + vid = name_to_typed_rid(db_main_branch(), "ci"); | |
| 763 | 762 | }else{ |
| 764 | 763 | vid = db_lget_int("checkout", 0); |
| 765 | 764 | if( !is_a_version(vid) ){ |
| 766 | 765 | if( vid==0 ) return 0; |
| 767 | 766 | zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 768 | 767 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -751,17 +751,16 @@ | |
| 751 | Manifest *historical_manifest( |
| 752 | const char *zRevision /* The check-in to query, or NULL for current */ |
| 753 | ){ |
| 754 | int vid; |
| 755 | Manifest *pManifest; |
| 756 | char *zMainBranch = db_get("main-branch", 0); |
| 757 | |
| 758 | /* Determine the check-in manifest artifact ID. Panic on failure. */ |
| 759 | if( zRevision ){ |
| 760 | vid = name_to_typed_rid(zRevision, "ci"); |
| 761 | }else if( !g.localOpen ){ |
| 762 | vid = name_to_typed_rid(zMainBranch, "ci"); |
| 763 | }else{ |
| 764 | vid = db_lget_int("checkout", 0); |
| 765 | if( !is_a_version(vid) ){ |
| 766 | if( vid==0 ) return 0; |
| 767 | zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 768 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -751,17 +751,16 @@ | |
| 751 | Manifest *historical_manifest( |
| 752 | const char *zRevision /* The check-in to query, or NULL for current */ |
| 753 | ){ |
| 754 | int vid; |
| 755 | Manifest *pManifest; |
| 756 | |
| 757 | /* Determine the check-in manifest artifact ID. Panic on failure. */ |
| 758 | if( zRevision ){ |
| 759 | vid = name_to_typed_rid(zRevision, "ci"); |
| 760 | }else if( !g.localOpen ){ |
| 761 | vid = name_to_typed_rid(db_main_branch(), "ci"); |
| 762 | }else{ |
| 763 | vid = db_lget_int("checkout", 0); |
| 764 | if( !is_a_version(vid) ){ |
| 765 | if( vid==0 ) return 0; |
| 766 | zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 767 |
+1
-2
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -1020,11 +1020,10 @@ | ||
| 1020 | 1020 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 1021 | 1021 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 1022 | 1022 | Blob zip; /* ZIP archive accumulated here */ |
| 1023 | 1023 | int eType = ARCHIVE_ZIP; /* Type of archive to generate */ |
| 1024 | 1024 | char *zType; /* Human-readable archive type */ |
| 1025 | - char *zMainBranch = db_get("main-branch", 0); | |
| 1026 | 1025 | |
| 1027 | 1026 | login_check_credentials(); |
| 1028 | 1027 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 1029 | 1028 | if( robot_restrict("zip") ) return; |
| 1030 | 1029 | if( fossil_strcmp(g.zPath, "sqlar")==0 ){ |
| @@ -1037,11 +1036,11 @@ | ||
| 1037 | 1036 | fossil_nice_default(); |
| 1038 | 1037 | zName = fossil_strdup(PD("name","")); |
| 1039 | 1038 | z = P("r"); |
| 1040 | 1039 | if( z==0 ) z = P("uuid"); |
| 1041 | 1040 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 1042 | - if( z==0 ) z = fossil_strdup(zMainBranch); | |
| 1041 | + if( z==0 ) z = fossil_strdup(db_main_branch()); | |
| 1043 | 1042 | nName = strlen(zName); |
| 1044 | 1043 | g.zOpenRevision = zRid = fossil_strdup(z); |
| 1045 | 1044 | nRid = strlen(zRid); |
| 1046 | 1045 | zInclude = P("in"); |
| 1047 | 1046 | if( zInclude ) pInclude = glob_create(zInclude); |
| 1048 | 1047 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -1020,11 +1020,10 @@ | |
| 1020 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 1021 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 1022 | Blob zip; /* ZIP archive accumulated here */ |
| 1023 | int eType = ARCHIVE_ZIP; /* Type of archive to generate */ |
| 1024 | char *zType; /* Human-readable archive type */ |
| 1025 | char *zMainBranch = db_get("main-branch", 0); |
| 1026 | |
| 1027 | login_check_credentials(); |
| 1028 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 1029 | if( robot_restrict("zip") ) return; |
| 1030 | if( fossil_strcmp(g.zPath, "sqlar")==0 ){ |
| @@ -1037,11 +1036,11 @@ | |
| 1037 | fossil_nice_default(); |
| 1038 | zName = fossil_strdup(PD("name","")); |
| 1039 | z = P("r"); |
| 1040 | if( z==0 ) z = P("uuid"); |
| 1041 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 1042 | if( z==0 ) z = fossil_strdup(zMainBranch); |
| 1043 | nName = strlen(zName); |
| 1044 | g.zOpenRevision = zRid = fossil_strdup(z); |
| 1045 | nRid = strlen(zRid); |
| 1046 | zInclude = P("in"); |
| 1047 | if( zInclude ) pInclude = glob_create(zInclude); |
| 1048 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -1020,11 +1020,10 @@ | |
| 1020 | Glob *pInclude = 0; /* The compiled in= glob pattern */ |
| 1021 | Glob *pExclude = 0; /* The compiled ex= glob pattern */ |
| 1022 | Blob zip; /* ZIP archive accumulated here */ |
| 1023 | int eType = ARCHIVE_ZIP; /* Type of archive to generate */ |
| 1024 | char *zType; /* Human-readable archive type */ |
| 1025 | |
| 1026 | login_check_credentials(); |
| 1027 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 1028 | if( robot_restrict("zip") ) return; |
| 1029 | if( fossil_strcmp(g.zPath, "sqlar")==0 ){ |
| @@ -1037,11 +1036,11 @@ | |
| 1036 | fossil_nice_default(); |
| 1037 | zName = fossil_strdup(PD("name","")); |
| 1038 | z = P("r"); |
| 1039 | if( z==0 ) z = P("uuid"); |
| 1040 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 1041 | if( z==0 ) z = fossil_strdup(db_main_branch()); |
| 1042 | nName = strlen(zName); |
| 1043 | g.zOpenRevision = zRid = fossil_strdup(z); |
| 1044 | nRid = strlen(zRid); |
| 1045 | zInclude = P("in"); |
| 1046 | if( zInclude ) pInclude = glob_create(zInclude); |
| 1047 |