Module Name: src Committed By: christos Date: Mon Dec 19 04:37:13 UTC 2016
Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: add -t to preserve timestamps. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/update.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/gpl2/xcvs/dist/src/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.6 src/external/gpl2/xcvs/dist/src/update.c:1.7 --- src/external/gpl2/xcvs/dist/src/update.c:1.6 Sun Dec 18 22:15:31 2016 +++ src/external/gpl2/xcvs/dist/src/update.c Sun Dec 18 23:37:13 2016 @@ -38,7 +38,7 @@ * as well. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: update.c,v 1.6 2016/12/19 03:15:31 christos Exp $"); +__RCSID("$NetBSD: update.c,v 1.7 2016/12/19 04:37:13 christos Exp $"); #include "cvs.h" #include <assert.h> @@ -106,6 +106,7 @@ static int toss_local_changes = 0; static int force_tag_match = 1; static int update_build_dirs = 0; static int update_prune_dirs = 0; +static int preserve_timestamps_on_update = 0; static int pipeout = 0; static int dotemplate = 0; #ifdef SERVER_SUPPORT @@ -131,6 +132,7 @@ static const char *const update_usage[] "\t-D date\tSet date to update from (is sticky).\n", "\t-j rev\tMerge in changes made between current revision and rev.\n", "\t-I ign\tMore files to ignore (! to reset).\n", + "\t-t Preserve timestamps on update.\n", "\t-W spec\tWrappers specification line.\n", "(Specify the --help global option for a list of other help options)\n", NULL @@ -162,7 +164,7 @@ update (int argc, char **argv) /* parse the args */ getoptreset (); - while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:D:j:I:W:")) != -1) + while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:tD:j:I:W:")) != -1) { switch (c) { @@ -218,6 +220,9 @@ update (int argc, char **argv) pipeout = 1; noexec = 1; /* so no locks will be created */ break; + case 't': + preserve_timestamps_on_update = 1; + break; case 'j': if (join_orig2) error (1, 0, "only two -j options can be specified"); @@ -281,6 +286,8 @@ update (int argc, char **argv) send_arg("-C"); if (update_prune_dirs) send_arg("-P"); + if (preserve_timestamps_on_update) + send_arg("-t"); client_prune_dirs = update_prune_dirs; option_with_arg ("-r", tag); if (options && options[0] != '\0') @@ -1366,18 +1373,20 @@ VERS: ", 0); /* set the time from the RCS file iff it was unknown before */ set_time = (!noexec -#if 0 /* * always pass the time to the client, and let it decide * if it is going to set the time */ - && (vers_ts->vn_user == NULL || + && (preserve_timestamps_on_update || + vers_ts->vn_user == NULL || strncmp (vers_ts->ts_rcs, "Initial", 7) == 0) -#endif && !file_is_dead); + wrap_fromcvs_process_file (finfo->file); + xvers_ts = Version_TS (finfo, options, tag, date, force_tag_match, set_time); + if (strcmp (xvers_ts->options, "-V4") == 0) xvers_ts->options[0] = '\0';