From c6380172806c5d70d0239d5077f560855e00c199 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 15 May 2025 17:33:32 +0000 Subject: [PATCH] Enhance the "changeset" utility program with new command-line options for the "changeset apply" command. FossilOrigin-Name: 428daca4f1b3e1a33b7e2f5acf114fa6136d46555e9947e2e88ea107bfec5e4f --- ext/session/changeset.c | 66 ++++++++++++++++++++++++++++++++++------- manifest | 12 ++++---- manifest.uuid | 2 +- 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/ext/session/changeset.c b/ext/session/changeset.c index 9cf62949a1..7d1ae28297 100644 --- a/ext/session/changeset.c +++ b/ext/session/changeset.c @@ -28,11 +28,16 @@ static void usage(const char *argv0){ fprintf(stderr, "Usage: %s FILENAME COMMAND ...\n", argv0); fprintf(stderr, "COMMANDs:\n" - " apply DB Apply the changeset to database file DB\n" - " concat FILE2 OUT Concatenate FILENAME and FILE2 into OUT\n" - " dump Show the complete content of the changeset\n" - " invert OUT Write an inverted changeset into file OUT\n" - " sql Give a pseudo-SQL rendering of the changeset\n" + " apply DB [OPTIONS] Apply the changeset to database file DB. OPTIONS:\n" + " -n|--dryrun Test run. Don't apply changes\n" + " --nosavepoint\n" + " --invert\n" + " --ignorenoop\n" + " --fknoaction\n" + " concat FILE2 OUT Concatenate FILENAME and FILE2 into OUT\n" + " dump Show the complete content of the changeset\n" + " invert OUT Write an inverted changeset into file OUT\n" + " sql Give a pseudo-SQL rendering of the changeset\n" ); exit(1); } @@ -188,21 +193,62 @@ int main(int argc, char **argv){ */ if( strcmp(argv[2],"apply")==0 ){ sqlite3 *db; - if( argc!=4 ) usage(argv[0]); - rc = sqlite3_open(argv[3], &db); + int bDryRun = 0; + const char *zDb = 0; + int i; + int applyFlags = 0; + for(i=3; i