summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2008-06-09 22:31:24 +0000
committertobias <tobias@openbsd.org>2008-06-09 22:31:24 +0000
commit09d285070149d577da93c686593c5718d71cf760 (patch)
treea5eeaf62f9569bedfa06c460cec16dcbaea23cb0 /usr.bin/cvs/commit.c
parentRemove nmeaattch(8), which is superseeded by ldattach(8). (diff)
downloadwireguard-openbsd-09d285070149d577da93c686593c5718d71cf760.tar.xz
wireguard-openbsd-09d285070149d577da93c686593c5718d71cf760.zip
Properly handle merged files and conflicts which may arrise while merge.
Instead of ignoring all files which contain possible conflict markers, only watch out for files which have actually been merged. With input by and ok joris.
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r--usr.bin/cvs/commit.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index 9f4a9417c0f..15998dd62f3 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.135 2008/06/08 20:08:43 tobias Exp $ */
+/* $OpenBSD: commit.c,v 1.136 2008/06/09 22:31:24 tobias Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -244,7 +244,6 @@ cvs_commit_check_files(struct cvs_file *cf)
{
char *tag;
RCSNUM *branch, *brev;
- char rev[CVS_REV_BUFSZ];
struct cvs_dirlist *d;
branch = brev = NULL;
@@ -262,28 +261,33 @@ cvs_commit_check_files(struct cvs_file *cf)
return;
}
- if (cf->file_status == FILE_CONFLICT ||
+ if (cf->file_status == FILE_UPTODATE)
+ return;
+
+ if (cf->file_status == FILE_MERGE ||
+ cf->file_status == FILE_PATCH ||
+ cf->file_status == FILE_CHECKOUT ||
+ cf->file_status == FILE_LOST ||
cf->file_status == FILE_UNLINK) {
+ cvs_log(LP_ERR, "conflict: %s is not up-to-date",
+ cf->file_path);
conflicts_found++;
return;
}
- if (cf->file_status != FILE_REMOVED &&
- update_has_conflict_markers(cf)) {
+ if (cf->file_status == FILE_CONFLICT &&
+ cf->file_ent->ce_conflict != NULL) {
cvs_log(LP_ERR, "conflict: unresolved conflicts in %s from "
"merging, please fix these first", cf->file_path);
conflicts_found++;
return;
}
- if (cf->file_status == FILE_MERGE ||
- cf->file_status == FILE_PATCH ||
- cf->file_status == FILE_CHECKOUT ||
- cf->file_status == FILE_LOST) {
- cvs_log(LP_ERR, "conflict: %s is not up-to-date",
- cf->file_path);
- conflicts_found++;
- return;
+ if (cf->file_status == FILE_MODIFIED &&
+ cf->file_ent->ce_conflict != NULL &&
+ update_has_conflict_markers(cf)) {
+ cvs_log(LP_ERR, "warning: file %s seems to still contain "
+ "conflict indicators", cf->file_path);
}
if (cf->file_ent != NULL && cf->file_ent->ce_date != -1) {
@@ -313,28 +317,29 @@ cvs_commit_check_files(struct cvs_file *cf)
cf->file_ent->ce_tag);
}
- rcsnum_tostr(brev, rev, sizeof(rev));
if ((branch = rcsnum_revtobr(brev)) == NULL) {
- cvs_log(LP_ERR, "%s is not a branch revision",
- rev);
+ cvs_log(LP_ERR, "sticky tag %s is not "
+ "a branch for file %s", tag,
+ cf->file_path);
conflicts_found++;
rcsnum_free(brev);
return;
}
if (!RCSNUM_ISBRANCHREV(brev)) {
- cvs_log(LP_ERR, "%s is not a branch revision",
- rev);
+ cvs_log(LP_ERR, "sticky tag %s is not "
+ "a branch for file %s", tag,
+ cf->file_path);
conflicts_found++;
rcsnum_free(branch);
rcsnum_free(brev);
return;
}
- rcsnum_tostr(branch, rev, sizeof(rev));
if (!RCSNUM_ISBRANCH(branch)) {
- cvs_log(LP_ERR, "%s (%s) is not a branch",
- cf->file_ent->ce_tag, rev);
+ cvs_log(LP_ERR, "sticky tag %s is not "
+ "a branch for file %s", tag,
+ cf->file_path);
conflicts_found++;
rcsnum_free(branch);
rcsnum_free(brev);