From 59eae9b8a025d914568d4cf2e0329547792823dd Mon Sep 17 00:00:00 2001 From: joris Date: Sun, 28 May 2017 17:01:10 +0000 Subject: Don't allow opencvs to commit towards tags that are not branches. Gets rid of the old logic that wasn't working and replaced it with a simplified version. ok stsp@ --- usr.bin/cvs/commit.c | 50 +++++++------------------------------------------- 1 file changed, 7 insertions(+), 43 deletions(-) (limited to 'usr.bin/cvs/commit.c') diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index fa4102a8c37..8d9cbf6ae02 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.155 2016/10/13 20:51:25 fcambus Exp $ */ +/* $OpenBSD: commit.c,v 1.156 2017/05/28 17:01:10 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2006 Xavier Santolaria @@ -363,52 +363,16 @@ cvs_commit_check_files(struct cvs_file *cf) if (tag != NULL && cf->file_rcs != NULL) { brev = rcs_sym_getrev(cf->file_rcs, tag); if (brev != NULL) { - if (RCSNUM_ISBRANCH(brev)) - goto next; - free(brev); - } - - brev = rcs_translate_tag(tag, cf->file_rcs); - - if (brev == NULL) { - if (cf->file_status == FILE_ADDED) - goto next; - fatal("failed to resolve tag: %s", - cf->file_ent->ce_tag); - } - - if ((branch = rcsnum_revtobr(brev)) == NULL) { - cvs_log(LP_ERR, "sticky tag %s is not " - "a branch for file %s", tag, - cf->file_path); - conflicts_found++; - free(brev); - return; - } - - if (!RCSNUM_ISBRANCHREV(brev)) { - cvs_log(LP_ERR, "sticky tag %s is not " - "a branch for file %s", tag, - cf->file_path); - conflicts_found++; - free(branch); - free(brev); - return; - } - - if (!RCSNUM_ISBRANCH(branch)) { - cvs_log(LP_ERR, "sticky tag %s is not " - "a branch for file %s", tag, - cf->file_path); - conflicts_found++; - free(branch); - free(brev); - return; + if (!RCSNUM_ISBRANCH(brev)) { + cvs_log(LP_ERR, "sticky tag %s is not " + "a branch for file %s", tag, + cf->file_path); + conflicts_found++; + } } } } -next: free(branch); free(brev); -- cgit v1.2.3-59-g8ed1b