From 9c6c158ef3396a1f2be2b6729c7a920b44f9a055 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 29 Jan 2006 15:46:09 +0000 Subject: [PATCH] undocumented flag -J to skip committing the new sync state. --- src/isync.h | 1 + src/main.c | 3 +++ src/sync.c | 8 +++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/isync.h b/src/isync.h index 76b4223..a5f4a52 100644 --- a/src/isync.h +++ b/src/isync.h @@ -196,6 +196,7 @@ extern const char *Home; #define VERBOSE 2 #define QUIET 4 #define VERYQUIET 8 +#define KEEPJOURNAL 16 extern int DFlags; diff --git a/src/main.c b/src/main.c index 3bba45a..4841b8b 100644 --- a/src/main.c +++ b/src/main.c @@ -372,6 +372,9 @@ main( int argc, char **argv ) case 'D': DFlags |= DEBUG | QUIET; break; + case 'J': + DFlags |= KEEPJOURNAL; + break; case 'v': version(); case 'h': diff --git a/src/sync.c b/src/sync.c index fb81ecb..2e55188 100644 --- a/src/sync.c +++ b/src/sync.c @@ -914,9 +914,11 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan ) fclose( nfp ); fclose( jfp ); - /* order is important! */ - rename( nname, dname ); - unlink( jname ); + if (!(DFlags & KEEPJOURNAL)) { + /* order is important! */ + rename( nname, dname ); + unlink( jname ); + } bail: for (srec = recs; srec; srec = nsrec) {