Fossil SCM
Pull in the latest fixes from the trunk.
Commit
a3161f5f1f7d8bbb8bf3d88e6468608e7373c9d0
Parent
ab0a0d7640af00f…
5 files changed
+4
-3
+4
-3
+5
-4
+11
-2
+1
M
src/db.c
+4
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1463,13 +1463,14 @@ | ||
| 1463 | 1463 | ** With a value argument it changes the property for the current repository. |
| 1464 | 1464 | ** |
| 1465 | 1465 | ** The "unset" command clears a property setting. |
| 1466 | 1466 | ** |
| 1467 | 1467 | ** |
| 1468 | -** autosync If enabled, automatically pull prior to | |
| 1469 | -** commit or update and automatically push | |
| 1470 | -** after commit or tag or branch creation. | |
| 1468 | +** autosync If enabled, automatically pull prior to commit | |
| 1469 | +** or update and automatically push after commit or | |
| 1470 | +** tag or branch creation. If the the value is "pullonly" | |
| 1471 | +** then only pull operations occur automatically. | |
| 1471 | 1472 | ** |
| 1472 | 1473 | ** clearsign When enabled (the default), fossil will attempt to |
| 1473 | 1474 | ** sign all commits with gpg. When disabled, commits will |
| 1474 | 1475 | ** be unsigned. |
| 1475 | 1476 | ** |
| 1476 | 1477 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1463,13 +1463,14 @@ | |
| 1463 | ** With a value argument it changes the property for the current repository. |
| 1464 | ** |
| 1465 | ** The "unset" command clears a property setting. |
| 1466 | ** |
| 1467 | ** |
| 1468 | ** autosync If enabled, automatically pull prior to |
| 1469 | ** commit or update and automatically push |
| 1470 | ** after commit or tag or branch creation. |
| 1471 | ** |
| 1472 | ** clearsign When enabled (the default), fossil will attempt to |
| 1473 | ** sign all commits with gpg. When disabled, commits will |
| 1474 | ** be unsigned. |
| 1475 | ** |
| 1476 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1463,13 +1463,14 @@ | |
| 1463 | ** With a value argument it changes the property for the current repository. |
| 1464 | ** |
| 1465 | ** The "unset" command clears a property setting. |
| 1466 | ** |
| 1467 | ** |
| 1468 | ** autosync If enabled, automatically pull prior to commit |
| 1469 | ** or update and automatically push after commit or |
| 1470 | ** tag or branch creation. If the the value is "pullonly" |
| 1471 | ** then only pull operations occur automatically. |
| 1472 | ** |
| 1473 | ** clearsign When enabled (the default), fossil will attempt to |
| 1474 | ** sign all commits with gpg. When disabled, commits will |
| 1475 | ** be unsigned. |
| 1476 | ** |
| 1477 |
M
src/db.c
+4
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1463,13 +1463,14 @@ | ||
| 1463 | 1463 | ** With a value argument it changes the property for the current repository. |
| 1464 | 1464 | ** |
| 1465 | 1465 | ** The "unset" command clears a property setting. |
| 1466 | 1466 | ** |
| 1467 | 1467 | ** |
| 1468 | -** autosync If enabled, automatically pull prior to | |
| 1469 | -** commit or update and automatically push | |
| 1470 | -** after commit or tag or branch creation. | |
| 1468 | +** autosync If enabled, automatically pull prior to commit | |
| 1469 | +** or update and automatically push after commit or | |
| 1470 | +** tag or branch creation. If the the value is "pullonly" | |
| 1471 | +** then only pull operations occur automatically. | |
| 1471 | 1472 | ** |
| 1472 | 1473 | ** clearsign When enabled (the default), fossil will attempt to |
| 1473 | 1474 | ** sign all commits with gpg. When disabled, commits will |
| 1474 | 1475 | ** be unsigned. |
| 1475 | 1476 | ** |
| 1476 | 1477 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1463,13 +1463,14 @@ | |
| 1463 | ** With a value argument it changes the property for the current repository. |
| 1464 | ** |
| 1465 | ** The "unset" command clears a property setting. |
| 1466 | ** |
| 1467 | ** |
| 1468 | ** autosync If enabled, automatically pull prior to |
| 1469 | ** commit or update and automatically push |
| 1470 | ** after commit or tag or branch creation. |
| 1471 | ** |
| 1472 | ** clearsign When enabled (the default), fossil will attempt to |
| 1473 | ** sign all commits with gpg. When disabled, commits will |
| 1474 | ** be unsigned. |
| 1475 | ** |
| 1476 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1463,13 +1463,14 @@ | |
| 1463 | ** With a value argument it changes the property for the current repository. |
| 1464 | ** |
| 1465 | ** The "unset" command clears a property setting. |
| 1466 | ** |
| 1467 | ** |
| 1468 | ** autosync If enabled, automatically pull prior to commit |
| 1469 | ** or update and automatically push after commit or |
| 1470 | ** tag or branch creation. If the the value is "pullonly" |
| 1471 | ** then only pull operations occur automatically. |
| 1472 | ** |
| 1473 | ** clearsign When enabled (the default), fossil will attempt to |
| 1474 | ** sign all commits with gpg. When disabled, commits will |
| 1475 | ** be unsigned. |
| 1476 | ** |
| 1477 |
+5
-4
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1060,19 +1060,20 @@ | ||
| 1060 | 1060 | Blob uuid; |
| 1061 | 1061 | int rid; |
| 1062 | 1062 | |
| 1063 | 1063 | zName = P("name"); |
| 1064 | 1064 | if( zName==0 ) fossil_redirect_home(); |
| 1065 | + if( validate16(zName, strlen(zName)) | |
| 1066 | + && db_exists("SELECT 1 FROM ticket WHERE tkt_uuid LIKE '%q%%'", zName) ){ | |
| 1067 | + tktview_page(); | |
| 1068 | + return; | |
| 1069 | + } | |
| 1065 | 1070 | blob_set(&uuid, zName); |
| 1066 | 1071 | if( name_to_uuid(&uuid, 1) ){ |
| 1067 | 1072 | fossil_redirect_home(); |
| 1068 | 1073 | } |
| 1069 | 1074 | zName = blob_str(&uuid); |
| 1070 | - if( db_exists("SELECT 1 FROM ticket WHERE tkt_uuid='%s'", zName) ){ | |
| 1071 | - tktview_page(); | |
| 1072 | - return; | |
| 1073 | - } | |
| 1074 | 1075 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid='%s'", zName); |
| 1075 | 1076 | if( rid==0 ){ |
| 1076 | 1077 | style_header("Broken Link"); |
| 1077 | 1078 | @ <p>No such object: %h(zName)</p> |
| 1078 | 1079 | style_footer(); |
| 1079 | 1080 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1060,19 +1060,20 @@ | |
| 1060 | Blob uuid; |
| 1061 | int rid; |
| 1062 | |
| 1063 | zName = P("name"); |
| 1064 | if( zName==0 ) fossil_redirect_home(); |
| 1065 | blob_set(&uuid, zName); |
| 1066 | if( name_to_uuid(&uuid, 1) ){ |
| 1067 | fossil_redirect_home(); |
| 1068 | } |
| 1069 | zName = blob_str(&uuid); |
| 1070 | if( db_exists("SELECT 1 FROM ticket WHERE tkt_uuid='%s'", zName) ){ |
| 1071 | tktview_page(); |
| 1072 | return; |
| 1073 | } |
| 1074 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid='%s'", zName); |
| 1075 | if( rid==0 ){ |
| 1076 | style_header("Broken Link"); |
| 1077 | @ <p>No such object: %h(zName)</p> |
| 1078 | style_footer(); |
| 1079 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1060,19 +1060,20 @@ | |
| 1060 | Blob uuid; |
| 1061 | int rid; |
| 1062 | |
| 1063 | zName = P("name"); |
| 1064 | if( zName==0 ) fossil_redirect_home(); |
| 1065 | if( validate16(zName, strlen(zName)) |
| 1066 | && db_exists("SELECT 1 FROM ticket WHERE tkt_uuid LIKE '%q%%'", zName) ){ |
| 1067 | tktview_page(); |
| 1068 | return; |
| 1069 | } |
| 1070 | blob_set(&uuid, zName); |
| 1071 | if( name_to_uuid(&uuid, 1) ){ |
| 1072 | fossil_redirect_home(); |
| 1073 | } |
| 1074 | zName = blob_str(&uuid); |
| 1075 | rid = db_int(0, "SELECT rid FROM blob WHERE uuid='%s'", zName); |
| 1076 | if( rid==0 ){ |
| 1077 | style_header("Broken Link"); |
| 1078 | @ <p>No such object: %h(zName)</p> |
| 1079 | style_footer(); |
| 1080 |
+11
-2
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -41,15 +41,24 @@ | ||
| 41 | 41 | ** autosync. This will be a pull if the argument is true or a push |
| 42 | 42 | ** if the argument is false. |
| 43 | 43 | */ |
| 44 | 44 | void autosync(int flags){ |
| 45 | 45 | const char *zUrl; |
| 46 | + const char *zAutosync; | |
| 46 | 47 | if( g.fNoSync ){ |
| 47 | 48 | return; |
| 48 | 49 | } |
| 49 | - if( db_get_boolean("autosync", 0)==0 ){ | |
| 50 | - return; | |
| 50 | + zAutosync = db_get("autosync", 0); | |
| 51 | + if( zAutosync ){ | |
| 52 | + if( (flags & AUTOSYNC_PUSH)!=0 && memcmp(zAutosync,"pull",4)==0 ){ | |
| 53 | + return; /* Do not auto-push when autosync=pullonly */ | |
| 54 | + } | |
| 55 | + if( is_false(zAutosync) ){ | |
| 56 | + return; /* Autosync is completely off */ | |
| 57 | + } | |
| 58 | + }else{ | |
| 59 | + /* Autosync defaults on. To make it default off, "return" here. */ | |
| 51 | 60 | } |
| 52 | 61 | zUrl = db_get("last-sync-url", 0); |
| 53 | 62 | if( zUrl==0 ){ |
| 54 | 63 | return; /* No default server */ |
| 55 | 64 | } |
| 56 | 65 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -41,15 +41,24 @@ | |
| 41 | ** autosync. This will be a pull if the argument is true or a push |
| 42 | ** if the argument is false. |
| 43 | */ |
| 44 | void autosync(int flags){ |
| 45 | const char *zUrl; |
| 46 | if( g.fNoSync ){ |
| 47 | return; |
| 48 | } |
| 49 | if( db_get_boolean("autosync", 0)==0 ){ |
| 50 | return; |
| 51 | } |
| 52 | zUrl = db_get("last-sync-url", 0); |
| 53 | if( zUrl==0 ){ |
| 54 | return; /* No default server */ |
| 55 | } |
| 56 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -41,15 +41,24 @@ | |
| 41 | ** autosync. This will be a pull if the argument is true or a push |
| 42 | ** if the argument is false. |
| 43 | */ |
| 44 | void autosync(int flags){ |
| 45 | const char *zUrl; |
| 46 | const char *zAutosync; |
| 47 | if( g.fNoSync ){ |
| 48 | return; |
| 49 | } |
| 50 | zAutosync = db_get("autosync", 0); |
| 51 | if( zAutosync ){ |
| 52 | if( (flags & AUTOSYNC_PUSH)!=0 && memcmp(zAutosync,"pull",4)==0 ){ |
| 53 | return; /* Do not auto-push when autosync=pullonly */ |
| 54 | } |
| 55 | if( is_false(zAutosync) ){ |
| 56 | return; /* Autosync is completely off */ |
| 57 | } |
| 58 | }else{ |
| 59 | /* Autosync defaults on. To make it default off, "return" here. */ |
| 60 | } |
| 61 | zUrl = db_get("last-sync-url", 0); |
| 62 | if( zUrl==0 ){ |
| 63 | return; /* No default server */ |
| 64 | } |
| 65 |
+1
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -235,10 +235,11 @@ | ||
| 235 | 235 | zName = db_column_text(&q, 1); |
| 236 | 236 | rid = db_column_int(&q, 2); |
| 237 | 237 | content_get(rid, &content); |
| 238 | 238 | if( verbose ) printf("%s\n", &zName[nRepos]); |
| 239 | 239 | blob_write_to_file(&content, zName); |
| 240 | + blob_reset(&content); | |
| 240 | 241 | db_multi_exec("UPDATE vfile SET mtime=%lld WHERE id=%d", |
| 241 | 242 | file_mtime(zName), id); |
| 242 | 243 | } |
| 243 | 244 | db_finalize(&q); |
| 244 | 245 | } |
| 245 | 246 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -235,10 +235,11 @@ | |
| 235 | zName = db_column_text(&q, 1); |
| 236 | rid = db_column_int(&q, 2); |
| 237 | content_get(rid, &content); |
| 238 | if( verbose ) printf("%s\n", &zName[nRepos]); |
| 239 | blob_write_to_file(&content, zName); |
| 240 | db_multi_exec("UPDATE vfile SET mtime=%lld WHERE id=%d", |
| 241 | file_mtime(zName), id); |
| 242 | } |
| 243 | db_finalize(&q); |
| 244 | } |
| 245 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -235,10 +235,11 @@ | |
| 235 | zName = db_column_text(&q, 1); |
| 236 | rid = db_column_int(&q, 2); |
| 237 | content_get(rid, &content); |
| 238 | if( verbose ) printf("%s\n", &zName[nRepos]); |
| 239 | blob_write_to_file(&content, zName); |
| 240 | blob_reset(&content); |
| 241 | db_multi_exec("UPDATE vfile SET mtime=%lld WHERE id=%d", |
| 242 | file_mtime(zName), id); |
| 243 | } |
| 244 | db_finalize(&q); |
| 245 | } |
| 246 |