diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-02-16 17:30:47 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-02-16 17:30:47 +0000 |
commit | ff18dafa045c6fa286018a40158122c68f840dbe (patch) | |
tree | 70c85bda4403be578ee8699bf46a4ae615883c75 /usr.bin/rcs/ci.c | |
parent | b43a9e2b649cbf7803f51d8abe17ab3c6b8e1618 (diff) |
- ensure we handle -d properly in initial revision, not just updates.
Diffstat (limited to 'usr.bin/rcs/ci.c')
-rw-r--r-- | usr.bin/rcs/ci.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index 4db9f0d60e4..5cf76cf6041 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.96 2006/02/16 16:43:45 niallo Exp $ */ +/* $OpenBSD: ci.c,v 1.97 2006/02/16 17:30:46 niallo Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -582,10 +582,18 @@ checkin_init(struct checkin_params *pb) } rcs_desc_set(pb->file, rcs_desc); + /* + * Set the date of the revision to be the last modification + * time of the working file if -d has no argument. + */ + if (pb->date == DATE_MTIME + && (checkin_mtimedate(pb) < 0)) + return (-1); + /* Now add our new revision */ if (rcs_rev_add(pb->file, (pb->newrev == NULL ? RCS_HEAD_REV : pb->newrev), - LOG_INIT, -1, pb->author) != 0) { + LOG_INIT, pb->date, pb->author) != 0) { cvs_log(LP_ERR, "failed to add new revision"); return (-1); } |