summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/commit.c
diff options
context:
space:
mode:
authorjoris <joris@openbsd.org>2006-05-28 01:24:28 +0000
committerjoris <joris@openbsd.org>2006-05-28 01:24:28 +0000
commitf9872b43d84746d2dded6eef18b18a729481e673 (patch)
tree84abba529857235866dbf133f7d7cb9879683f42 /usr.bin/cvs/commit.c
parentcheck if the interface is active and UP. some, but not all, network (diff)
downloadwireguard-openbsd-f9872b43d84746d2dded6eef18b18a729481e673.tar.xz
wireguard-openbsd-f9872b43d84746d2dded6eef18b18a729481e673.zip
enable merging on update. if your file in your working copy
has been modified by yourself and there is a newer revision we try and merge them together. if the merge fails and has conflicts it will mark them inside the file, you will need to resolve these by hand first before you will be able to commit your modified file. works transparent with gnu cvs, as it is suppose to.
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r--usr.bin/cvs/commit.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index 1e6c0eac2dd..9e8cce9ca47 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.59 2006/05/27 15:17:42 joris Exp $ */
+/* $OpenBSD: commit.c,v 1.60 2006/05/28 01:24:28 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
*
@@ -126,6 +126,12 @@ cvs_commit_check_conflicts(struct cvs_file *cf)
cf->file_status == FILE_UNLINK)
conflicts_found++;
+ if (update_has_conflict_markers(cf)) {
+ cvs_log(LP_ERR, "conflict: unresolved conflicts in %s from "
+ "merging, please fix these first", cf->file_path);
+ conflicts_found++;
+ }
+
if (cf->file_status == FILE_MERGE ||
cf->file_status == FILE_PATCH) {
cvs_log(LP_ERR, "conflict: %s is not up-to-date",
@@ -204,7 +210,11 @@ cvs_commit_local(struct cvs_file *cf)
cf->fd = -1;
if (cf->file_status != FILE_REMOVED) {
- cvs_checkout_file(cf, cf->file_rcs->rf_head, 0);
+ b = rcs_getrev(cf->file_rcs, cf->file_rcs->rf_head);
+ if (b == NULL)
+ fatal("cvs_commit_local: failed to get HEAD");
+
+ cvs_checkout_file(cf, cf->file_rcs->rf_head, b, 0);
} else {
entlist = cvs_ent_open(cf->file_wd);
cvs_ent_remove(entlist, cf->file_name);