-C Add\sa\sprotocol\sversion\snumber\sto\sthe\sfirst\smessage,\sand\sgive\sthe\stwo\ssides\nan\sopportunity\sto\snegotiate\sa\ssuitable\sprotocol\snumber,\sfor\sfuture\ncompatibility.\s\sSend\sthe\spage\ssize\sas\sa\spower-of-two.
-D 2024-09-12T15:36:34.506
+C Pass\sthe\snames\sof\sboth\sthe\sorigin\sand\sthe\sreplica\sdatabases\sto\sthe\sremote\nside,\sso\sthat\sif\sthe\sremote\sis\sthe\sreplica,\sit\swill\shave\saccess\sto\sthe\norigin\sdatabase\sname\sin\scase\sthe\sreplica\sname\sis\sreally\sa\sdirectory.
+D 2024-09-12T15:51:56.339
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x
F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60
F tool/sqldiff.c 847fc8fcfddf5ce4797b7394cad6372f2f5dc17d8186e2ef8fb44d50fae4f44a
-F tool/sqlite3-rsync.c f3283380beddab3cf876be781fbd2d00308249f08d6e4438411e64f27e7b67bd
+F tool/sqlite3-rsync.c 7b7d24177b27f42dfcd7e962be4a526e775b073f2044cd1f7d3414581810baea
F tool/sqlite3_analyzer.c.in 8da2b08f56eeac331a715036cf707cc20f879f231362be0c22efd682e2b89b4f
F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P fe65821a3b912f061026e6fd7174be26897010e6b474e2780350cac60faebaad
-R 70c38e114e917b5cf93c46e6c1a47f24
+P df0623aae1154281157409f62d6d3fb3ce41829281d53bc55868ce44b3d36883
+R 137e53956a972f25c62e4e4b74ab6074
U drh
-Z 9a7103765746c5b1023f192fb95a127f
+Z 061042360cfb45012e27693425840440
# Remove this line to create a well-formed Fossil manifest.
}
}
+/*
+** Return the tail of a file pathname. The tail is the last component
+** of the path. For example, the tail of "/a/b/c.d" is "c.d".
+*/
+const char *file_tail(const char *z){
+ const char *zTail = z;
+ if( !zTail ) return 0;
+ while( z[0] ){
+ if( z[0]=='/' ) zTail = &z[1];
+ z++;
+ }
+ return zTail;
+}
+
+
/* Read a single big-endian 32-bit unsigned integer from the input
** stream. Return 0 on success and 1 if there are any errors.
*/
"replica is %d bytes", szOPage, szRPage);
break;
}
-
pStmt = prepareStmt(p,
"SELECT sha1b(data) FROM sqlite_dbpage"
fprintf(stderr, "missing ORIGIN database filename\n");
return 1;
}
- if( isOrigin && isReplica ){
- fprintf(stderr, "bad option combination\n");
+ if( ctx.zReplica==0 ){
+ fprintf(stderr, "missing REPLICA database filename\n");
return 1;
}
- if( (isOrigin || isReplica) && ctx.zReplica!=0 ){
- fprintf(stderr, "Unknown argument: \"%s\"\n", ctx.zReplica);
+ if( isOrigin && isReplica ){
+ fprintf(stderr, "bad option combination\n");
return 1;
}
if( isOrigin ){
return 0;
}
if( isReplica ){
- ctx.zReplica = ctx.zOrigin;
- ctx.zOrigin = 0;
ctx.pIn = stdin;
ctx.pOut = stdout;
ctx.isRemote = 1;
if( ctx.eVerbose==0 ) ctx.eVerbose = 1;
}
append_escaped_arg(pStr, zDiv, 1);
+ append_escaped_arg(pStr, file_tail(ctx.zReplica), 1);
zCmd = sqlite3_str_finish(pStr);
if( ctx.eVerbose ) printf("%s\n", zCmd);
if( popen2(zCmd, &ctx.pIn, &ctx.pOut, &childPid, 0) ){
append_escaped_arg(pStr, "--commcheck", 0);
if( ctx.eVerbose==0 ) ctx.eVerbose = 1;
}
+ append_escaped_arg(pStr, file_tail(ctx.zOrigin), 1);
append_escaped_arg(pStr, zDiv, 1);
zCmd = sqlite3_str_finish(pStr);
if( ctx.eVerbose ) printf("%s\n", zCmd);
if( ctx.bCommCheck ){
append_escaped_arg(pStr, "--commcheck", 0);
}
+ append_escaped_arg(pStr, ctx.zOrigin, 1);
append_escaped_arg(pStr, ctx.zReplica, 1);
zCmd = sqlite3_str_finish(pStr);
if( ctx.eVerbose ) printf("%s\n", zCmd);