From 34bda5731d027891ae1965493293e866ad9abeef Mon Sep 17 00:00:00 2001 From: Julian Elischer Date: Mon, 12 Jan 1998 06:51:07 +0000 Subject: [PATCH] Allow a -D'date' option to be included with a -r'branch' on a checkout. this allows us to do: cd /usr/src/sys cvs update -rRELENGE_2_2 -D"Yesterday" which has been a feature sorely needed for any project with active branches. warning: this breaks on usr.sbin/pkg_install for some reason. everything else works as advertised. (other things allready break on pkg_install, so it's not the fault of this patch, it just falls faul of another bug somewhere) If I had more time I'd make -r always accept the same syntax as -j (tag:data) --- contrib/cvs/src/rcs.c | 6 +++--- contrib/cvs/src/update.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c index e87a3aecc245..dfdc71d65f66 100644 --- a/contrib/cvs/src/rcs.c +++ b/contrib/cvs/src/rcs.c @@ -1857,9 +1857,9 @@ RCS_getdatebranch (rcs, date, branch) free (xbranch); if (p == vers->branches->list) { - /* FIXME: This case would seem to imply that the RCS file is - somehow invalid. Should we give an error message? */ - return (NULL); + /* This happens when you have a couple of branches off a revision, + and your branch has not diverged, but another has. */ + return (xstrdup (cur_rev)); } p = findnode (rcs->versions, p->key); diff --git a/contrib/cvs/src/update.c b/contrib/cvs/src/update.c index 8196c1fd98dc..def6a343a67a 100644 --- a/contrib/cvs/src/update.c +++ b/contrib/cvs/src/update.c @@ -491,7 +491,7 @@ update_fileproc (callerdat, finfo) && tag != NULL && finfo->rcs != NULL) { - char *rev = RCS_getversion (finfo->rcs, tag, NULL, 1, NULL); + char *rev = RCS_getversion (finfo->rcs, tag, date, 1, NULL); if (rev != NULL && !RCS_nodeisbranch (finfo->rcs, tag)) nonbranch = 1;