summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/rcs/ci.c3
-rw-r--r--usr.bin/rcs/co.c18
-rw-r--r--usr.bin/rcs/rcsprog.h25
3 files changed, 27 insertions, 19 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index 99228bdaba2..04ed168af9a 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.136 2006/04/06 10:13:00 xsa Exp $ */
+/* $OpenBSD: ci.c,v 1.137 2006/04/09 19:22:23 niallo Exp $ */
/*
* Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -819,6 +819,7 @@ checkin_revert(struct checkin_params *pb)
cvs_log(LP_WARN,
"file is unchanged; reverting to previous revision %s",
rbuf);
+ pb->flags |= CO_REVERT;
(void)unlink(pb->filename);
if ((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK))
checkout_rev(pb->file, pb->frev, pb->filename,
diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c
index 2eb524bcca0..9ddc0bcd8c0 100644
--- a/usr.bin/rcs/co.c
+++ b/usr.bin/rcs/co.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: co.c,v 1.70 2006/04/06 10:13:00 xsa Exp $ */
+/* $OpenBSD: co.c,v 1.71 2006/04/09 19:22:23 niallo Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -313,8 +313,11 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags,
}
}
- if ((verbose == 1) && !(flags & NEWFILE))
+ if ((verbose == 1) && !(flags & NEWFILE) && !(flags & CO_REVERT))
printf("revision %s", buf);
+
+ if ((verbose == 1) && (flags & CO_REVERT))
+ printf("done");
if ((bp = rcs_getrev(file, rev)) == NULL) {
@@ -346,7 +349,8 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags,
mode = st.st_mode &
(S_IXUSR|S_IXGRP|S_IXOTH|S_IRUSR|S_IRGRP|S_IROTH);
mode |= S_IWUSR;
- if ((verbose == 1) && !(flags & NEWFILE))
+ if ((verbose == 1) && !(flags & NEWFILE)
+ && !(flags & CO_REVERT))
printf(" (locked)");
} else if (flags & CO_UNLOCK) {
if (rcs_lock_remove(file, lockname, rev) < 0) {
@@ -357,7 +361,8 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags,
/* Strip all write bits from mode */
mode = st.st_mode &
(S_IXUSR|S_IXGRP|S_IXOTH|S_IRUSR|S_IRGRP|S_IROTH);
- if ((verbose == 1) && !(flags & NEWFILE))
+ if ((verbose == 1) && !(flags & NEWFILE)
+ && !(flags & CO_REVERT))
printf(" (unlocked)");
}
@@ -365,8 +370,9 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags,
printf("\n");
if (flags & CO_LOCK) {
- lcount++;
- if ((verbose == 1) && (lcount > 1))
+ if (rcs_errno != RCS_ERR_DUPENT)
+ lcount++;
+ if ((verbose == 1) && (lcount > 1) && !(flags & CO_REVERT))
cvs_log(LP_WARN, "%s: warning: You now have %d locks.",
file->rf_path, lcount);
}
diff --git a/usr.bin/rcs/rcsprog.h b/usr.bin/rcs/rcsprog.h
index cdace9ce75c..2e99a90f8e0 100644
--- a/usr.bin/rcs/rcsprog.h
+++ b/usr.bin/rcs/rcsprog.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.h,v 1.42 2006/04/07 12:54:40 xsa Exp $ */
+/* $OpenBSD: rcsprog.h,v 1.43 2006/04/09 19:22:23 niallo Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -47,21 +47,22 @@
#define CO_AUTHOR (1<<5)
#define CO_LOCK (1<<6)
#define CO_REVDATE (1<<7)
-#define CO_STATE (1<<8)
-#define CO_UNLOCK (1<<9)
+#define CO_REVERT (1<<8)
+#define CO_STATE (1<<9)
+#define CO_UNLOCK (1<<10)
/* flags specific to rcsprog.c */
-#define RCSPROG_EFLAG (1<<10)
-#define RCSPROG_LFLAG (1<<11)
-#define RCSPROG_NFLAG (1<<12)
-#define RCSPROG_TFLAG (1<<13)
-#define RCSPROG_UFLAG (1<<14)
+#define RCSPROG_EFLAG (1<<11)
+#define RCSPROG_LFLAG (1<<12)
+#define RCSPROG_NFLAG (1<<13)
+#define RCSPROG_TFLAG (1<<14)
+#define RCSPROG_UFLAG (1<<15)
/* shared flags */
-#define FORCE (1<<15)
-#define INTERACTIVE (1<<16)
-#define NEWFILE (1<<17)
-#define PRESERVETIME (1<<18)
+#define FORCE (1<<16)
+#define INTERACTIVE (1<<17)
+#define NEWFILE (1<<18)
+#define PRESERVETIME (1<<19)
extern char *__progname;
extern const char rcs_version[];