Fossil SCM

When committing without parent-id (additional "initial" commits), make sure the branch-name is set to "trunk" when not provided otherwise.

jan.nijtmans 2019-07-16 15:42 trunk
Commit 0fd6cf166ce5d9c23d3148bb798b7f1039ebc0b40d3120b60657f760ad15e9aa
1 file changed +11 -8
+11 -8
--- src/checkin.c
+++ src/checkin.c
@@ -2122,10 +2122,21 @@
21222122
noSign = db_get_boolean("omitsign", 0)|noSign;
21232123
if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
21242124
useCksum = db_get_boolean("repo-cksum", 1);
21252125
outputManifest = db_get_manifest_setting();
21262126
verify_all_options();
2127
+
2128
+ /* Get the ID of the parent manifest artifact */
2129
+ vid = db_lget_int("checkout", 0);
2130
+ if( vid==0 ){
2131
+ useCksum = 1;
2132
+ if( sCiInfo.zBranch==0 ) {
2133
+ sCiInfo.zBranch=db_get("main-branch", "trunk");
2134
+ }
2135
+ }else if( content_is_private(vid) ){
2136
+ g.markPrivate = 1;
2137
+ }
21272138
21282139
/* Do not allow the creation of a new branch using an existing open
21292140
** branch name unless the --force flag is used */
21302141
if( sCiInfo.zBranch!=0
21312142
&& !forceFlag
@@ -2151,18 +2162,10 @@
21512162
*/
21522163
if( !forceDelta && !db_get_boolean("seen-delta-manifest",0) ){
21532164
forceBaseline = 1;
21542165
}
21552166
2156
- /* Get the ID of the parent manifest artifact */
2157
- vid = db_lget_int("checkout", 0);
2158
- if( vid==0 ){
2159
- useCksum = 1;
2160
- }else if( content_is_private(vid) ){
2161
- g.markPrivate = 1;
2162
- }
2163
-
21642167
/*
21652168
** Autosync if autosync is enabled and this is not a private check-in.
21662169
*/
21672170
if( !g.markPrivate ){
21682171
int syncFlags = SYNC_PULL;
21692172
--- src/checkin.c
+++ src/checkin.c
@@ -2122,10 +2122,21 @@
2122 noSign = db_get_boolean("omitsign", 0)|noSign;
2123 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
2124 useCksum = db_get_boolean("repo-cksum", 1);
2125 outputManifest = db_get_manifest_setting();
2126 verify_all_options();
 
 
 
 
 
 
 
 
 
 
 
2127
2128 /* Do not allow the creation of a new branch using an existing open
2129 ** branch name unless the --force flag is used */
2130 if( sCiInfo.zBranch!=0
2131 && !forceFlag
@@ -2151,18 +2162,10 @@
2151 */
2152 if( !forceDelta && !db_get_boolean("seen-delta-manifest",0) ){
2153 forceBaseline = 1;
2154 }
2155
2156 /* Get the ID of the parent manifest artifact */
2157 vid = db_lget_int("checkout", 0);
2158 if( vid==0 ){
2159 useCksum = 1;
2160 }else if( content_is_private(vid) ){
2161 g.markPrivate = 1;
2162 }
2163
2164 /*
2165 ** Autosync if autosync is enabled and this is not a private check-in.
2166 */
2167 if( !g.markPrivate ){
2168 int syncFlags = SYNC_PULL;
2169
--- src/checkin.c
+++ src/checkin.c
@@ -2122,10 +2122,21 @@
2122 noSign = db_get_boolean("omitsign", 0)|noSign;
2123 if( db_get_boolean("clearsign", 0)==0 ){ noSign = 1; }
2124 useCksum = db_get_boolean("repo-cksum", 1);
2125 outputManifest = db_get_manifest_setting();
2126 verify_all_options();
2127
2128 /* Get the ID of the parent manifest artifact */
2129 vid = db_lget_int("checkout", 0);
2130 if( vid==0 ){
2131 useCksum = 1;
2132 if( sCiInfo.zBranch==0 ) {
2133 sCiInfo.zBranch=db_get("main-branch", "trunk");
2134 }
2135 }else if( content_is_private(vid) ){
2136 g.markPrivate = 1;
2137 }
2138
2139 /* Do not allow the creation of a new branch using an existing open
2140 ** branch name unless the --force flag is used */
2141 if( sCiInfo.zBranch!=0
2142 && !forceFlag
@@ -2151,18 +2162,10 @@
2162 */
2163 if( !forceDelta && !db_get_boolean("seen-delta-manifest",0) ){
2164 forceBaseline = 1;
2165 }
2166
 
 
 
 
 
 
 
 
2167 /*
2168 ** Autosync if autosync is enabled and this is not a private check-in.
2169 */
2170 if( !g.markPrivate ){
2171 int syncFlags = SYNC_PULL;
2172

Keyboard Shortcuts

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