Fossil SCM
Change the synclog to keep timestamps with unixepoch(). This requires SQLite 3.38.0.
Commit
3be414357f8056651eb7da6d5d78b3949060b6ef228370daa470704fabad8dee
Parent
d57a63254c1d417…
6 files changed
+1
-1
+2
-2
+1
-1
+4
-4
+21
-9
+28
-16
M
auto.def
+1
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -32,11 +32,11 @@ | ||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | # Update the minimum required SQLite version number here, and also |
| 35 | 35 | # in src/main.c near the sqlite3_libversion_number() call. Take care |
| 36 | 36 | # that both places agree! |
| 37 | -define MINIMUM_SQLITE_VERSION "3.37.0" | |
| 37 | +define MINIMUM_SQLITE_VERSION "3.38.0" | |
| 38 | 38 | |
| 39 | 39 | # This is useful for people wanting Fossil to use an external SQLite library |
| 40 | 40 | # to compare the one they have against the minimum required |
| 41 | 41 | if {[opt-bool print-minimum-sqlite-version]} { |
| 42 | 42 | puts [get-define MINIMUM_SQLITE_VERSION] |
| 43 | 43 |
| --- auto.def | |
| +++ auto.def | |
| @@ -32,11 +32,11 @@ | |
| 32 | } |
| 33 | |
| 34 | # Update the minimum required SQLite version number here, and also |
| 35 | # in src/main.c near the sqlite3_libversion_number() call. Take care |
| 36 | # that both places agree! |
| 37 | define MINIMUM_SQLITE_VERSION "3.37.0" |
| 38 | |
| 39 | # This is useful for people wanting Fossil to use an external SQLite library |
| 40 | # to compare the one they have against the minimum required |
| 41 | if {[opt-bool print-minimum-sqlite-version]} { |
| 42 | puts [get-define MINIMUM_SQLITE_VERSION] |
| 43 |
| --- auto.def | |
| +++ auto.def | |
| @@ -32,11 +32,11 @@ | |
| 32 | } |
| 33 | |
| 34 | # Update the minimum required SQLite version number here, and also |
| 35 | # in src/main.c near the sqlite3_libversion_number() call. Take care |
| 36 | # that both places agree! |
| 37 | define MINIMUM_SQLITE_VERSION "3.38.0" |
| 38 | |
| 39 | # This is useful for people wanting Fossil to use an external SQLite library |
| 40 | # to compare the one they have against the minimum required |
| 41 | if {[opt-bool print-minimum-sqlite-version]} { |
| 42 | puts [get-define MINIMUM_SQLITE_VERSION] |
| 43 |
+2
-2
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1700,11 +1700,11 @@ | ||
| 1700 | 1700 | fossil_system(zRepack); |
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | /* Record this export into the sync log */ |
| 1704 | 1704 | zMirrorAbs = file_canonical_name_dup(zMirror); |
| 1705 | - sync_log_entry(SYNC_PUSH, zMirrorAbs, "git"); | |
| 1705 | + sync_log_entry(SYNC_PUSH, zMirrorAbs, "git", 0); | |
| 1706 | 1706 | fossil_free(zMirrorAbs); |
| 1707 | 1707 | |
| 1708 | 1708 | /* Optionally do a "git push" */ |
| 1709 | 1709 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1710 | 1710 | if( zPushUrl ){ |
| @@ -1725,11 +1725,11 @@ | ||
| 1725 | 1725 | }else if( db_is_writeable("repository") ){ |
| 1726 | 1726 | db_unprotect(PROTECT_CONFIG); |
| 1727 | 1727 | db_multi_exec("REPLACE INTO config(name,value,mtime)" |
| 1728 | 1728 | "VALUES('gitpush:%q',1,now())", zPushUrl); |
| 1729 | 1729 | db_protect_pop(); |
| 1730 | - sync_log_entry(SYNC_PUSH, zPushUrl, "git-push"); | |
| 1730 | + sync_log_entry(SYNC_PUSH, zPushUrl, "git-push", 0); | |
| 1731 | 1731 | } |
| 1732 | 1732 | fossil_free(zPushCmd); |
| 1733 | 1733 | } |
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | 1736 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1700,11 +1700,11 @@ | |
| 1700 | fossil_system(zRepack); |
| 1701 | } |
| 1702 | |
| 1703 | /* Record this export into the sync log */ |
| 1704 | zMirrorAbs = file_canonical_name_dup(zMirror); |
| 1705 | sync_log_entry(SYNC_PUSH, zMirrorAbs, "git"); |
| 1706 | fossil_free(zMirrorAbs); |
| 1707 | |
| 1708 | /* Optionally do a "git push" */ |
| 1709 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1710 | if( zPushUrl ){ |
| @@ -1725,11 +1725,11 @@ | |
| 1725 | }else if( db_is_writeable("repository") ){ |
| 1726 | db_unprotect(PROTECT_CONFIG); |
| 1727 | db_multi_exec("REPLACE INTO config(name,value,mtime)" |
| 1728 | "VALUES('gitpush:%q',1,now())", zPushUrl); |
| 1729 | db_protect_pop(); |
| 1730 | sync_log_entry(SYNC_PUSH, zPushUrl, "git-push"); |
| 1731 | } |
| 1732 | fossil_free(zPushCmd); |
| 1733 | } |
| 1734 | } |
| 1735 | |
| 1736 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1700,11 +1700,11 @@ | |
| 1700 | fossil_system(zRepack); |
| 1701 | } |
| 1702 | |
| 1703 | /* Record this export into the sync log */ |
| 1704 | zMirrorAbs = file_canonical_name_dup(zMirror); |
| 1705 | sync_log_entry(SYNC_PUSH, zMirrorAbs, "git", 0); |
| 1706 | fossil_free(zMirrorAbs); |
| 1707 | |
| 1708 | /* Optionally do a "git push" */ |
| 1709 | zPushUrl = db_text(0, "SELECT value FROM mconfig WHERE key='autopush'"); |
| 1710 | if( zPushUrl ){ |
| @@ -1725,11 +1725,11 @@ | |
| 1725 | }else if( db_is_writeable("repository") ){ |
| 1726 | db_unprotect(PROTECT_CONFIG); |
| 1727 | db_multi_exec("REPLACE INTO config(name,value,mtime)" |
| 1728 | "VALUES('gitpush:%q',1,now())", zPushUrl); |
| 1729 | db_protect_pop(); |
| 1730 | sync_log_entry(SYNC_PUSH, zPushUrl, "git-push", 0); |
| 1731 | } |
| 1732 | fossil_free(zPushCmd); |
| 1733 | } |
| 1734 | } |
| 1735 | |
| 1736 |
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -701,11 +701,11 @@ | ||
| 701 | 701 | |
| 702 | 702 | /* When updating the minimum SQLite version, change the number here, |
| 703 | 703 | ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take |
| 704 | 704 | ** care that both places agree! */ |
| 705 | 705 | if( sqlite3_libversion_number()<3037000 ){ |
| 706 | - fossil_panic("Unsuitable SQLite version %s, must be at least 3.37.0", | |
| 706 | + fossil_panic("Unsuitable SQLite version %s, must be at least 3.38.0", | |
| 707 | 707 | sqlite3_libversion()); |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 711 | 711 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 712 | 712 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -701,11 +701,11 @@ | |
| 701 | |
| 702 | /* When updating the minimum SQLite version, change the number here, |
| 703 | ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take |
| 704 | ** care that both places agree! */ |
| 705 | if( sqlite3_libversion_number()<3037000 ){ |
| 706 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.37.0", |
| 707 | sqlite3_libversion()); |
| 708 | } |
| 709 | |
| 710 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 711 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 712 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -701,11 +701,11 @@ | |
| 701 | |
| 702 | /* When updating the minimum SQLite version, change the number here, |
| 703 | ** and also MINIMUM_SQLITE_VERSION value set in ../auto.def. Take |
| 704 | ** care that both places agree! */ |
| 705 | if( sqlite3_libversion_number()<3037000 ){ |
| 706 | fossil_panic("Unsuitable SQLite version %s, must be at least 3.38.0", |
| 707 | sqlite3_libversion()); |
| 708 | } |
| 709 | |
| 710 | sqlite3_config(SQLITE_CONFIG_MULTITHREAD); |
| 711 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 712 |
+4
-4
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -626,14 +626,14 @@ | ||
| 626 | 626 | ** this repository has synced, as well as servers with which those |
| 627 | 627 | ** servers have synced, and so forth. |
| 628 | 628 | */ |
| 629 | 629 | static const char zSynclogSchema[] = |
| 630 | 630 | @ CREATE TABLE repository.synclog( |
| 631 | -@ sfrom TEXT, -- Sync client. "self" means this repo | |
| 632 | -@ sto TEXT, -- Sync server | |
| 633 | -@ stime DATETIME, -- Time of transfer (julian day) | |
| 634 | -@ stype TEXT, -- "push", "pull", "git", "backup", "import", etc... | |
| 631 | +@ sfrom TEXT, -- Sync client. "self" means this repo | |
| 632 | +@ sto TEXT, -- Sync server | |
| 633 | +@ stime INT NOT NULL, -- Time of transfer (unixepoch) | |
| 634 | +@ stype TEXT, -- "push", "pull", "git", "backup", "import", etc... | |
| 635 | 635 | @ PRIMARY KEY(sfrom,sto) |
| 636 | 636 | @ ) WITHOUT ROWID; |
| 637 | 637 | ; |
| 638 | 638 | |
| 639 | 639 | /* Create the forum-post schema if it does not already exist */ |
| 640 | 640 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -626,14 +626,14 @@ | |
| 626 | ** this repository has synced, as well as servers with which those |
| 627 | ** servers have synced, and so forth. |
| 628 | */ |
| 629 | static const char zSynclogSchema[] = |
| 630 | @ CREATE TABLE repository.synclog( |
| 631 | @ sfrom TEXT, -- Sync client. "self" means this repo |
| 632 | @ sto TEXT, -- Sync server |
| 633 | @ stime DATETIME, -- Time of transfer (julian day) |
| 634 | @ stype TEXT, -- "push", "pull", "git", "backup", "import", etc... |
| 635 | @ PRIMARY KEY(sfrom,sto) |
| 636 | @ ) WITHOUT ROWID; |
| 637 | ; |
| 638 | |
| 639 | /* Create the forum-post schema if it does not already exist */ |
| 640 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -626,14 +626,14 @@ | |
| 626 | ** this repository has synced, as well as servers with which those |
| 627 | ** servers have synced, and so forth. |
| 628 | */ |
| 629 | static const char zSynclogSchema[] = |
| 630 | @ CREATE TABLE repository.synclog( |
| 631 | @ sfrom TEXT, -- Sync client. "self" means this repo |
| 632 | @ sto TEXT, -- Sync server |
| 633 | @ stime INT NOT NULL, -- Time of transfer (unixepoch) |
| 634 | @ stype TEXT, -- "push", "pull", "git", "backup", "import", etc... |
| 635 | @ PRIMARY KEY(sfrom,sto) |
| 636 | @ ) WITHOUT ROWID; |
| 637 | ; |
| 638 | |
| 639 | /* Create the forum-post schema if it does not already exist */ |
| 640 |
+21
-9
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -109,30 +109,39 @@ | ||
| 109 | 109 | ** are updated (or both). |
| 110 | 110 | */ |
| 111 | 111 | void sync_log_entry( |
| 112 | 112 | int syncFlags, /* Indicates whether a PUSH or PULL or both */ |
| 113 | 113 | const char *zRemote, /* Server with which we push or pull */ |
| 114 | - const char *zType /* Type of sync. NULL for normal */ | |
| 114 | + const char *zType, /* Type of sync. NULL for normal */ | |
| 115 | + i64 iTime /* Seconds since 1970, or 0 for "now" */ | |
| 115 | 116 | ){ |
| 116 | 117 | Stmt s; |
| 117 | - db_prepare(&s, | |
| 118 | - "INSERT INTO repository.synclog(sfrom,sto,stime,stype)" | |
| 119 | - " VALUES(:sfrom,:sto,julianday(),:stype)" | |
| 120 | - " ON CONFLICT DO UPDATE SET stime=julianday()" | |
| 121 | - ); | |
| 122 | 118 | schema_synclog(); |
| 119 | + if( iTime<=0 ){ | |
| 120 | + db_prepare(&s, | |
| 121 | + "INSERT INTO repository.synclog(sfrom,sto,stime,stype)" | |
| 122 | + " VALUES(:sfrom,:sto,unixepoch(),%Q)" | |
| 123 | + " ON CONFLICT DO UPDATE SET stime=unixepoch()", | |
| 124 | + zType | |
| 125 | + ); | |
| 126 | + }else{ | |
| 127 | + db_prepare(&s, | |
| 128 | + "INSERT INTO repository.synclog(sfrom,sto,stime,stype)" | |
| 129 | + " VALUES(:sfrom,:sto,%lld,%Q)" | |
| 130 | + " ON CONFLICT DO UPDATE SET stime=%lld WHERE stime<%lld", | |
| 131 | + iTime, zType, iTime, iTime | |
| 132 | + ); | |
| 133 | + } | |
| 123 | 134 | if( syncFlags & (SYNC_PULL|SYNC_CLONE) ){ |
| 124 | 135 | db_bind_text(&s, ":sfrom", zRemote); |
| 125 | 136 | db_bind_text(&s, ":sto", "this"); |
| 126 | - db_bind_text(&s, ":stype", zType); | |
| 127 | 137 | db_step(&s); |
| 128 | 138 | db_reset(&s); |
| 129 | 139 | } |
| 130 | 140 | if( syncFlags & (SYNC_PUSH) ){ |
| 131 | 141 | db_bind_text(&s, ":sfrom", "this"); |
| 132 | 142 | db_bind_text(&s, ":sto", zRemote); |
| 133 | - db_bind_text(&s, ":stype", zType); | |
| 134 | 143 | db_step(&s); |
| 135 | 144 | } |
| 136 | 145 | db_finalize(&s); |
| 137 | 146 | } |
| 138 | 147 | |
| @@ -273,10 +282,13 @@ | ||
| 273 | 282 | if( find_option("no-http-compression",0,0)!=0 ){ |
| 274 | 283 | *pSyncFlags |= SYNC_NOHTTPCOMPRESS; |
| 275 | 284 | } |
| 276 | 285 | if( find_option("all",0,0)!=0 ){ |
| 277 | 286 | *pSyncFlags |= SYNC_ALLURL; |
| 287 | + } | |
| 288 | + if( find_option("synclog",0,0)!=0 ){ | |
| 289 | + *pSyncFlags |= SYNC_PUSH_SYNCLOG; | |
| 278 | 290 | } |
| 279 | 291 | url_proxy_options(); |
| 280 | 292 | clone_ssh_find_options(); |
| 281 | 293 | if( !uvOnly ) db_find_and_open_repository(0, 0); |
| 282 | 294 | db_open_config(0, 1); |
| @@ -747,8 +759,8 @@ | ||
| 747 | 759 | } |
| 748 | 760 | } |
| 749 | 761 | db_unprotect(PROTECT_ALL); |
| 750 | 762 | db_multi_exec("VACUUM repository INTO %Q", zDest); |
| 751 | 763 | zFullName = file_canonical_name_dup(zDest); |
| 752 | - sync_log_entry(SYNC_PUSH, zFullName, "backup"); | |
| 764 | + sync_log_entry(SYNC_PUSH, zFullName, "backup", 0); | |
| 753 | 765 | fossil_free(zFullName); |
| 754 | 766 | } |
| 755 | 767 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -109,30 +109,39 @@ | |
| 109 | ** are updated (or both). |
| 110 | */ |
| 111 | void sync_log_entry( |
| 112 | int syncFlags, /* Indicates whether a PUSH or PULL or both */ |
| 113 | const char *zRemote, /* Server with which we push or pull */ |
| 114 | const char *zType /* Type of sync. NULL for normal */ |
| 115 | ){ |
| 116 | Stmt s; |
| 117 | db_prepare(&s, |
| 118 | "INSERT INTO repository.synclog(sfrom,sto,stime,stype)" |
| 119 | " VALUES(:sfrom,:sto,julianday(),:stype)" |
| 120 | " ON CONFLICT DO UPDATE SET stime=julianday()" |
| 121 | ); |
| 122 | schema_synclog(); |
| 123 | if( syncFlags & (SYNC_PULL|SYNC_CLONE) ){ |
| 124 | db_bind_text(&s, ":sfrom", zRemote); |
| 125 | db_bind_text(&s, ":sto", "this"); |
| 126 | db_bind_text(&s, ":stype", zType); |
| 127 | db_step(&s); |
| 128 | db_reset(&s); |
| 129 | } |
| 130 | if( syncFlags & (SYNC_PUSH) ){ |
| 131 | db_bind_text(&s, ":sfrom", "this"); |
| 132 | db_bind_text(&s, ":sto", zRemote); |
| 133 | db_bind_text(&s, ":stype", zType); |
| 134 | db_step(&s); |
| 135 | } |
| 136 | db_finalize(&s); |
| 137 | } |
| 138 | |
| @@ -273,10 +282,13 @@ | |
| 273 | if( find_option("no-http-compression",0,0)!=0 ){ |
| 274 | *pSyncFlags |= SYNC_NOHTTPCOMPRESS; |
| 275 | } |
| 276 | if( find_option("all",0,0)!=0 ){ |
| 277 | *pSyncFlags |= SYNC_ALLURL; |
| 278 | } |
| 279 | url_proxy_options(); |
| 280 | clone_ssh_find_options(); |
| 281 | if( !uvOnly ) db_find_and_open_repository(0, 0); |
| 282 | db_open_config(0, 1); |
| @@ -747,8 +759,8 @@ | |
| 747 | } |
| 748 | } |
| 749 | db_unprotect(PROTECT_ALL); |
| 750 | db_multi_exec("VACUUM repository INTO %Q", zDest); |
| 751 | zFullName = file_canonical_name_dup(zDest); |
| 752 | sync_log_entry(SYNC_PUSH, zFullName, "backup"); |
| 753 | fossil_free(zFullName); |
| 754 | } |
| 755 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -109,30 +109,39 @@ | |
| 109 | ** are updated (or both). |
| 110 | */ |
| 111 | void sync_log_entry( |
| 112 | int syncFlags, /* Indicates whether a PUSH or PULL or both */ |
| 113 | const char *zRemote, /* Server with which we push or pull */ |
| 114 | const char *zType, /* Type of sync. NULL for normal */ |
| 115 | i64 iTime /* Seconds since 1970, or 0 for "now" */ |
| 116 | ){ |
| 117 | Stmt s; |
| 118 | schema_synclog(); |
| 119 | if( iTime<=0 ){ |
| 120 | db_prepare(&s, |
| 121 | "INSERT INTO repository.synclog(sfrom,sto,stime,stype)" |
| 122 | " VALUES(:sfrom,:sto,unixepoch(),%Q)" |
| 123 | " ON CONFLICT DO UPDATE SET stime=unixepoch()", |
| 124 | zType |
| 125 | ); |
| 126 | }else{ |
| 127 | db_prepare(&s, |
| 128 | "INSERT INTO repository.synclog(sfrom,sto,stime,stype)" |
| 129 | " VALUES(:sfrom,:sto,%lld,%Q)" |
| 130 | " ON CONFLICT DO UPDATE SET stime=%lld WHERE stime<%lld", |
| 131 | iTime, zType, iTime, iTime |
| 132 | ); |
| 133 | } |
| 134 | if( syncFlags & (SYNC_PULL|SYNC_CLONE) ){ |
| 135 | db_bind_text(&s, ":sfrom", zRemote); |
| 136 | db_bind_text(&s, ":sto", "this"); |
| 137 | db_step(&s); |
| 138 | db_reset(&s); |
| 139 | } |
| 140 | if( syncFlags & (SYNC_PUSH) ){ |
| 141 | db_bind_text(&s, ":sfrom", "this"); |
| 142 | db_bind_text(&s, ":sto", zRemote); |
| 143 | db_step(&s); |
| 144 | } |
| 145 | db_finalize(&s); |
| 146 | } |
| 147 | |
| @@ -273,10 +282,13 @@ | |
| 282 | if( find_option("no-http-compression",0,0)!=0 ){ |
| 283 | *pSyncFlags |= SYNC_NOHTTPCOMPRESS; |
| 284 | } |
| 285 | if( find_option("all",0,0)!=0 ){ |
| 286 | *pSyncFlags |= SYNC_ALLURL; |
| 287 | } |
| 288 | if( find_option("synclog",0,0)!=0 ){ |
| 289 | *pSyncFlags |= SYNC_PUSH_SYNCLOG; |
| 290 | } |
| 291 | url_proxy_options(); |
| 292 | clone_ssh_find_options(); |
| 293 | if( !uvOnly ) db_find_and_open_repository(0, 0); |
| 294 | db_open_config(0, 1); |
| @@ -747,8 +759,8 @@ | |
| 759 | } |
| 760 | } |
| 761 | db_unprotect(PROTECT_ALL); |
| 762 | db_multi_exec("VACUUM repository INTO %Q", zDest); |
| 763 | zFullName = file_canonical_name_dup(zDest); |
| 764 | sync_log_entry(SYNC_PUSH, zFullName, "backup", 0); |
| 765 | fossil_free(zFullName); |
| 766 | } |
| 767 |
+28
-16
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1807,25 +1807,26 @@ | ||
| 1807 | 1807 | |
| 1808 | 1808 | #if INTERFACE |
| 1809 | 1809 | /* |
| 1810 | 1810 | ** Flag options for controlling client_sync() |
| 1811 | 1811 | */ |
| 1812 | -#define SYNC_PUSH 0x0001 /* push content client to server */ | |
| 1813 | -#define SYNC_PULL 0x0002 /* pull content server to client */ | |
| 1814 | -#define SYNC_CLONE 0x0004 /* clone the repository */ | |
| 1815 | -#define SYNC_PRIVATE 0x0008 /* Also transfer private content */ | |
| 1816 | -#define SYNC_VERBOSE 0x0010 /* Extra diagnostics */ | |
| 1817 | -#define SYNC_RESYNC 0x0020 /* --verily */ | |
| 1818 | -#define SYNC_FROMPARENT 0x0040 /* Pull from the parent project */ | |
| 1819 | -#define SYNC_UNVERSIONED 0x0100 /* Sync unversioned content */ | |
| 1820 | -#define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */ | |
| 1821 | -#define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ | |
| 1822 | -#define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ | |
| 1823 | -#define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ | |
| 1824 | -#define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ | |
| 1825 | -#define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */ | |
| 1826 | -#define SYNC_ALLURL 0x8000 /* The --all flag - sync to all URLs */ | |
| 1812 | +#define SYNC_PUSH 0x00001 /* push content client to server */ | |
| 1813 | +#define SYNC_PULL 0x00002 /* pull content server to client */ | |
| 1814 | +#define SYNC_CLONE 0x00004 /* clone the repository */ | |
| 1815 | +#define SYNC_PRIVATE 0x00008 /* Also transfer private content */ | |
| 1816 | +#define SYNC_VERBOSE 0x00010 /* Extra diagnostics */ | |
| 1817 | +#define SYNC_RESYNC 0x00020 /* --verily */ | |
| 1818 | +#define SYNC_FROMPARENT 0x00040 /* Pull from the parent project */ | |
| 1819 | +#define SYNC_UNVERSIONED 0x00100 /* Sync unversioned content */ | |
| 1820 | +#define SYNC_UV_REVERT 0x00200 /* Copy server unversioned to client */ | |
| 1821 | +#define SYNC_UV_TRACE 0x00400 /* Describe UV activities */ | |
| 1822 | +#define SYNC_UV_DRYRUN 0x00800 /* Do not actually exchange files */ | |
| 1823 | +#define SYNC_IFABLE 0x01000 /* Inability to sync is not fatal */ | |
| 1824 | +#define SYNC_CKIN_LOCK 0x02000 /* Lock the current check-in */ | |
| 1825 | +#define SYNC_NOHTTPCOMPRESS 0x04000 /* Do not compression HTTP messages */ | |
| 1826 | +#define SYNC_ALLURL 0x08000 /* The --all flag - sync to all URLs */ | |
| 1827 | +#define SYNC_PUSH_SYNCLOG 0x10000 /* Uplink SYNCLOG info */ | |
| 1827 | 1828 | #endif |
| 1828 | 1829 | |
| 1829 | 1830 | /* |
| 1830 | 1831 | ** Floating-point absolute value |
| 1831 | 1832 | */ |
| @@ -2522,10 +2523,21 @@ | ||
| 2522 | 2523 | if( xfer.nToken>=5 ){ |
| 2523 | 2524 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 2524 | 2525 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 2525 | 2526 | } |
| 2526 | 2527 | } |
| 2528 | + | |
| 2529 | + /* pragma synclog FROM TO MTIME TYPE | |
| 2530 | + ** | |
| 2531 | + ** The server is downloading an entry from its SYNCLOG table. Merge | |
| 2532 | + ** this into the local SYNCLOG table if appropriate. | |
| 2533 | + ** is running. The DATE and TIME are a pure numeric ISO8601 time | |
| 2534 | + ** for the specific check-in of the client. | |
| 2535 | + */ | |
| 2536 | + if( xfer.nToken==5 && blob_eq(&xfer.aToken[1], "synclog") ){ | |
| 2537 | + /* TBD */ | |
| 2538 | + } | |
| 2527 | 2539 | |
| 2528 | 2540 | /* pragma uv-pull-only |
| 2529 | 2541 | ** pragma uv-push-ok |
| 2530 | 2542 | ** |
| 2531 | 2543 | ** If the server is unwill to accept new unversioned content (because |
| @@ -2693,11 +2705,11 @@ | ||
| 2693 | 2705 | db_timespan_name(-rSkew)); |
| 2694 | 2706 | g.clockSkewSeen = 1; |
| 2695 | 2707 | } |
| 2696 | 2708 | |
| 2697 | 2709 | if( nErr==0 ){ |
| 2698 | - sync_log_entry(syncFlags, g.url.canonical, zAltPCode!=0 ? "import" : 0); | |
| 2710 | + sync_log_entry(syncFlags, g.url.canonical, zAltPCode!=0 ? "import" : 0, 0); | |
| 2699 | 2711 | } |
| 2700 | 2712 | |
| 2701 | 2713 | fossil_force_newline(); |
| 2702 | 2714 | fossil_print( |
| 2703 | 2715 | "%s done, wire bytes sent: %lld received: %lld ip: %s\n", |
| 2704 | 2716 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1807,25 +1807,26 @@ | |
| 1807 | |
| 1808 | #if INTERFACE |
| 1809 | /* |
| 1810 | ** Flag options for controlling client_sync() |
| 1811 | */ |
| 1812 | #define SYNC_PUSH 0x0001 /* push content client to server */ |
| 1813 | #define SYNC_PULL 0x0002 /* pull content server to client */ |
| 1814 | #define SYNC_CLONE 0x0004 /* clone the repository */ |
| 1815 | #define SYNC_PRIVATE 0x0008 /* Also transfer private content */ |
| 1816 | #define SYNC_VERBOSE 0x0010 /* Extra diagnostics */ |
| 1817 | #define SYNC_RESYNC 0x0020 /* --verily */ |
| 1818 | #define SYNC_FROMPARENT 0x0040 /* Pull from the parent project */ |
| 1819 | #define SYNC_UNVERSIONED 0x0100 /* Sync unversioned content */ |
| 1820 | #define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */ |
| 1821 | #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ |
| 1822 | #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ |
| 1823 | #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ |
| 1824 | #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ |
| 1825 | #define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */ |
| 1826 | #define SYNC_ALLURL 0x8000 /* The --all flag - sync to all URLs */ |
| 1827 | #endif |
| 1828 | |
| 1829 | /* |
| 1830 | ** Floating-point absolute value |
| 1831 | */ |
| @@ -2522,10 +2523,21 @@ | |
| 2522 | if( xfer.nToken>=5 ){ |
| 2523 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 2524 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 2525 | } |
| 2526 | } |
| 2527 | |
| 2528 | /* pragma uv-pull-only |
| 2529 | ** pragma uv-push-ok |
| 2530 | ** |
| 2531 | ** If the server is unwill to accept new unversioned content (because |
| @@ -2693,11 +2705,11 @@ | |
| 2693 | db_timespan_name(-rSkew)); |
| 2694 | g.clockSkewSeen = 1; |
| 2695 | } |
| 2696 | |
| 2697 | if( nErr==0 ){ |
| 2698 | sync_log_entry(syncFlags, g.url.canonical, zAltPCode!=0 ? "import" : 0); |
| 2699 | } |
| 2700 | |
| 2701 | fossil_force_newline(); |
| 2702 | fossil_print( |
| 2703 | "%s done, wire bytes sent: %lld received: %lld ip: %s\n", |
| 2704 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1807,25 +1807,26 @@ | |
| 1807 | |
| 1808 | #if INTERFACE |
| 1809 | /* |
| 1810 | ** Flag options for controlling client_sync() |
| 1811 | */ |
| 1812 | #define SYNC_PUSH 0x00001 /* push content client to server */ |
| 1813 | #define SYNC_PULL 0x00002 /* pull content server to client */ |
| 1814 | #define SYNC_CLONE 0x00004 /* clone the repository */ |
| 1815 | #define SYNC_PRIVATE 0x00008 /* Also transfer private content */ |
| 1816 | #define SYNC_VERBOSE 0x00010 /* Extra diagnostics */ |
| 1817 | #define SYNC_RESYNC 0x00020 /* --verily */ |
| 1818 | #define SYNC_FROMPARENT 0x00040 /* Pull from the parent project */ |
| 1819 | #define SYNC_UNVERSIONED 0x00100 /* Sync unversioned content */ |
| 1820 | #define SYNC_UV_REVERT 0x00200 /* Copy server unversioned to client */ |
| 1821 | #define SYNC_UV_TRACE 0x00400 /* Describe UV activities */ |
| 1822 | #define SYNC_UV_DRYRUN 0x00800 /* Do not actually exchange files */ |
| 1823 | #define SYNC_IFABLE 0x01000 /* Inability to sync is not fatal */ |
| 1824 | #define SYNC_CKIN_LOCK 0x02000 /* Lock the current check-in */ |
| 1825 | #define SYNC_NOHTTPCOMPRESS 0x04000 /* Do not compression HTTP messages */ |
| 1826 | #define SYNC_ALLURL 0x08000 /* The --all flag - sync to all URLs */ |
| 1827 | #define SYNC_PUSH_SYNCLOG 0x10000 /* Uplink SYNCLOG info */ |
| 1828 | #endif |
| 1829 | |
| 1830 | /* |
| 1831 | ** Floating-point absolute value |
| 1832 | */ |
| @@ -2522,10 +2523,21 @@ | |
| 2523 | if( xfer.nToken>=5 ){ |
| 2524 | xfer.remoteDate = atoi(blob_str(&xfer.aToken[3])); |
| 2525 | xfer.remoteTime = atoi(blob_str(&xfer.aToken[4])); |
| 2526 | } |
| 2527 | } |
| 2528 | |
| 2529 | /* pragma synclog FROM TO MTIME TYPE |
| 2530 | ** |
| 2531 | ** The server is downloading an entry from its SYNCLOG table. Merge |
| 2532 | ** this into the local SYNCLOG table if appropriate. |
| 2533 | ** is running. The DATE and TIME are a pure numeric ISO8601 time |
| 2534 | ** for the specific check-in of the client. |
| 2535 | */ |
| 2536 | if( xfer.nToken==5 && blob_eq(&xfer.aToken[1], "synclog") ){ |
| 2537 | /* TBD */ |
| 2538 | } |
| 2539 | |
| 2540 | /* pragma uv-pull-only |
| 2541 | ** pragma uv-push-ok |
| 2542 | ** |
| 2543 | ** If the server is unwill to accept new unversioned content (because |
| @@ -2693,11 +2705,11 @@ | |
| 2705 | db_timespan_name(-rSkew)); |
| 2706 | g.clockSkewSeen = 1; |
| 2707 | } |
| 2708 | |
| 2709 | if( nErr==0 ){ |
| 2710 | sync_log_entry(syncFlags, g.url.canonical, zAltPCode!=0 ? "import" : 0, 0); |
| 2711 | } |
| 2712 | |
| 2713 | fossil_force_newline(); |
| 2714 | fossil_print( |
| 2715 | "%s done, wire bytes sent: %lld received: %lld ip: %s\n", |
| 2716 |