Fossil SCM
Preserve the hash policy on a clone.
Commit
d9b3a863efa37817e9b05e02966dea0f62a76e60
Parent
95543ce45b6fbc9…
2 files changed
+1
+6
-7
+1
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -175,10 +175,11 @@ | ||
| 175 | 175 | db_initial_setup(0, 0, zDefaultUser); |
| 176 | 176 | user_select(); |
| 177 | 177 | db_set("content-schema", CONTENT_SCHEMA, 0); |
| 178 | 178 | db_set("aux-schema", AUX_SCHEMA_MAX, 0); |
| 179 | 179 | db_set("rebuilt", get_version(), 0); |
| 180 | + db_unset("hash-policy", 0); | |
| 180 | 181 | remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, g.argv[2]); |
| 181 | 182 | url_remember(); |
| 182 | 183 | if( g.zSSLIdentity!=0 ){ |
| 183 | 184 | /* If the --ssl-identity option was specified, store it as a setting */ |
| 184 | 185 | Blob fn; |
| 185 | 186 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -175,10 +175,11 @@ | |
| 175 | db_initial_setup(0, 0, zDefaultUser); |
| 176 | user_select(); |
| 177 | db_set("content-schema", CONTENT_SCHEMA, 0); |
| 178 | db_set("aux-schema", AUX_SCHEMA_MAX, 0); |
| 179 | db_set("rebuilt", get_version(), 0); |
| 180 | remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, g.argv[2]); |
| 181 | url_remember(); |
| 182 | if( g.zSSLIdentity!=0 ){ |
| 183 | /* If the --ssl-identity option was specified, store it as a setting */ |
| 184 | Blob fn; |
| 185 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -175,10 +175,11 @@ | |
| 175 | db_initial_setup(0, 0, zDefaultUser); |
| 176 | user_select(); |
| 177 | db_set("content-schema", CONTENT_SCHEMA, 0); |
| 178 | db_set("aux-schema", AUX_SCHEMA_MAX, 0); |
| 179 | db_set("rebuilt", get_version(), 0); |
| 180 | db_unset("hash-policy", 0); |
| 181 | remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, g.argv[2]); |
| 182 | url_remember(); |
| 183 | if( g.zSSLIdentity!=0 ){ |
| 184 | /* If the --ssl-identity option was specified, store it as a setting */ |
| 185 | Blob fn; |
| 186 |
+6
-7
| --- src/hname.c | ||
| +++ src/hname.c | ||
| @@ -198,22 +198,21 @@ | ||
| 198 | 198 | |
| 199 | 199 | /* |
| 200 | 200 | ** Return the default hash policy for repositories that do not currently |
| 201 | 201 | ** have an assigned hash policy. |
| 202 | 202 | ** |
| 203 | -** Make the default HPOLICY_AUTO if there are SHA1 artficats but no SHA3 | |
| 203 | +** Make the default HPOLICY_AUTO if there are SHA1 artficates but no SHA3 | |
| 204 | 204 | ** artifacts in the repository. Make the default HPOLICY_SHA3 if there |
| 205 | -** are one or more SHA3 artifacts. Make the default policy HPOLICY_SHUN_SHA1 | |
| 206 | -** if the repository contains no artifact at all. | |
| 205 | +** are one or more SHA3 artifacts or if the repository is initially empty. | |
| 207 | 206 | */ |
| 208 | 207 | int hname_default_policy(void){ |
| 209 | - if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40") ){ | |
| 208 | + if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40") | |
| 209 | + || !db_exists("SELECT 1 FROM blob WHERE length(uuid)==40") | |
| 210 | + ){ | |
| 210 | 211 | return HPOLICY_SHA3; |
| 211 | - }else if( db_exists("SELECT 1 FROM blob WHERE length(uuid)==40") ){ | |
| 212 | - return HPOLICY_AUTO; | |
| 213 | 212 | }else{ |
| 214 | - return HPOLICY_SHUN_SHA1; | |
| 213 | + return HPOLICY_AUTO; | |
| 215 | 214 | } |
| 216 | 215 | } |
| 217 | 216 | |
| 218 | 217 | /* |
| 219 | 218 | ** COMMAND: hash-policy* |
| 220 | 219 |
| --- src/hname.c | |
| +++ src/hname.c | |
| @@ -198,22 +198,21 @@ | |
| 198 | |
| 199 | /* |
| 200 | ** Return the default hash policy for repositories that do not currently |
| 201 | ** have an assigned hash policy. |
| 202 | ** |
| 203 | ** Make the default HPOLICY_AUTO if there are SHA1 artficats but no SHA3 |
| 204 | ** artifacts in the repository. Make the default HPOLICY_SHA3 if there |
| 205 | ** are one or more SHA3 artifacts. Make the default policy HPOLICY_SHUN_SHA1 |
| 206 | ** if the repository contains no artifact at all. |
| 207 | */ |
| 208 | int hname_default_policy(void){ |
| 209 | if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40") ){ |
| 210 | return HPOLICY_SHA3; |
| 211 | }else if( db_exists("SELECT 1 FROM blob WHERE length(uuid)==40") ){ |
| 212 | return HPOLICY_AUTO; |
| 213 | }else{ |
| 214 | return HPOLICY_SHUN_SHA1; |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | /* |
| 219 | ** COMMAND: hash-policy* |
| 220 |
| --- src/hname.c | |
| +++ src/hname.c | |
| @@ -198,22 +198,21 @@ | |
| 198 | |
| 199 | /* |
| 200 | ** Return the default hash policy for repositories that do not currently |
| 201 | ** have an assigned hash policy. |
| 202 | ** |
| 203 | ** Make the default HPOLICY_AUTO if there are SHA1 artficates but no SHA3 |
| 204 | ** artifacts in the repository. Make the default HPOLICY_SHA3 if there |
| 205 | ** are one or more SHA3 artifacts or if the repository is initially empty. |
| 206 | */ |
| 207 | int hname_default_policy(void){ |
| 208 | if( db_exists("SELECT 1 FROM blob WHERE length(uuid)>40") |
| 209 | || !db_exists("SELECT 1 FROM blob WHERE length(uuid)==40") |
| 210 | ){ |
| 211 | return HPOLICY_SHA3; |
| 212 | }else{ |
| 213 | return HPOLICY_AUTO; |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /* |
| 218 | ** COMMAND: hash-policy* |
| 219 |