From f9872b43d84746d2dded6eef18b18a729481e673 Mon Sep 17 00:00:00 2001 From: joris Date: Sun, 28 May 2006 01:24:28 +0000 Subject: 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. --- usr.bin/cvs/commit.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'usr.bin/cvs/commit.c') 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 * @@ -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); -- cgit v1.2.3-59-g8ed1b