summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/usr.bin/rcs/Makefile6
-rw-r--r--usr.bin/cvs/rcs.c4
-rw-r--r--usr.bin/rcs/rcsprog.c23
3 files changed, 20 insertions, 13 deletions
diff --git a/regress/usr.bin/rcs/Makefile b/regress/usr.bin/rcs/Makefile
index a14590917f2..1892729b412 100644
--- a/regress/usr.bin/rcs/Makefile
+++ b/regress/usr.bin/rcs/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.15 2006/04/01 06:19:29 ray Exp $
+# $OpenBSD: Makefile,v 1.16 2006/04/12 22:54:23 ray Exp $
# Regression tests by Niall O'Higgins <niallo@openbsd.org>.
# ksh -> Makefile by Ray Lai <ray@cyth.net>.
@@ -314,9 +314,9 @@ test-rcs-lock-unlock: clean
@${RLOG} file | fgrep -x -A 1 'locks: strict' | head -n 2 | fgrep -q 1.2 || \
case "$$?" in 1) exit 0;; esac && exit 1
- @${RCS} -q -u file || case "$$?" in 1) exit 0;; esac && exit 1
+ @${RCS} -q -u file
+ @${RCS} -q -l file
@${RCS} -q -l file
- @${RCS} -q -l file || case "$$?" in 1) exit 0;; esac && exit 1
@${RCS} -q -l1.3 file || case "$$?" in 1) exit 0;; esac && exit 1
@${RCS} -q -u1.3 file || case "$$?" in 1) exit 0;; esac && exit 1
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 14dedc413c7..f9a8f402459 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.163 2006/04/10 12:15:21 xsa Exp $ */
+/* $OpenBSD: rcs.c,v 1.164 2006/04/12 22:54:23 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -938,8 +938,6 @@ rcs_lock_add(RCSFILE *file, const char *user, RCSNUM *rev)
/* not synced anymore */
file->rf_flags &= ~RCS_SYNCED;
return (0);
-
-
}
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index 33045e38742..42cb17d6614 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.97 2006/04/12 08:23:30 ray Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.98 2006/04/12 22:54:23 ray Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -682,6 +682,7 @@ rcs_main(int argc, char **argv)
if (rcsflags & RCSPROG_LFLAG) {
RCSNUM *rev;
const char *username;
+ char rev_str[16];
if ((username = getlogin()) == NULL)
fatal("could not get username");
@@ -693,17 +694,21 @@ rcs_main(int argc, char **argv)
rcs_close(file);
continue;
}
+ rcsnum_tostr(rev, rev_str, sizeof(rev_str));
/* Make sure revision exists. */
if (rcs_findrev(file, rev) == NULL)
- fatal("revision does not exist");
- if (rcs_lock_add(file, username, rev) == -1)
- fatal("unable to lock file");
+ fatal("%s: can't lock nonexisting revision %s",
+ fpath, rev_str);
+ if (rcs_lock_add(file, username, rev) != -1 &&
+ verbose == 1)
+ printf("%s locked\n", rev_str);
rcsnum_free(rev);
}
if (rcsflags & RCSPROG_UFLAG) {
RCSNUM *rev;
const char *username;
+ char rev_str[16];
if ((username = getlogin()) == NULL)
fatal("could not get username");
@@ -715,11 +720,15 @@ rcs_main(int argc, char **argv)
rcs_close(file);
continue;
}
+ rcsnum_tostr(rev, rev_str, sizeof(rev_str));
/* Make sure revision exists. */
if (rcs_findrev(file, rev) == NULL)
- fatal("revision does not exist");
- if (rcs_lock_remove(file, username, rev) == -1)
- fatal("unable to unlock file");
+ fatal("%s: can't unlock nonexisting revision %s",
+ fpath, rev_str);
+ if (rcs_lock_remove(file, username, rev) == -1 &&
+ verbose == 1)
+ cvs_log(LP_ERR,
+ "%s: warning: No locks are set.", fpath);
rcsnum_free(rev);
}