diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-12-02 13:43:33 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-12-02 13:43:33 +0000 |
commit | e8bf50d69c26a986004842ac85136f9553ec8dc6 (patch) | |
tree | 474824ba58f39d90b1beec31134e3da89cc93dd5 /usr.bin/rcs | |
parent | 7878a905f44b6ac10633e1b2d0a4bb5361083315 (diff) |
in checkin_update():
- move up the lock check
- better error message if a specified rev is too low
OK niallo@.
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r-- | usr.bin/rcs/ci.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index a1dc7922b2d..768307676f5 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.76 2005/12/02 01:13:12 niallo Exp $ */ +/* $OpenBSD: ci.c,v 1.77 2005/12/02 13:43:32 xsa Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -435,7 +435,7 @@ checkin_getinput(const char *prompt) static int checkin_update(struct checkin_params *pb) { - char *filec; + char *filec, numb1[64], numb2[64]; BUF *bp; pb->frev = pb->file->rf_head; @@ -443,11 +443,21 @@ checkin_update(struct checkin_params *pb) /* If revision passed on command line is less than HEAD, bail. */ if ((pb->newrev != NULL) && (rcsnum_cmp(pb->newrev, pb->frev, 0) > 0)) { - cvs_log(LP_ERR, "revision is too low!"); + cvs_log(LP_ERR, + "%s: revision %s too low; must be higher than %s", + pb->file->rf_path, + rcsnum_tostr(pb->newrev, numb1, sizeof(numb1)), + rcsnum_tostr(pb->frev, numb2, sizeof(numb2))); rcs_close(pb->file); return (-1); } + if (checkin_checklock(pb) < 0) { + cvs_log(LP_ERR, "%s: no lock set by %s", + pb->file->rf_path, pb->username); + return (-1); + } + /* Load file contents */ if ((bp = cvs_buf_load(pb->filename, BUF_AUTOEXT)) == NULL) { cvs_log(LP_ERR, "failed to load '%s'", pb->filename); @@ -474,10 +484,6 @@ checkin_update(struct checkin_params *pb) return (0); } - /* Check for a lock belonging to this user. If none, abort check-in. */ - if (checkin_checklock(pb) < 0) - return (-1); - /* If no log message specified, get it interactively. */ if (pb->flags & INTERACTIVE) pb->rcs_msg = checkin_getlogmsg(pb->frev, pb->newrev); |