diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2006-05-28 01:24:29 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2006-05-28 01:24:29 +0000 |
commit | 342f3ae6ce1c83fe66ffe451203aa5422a5c55dd (patch) | |
tree | 6613db867184039df62d338830b35622c738a3dd /usr.bin/cvs/commit.c | |
parent | f3cd77e41486334a04b835661b504ca4b4cf799c (diff) |
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.c | 14 |
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); |