diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2007-01-28 23:37:30 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2007-01-28 23:37:30 +0000 |
commit | d942cd56b9671be510b47ea86189eb3a3e397e8d (patch) | |
tree | e5820904fd9c68e1a80c966e6d4537b4192dfa5c | |
parent | e861c682d7745e99b99c6feb7af9227820cd2c59 (diff) |
do not overwrite a file that is modified but has a sticky tag set
when running update -A, instead merge in the changes.
'kay xsa@
-rw-r--r-- | usr.bin/cvs/update.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index ba5f0c2d4c2..28510c5b7a2 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.90 2007/01/28 02:04:45 joris Exp $ */ +/* $OpenBSD: update.c,v 1.91 2007/01/28 23:37:29 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -290,9 +290,13 @@ cvs_update_local(struct cvs_file *cf) flags = 0; cvs_file_classify(cf, tag, 1); - if (cf->file_status == FILE_UPTODATE && cf->file_ent != NULL && + if ((cf->file_status == FILE_UPTODATE || + cf->file_status == FILE_MODIFIED) && cf->file_ent != NULL && cf->file_ent->ce_tag != NULL && reset_stickies == 1) { - cf->file_status = FILE_CHECKOUT; + if (cf->file_status == FILE_MODIFIED) + cf->file_status = FILE_MERGE; + else + cf->file_status = FILE_CHECKOUT; cf->file_rcsrev = rcs_head_get(cf->file_rcs); } |