[Haven't looked at this in any detail -kingdon] Return-Path: Date: Mon, 23 Mar 1998 17:22:45 +0100 From: Eivind Eklund To: bug-cvs Subject: Patches to generally support -rBRANCH:date Attached are patches to generally support the -rBRANCH:date format. . . . Eivind. Index: src/diff.c =================================================================== RCS file: /home/ncvs/src/contrib/cvs/src/diff.c,v retrieving revision 1.10 diff -u -r1.10 diff.c --- diff.c 1998/03/10 13:57:53 1.10 +++ diff.c 1998/03/11 22:40:08 @@ -369,9 +369,29 @@ #endif if (diff_rev1 != NULL) + { + char *cp; + + if ((cp = strchr (diff_rev1, ':')) != NULL) + { + *cp++ = '\0'; + diff_date1 = Make_Date (cp); + } + tag_check_valid (diff_rev1, argc, argv, local, 0, ""); + } if (diff_rev2 != NULL) + { + char *cp; + + if ((cp = strchr (diff_rev2, ':')) != NULL) + { + *cp++ = '\0'; + diff_date2 = Make_Date (cp); + } + tag_check_valid (diff_rev2, argc, argv, local, 0, ""); + } which = W_LOCAL; if (diff_rev1 != NULL || diff_date1 != NULL) Index: src/patch.c =================================================================== RCS file: /home/ncvs/src/contrib/cvs/src/patch.c,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 patch.c --- patch.c 1998/03/10 13:40:03 1.1.1.6 +++ patch.c 1998/03/12 23:23:58 @@ -116,9 +116,27 @@ error (1, 0, "no more than two revisions/dates can be specified"); if (rev1 != NULL || date1 != NULL) + { + char *cp; + rev2 = optarg; + if (cp = strchr(optarg, ':')) + { + *cp++ = '\0'; + date2 = Make_Date (cp); + } + } else + { + char *cp; + rev1 = optarg; + if (cp = strchr(optarg, ':')) + { + *cp++ = '\0'; + date1 = Make_Date (cp); + } + } break; case 'k': if (options) Index: src/rcs.c =================================================================== RCS file: /home/ncvs/src/contrib/cvs/src/rcs.c,v retrieving revision 1.15 diff -u -r1.15 rcs.c --- rcs.c 1998/03/10 13:57:57 1.15 +++ rcs.c 1998/03/12 23:31:27 @@ -7763,10 +7763,28 @@ local = 0; break; case 'r': - tag = optarg; + if (tag) + error (1, 0, "Multiple -r options specified"); + if (date) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); + tag = optarg; + { + char *cp; + + if (cp = strchr(tag, ':')) { + *cp++ = '\0'; + date = Make_Date (cp); + } + } break; case 'D': - date = Make_Date (optarg); + if (tag) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); + if (date) + error (1, 0, "Multiple -D options specified"); + date = Make_Date (optarg); break; case 'f': force_tag_match = 0; Index: src/rtag.c =================================================================== RCS file: /home/ncvs/src/contrib/cvs/src/rtag.c,v retrieving revision 1.1.1.5 diff -u -r1.1.1.5 rtag.c --- rtag.c 1998/01/30 15:31:14 1.1.1.5 +++ rtag.c 1998/03/12 23:38:17 @@ -131,11 +131,27 @@ branch_mode = 1; break; case 'r': + if (numtag) + error (1, 0, "Multiple -r options specified"); + if (date) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); numtag = optarg; + { + char *cp; + + if (cp = strchr(optarg, ':')) { + *cp++ = '\0'; + date = Make_Date (cp); + } + } break; case 'D': + if (numtag) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); if (date) - free (date); + error (1, 0, "Multiple -D options specified"); date = Make_Date (optarg); break; case 'F': @@ -155,8 +171,6 @@ argc--; argv++; - if (date && numtag) - error (1, 0, "-r and -D options are mutually exclusive"); if (delete_flag && branch_mode) error (0, 0, "warning: -b ignored with -d options"); RCS_check_tag (symtag); Index: src/tag.c =================================================================== RCS file: /home/ncvs/src/contrib/cvs/src/tag.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 tag.c --- tag.c 1998/01/26 03:09:35 1.1.1.4 +++ tag.c 1998/03/12 23:39:58 @@ -112,14 +112,30 @@ case 'c': check_uptodate = 1; break; - case 'r': - numtag = optarg; - break; - case 'D': - if (date) - free (date); - date = Make_Date (optarg); - break; + case 'r': + if (numtag) + error (1, 0, "Multiple -r options specified"); + if (date) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); + numtag = optarg; + { + char *cp; + + if (cp = strchr(optarg, ':')) { + *cp++ = '\0'; + date = Make_Date (cp); + } + } + break; + case 'D': + if (numtag) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); + if (date) + error (1, 0, "Multiple -D options specified"); + date = Make_Date (optarg); + break; case 'f': force_tag_match = 0; break; @@ -144,8 +160,6 @@ argc--; argv++; - if (date && numtag) - error (1, 0, "-r and -D options are mutually exclusive"); if (delete_flag && branch_mode) error (0, 0, "warning: -b ignored with -d options"); RCS_check_tag (symtag); Index: src/update.c =================================================================== RCS file: /home/ncvs/src/contrib/cvs/src/update.c,v retrieving revision 1.4 diff -u -r1.4 update.c --- update.c 1998/03/10 13:58:02 1.4 +++ update.c 1998/03/12 23:17:07 @@ -187,9 +187,27 @@ force_tag_match = 0; break; case 'r': + if (tag) + error (1, 0, "Multiple -r options specified"); + if (date) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); tag = optarg; + { + char *cp; + + if (cp = strchr(tag, ':')) { + *cp++ = '\0'; + date = Make_Date (cp); + } + } break; case 'D': + if (tag) + error (1, 0, + "both -r and -D specified (use -rBRANCH:)"); + if (date) + error (1, 0, "Multiple -D options specified"); date = Make_Date (optarg); break; case 'P':