diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-04-04 14:20:12 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2015-04-04 14:20:12 +0000 |
commit | b0b50df80aeeb29c1a2a7cd2b56c32a85d01e8c5 (patch) | |
tree | 37ce555dda6168feb4243561e0ae762097a95506 | |
parent | b4fd340b37faa9291ab140febe1aa6153c797619 (diff) |
Add support for commit ids to opencvs status.
Patch by joris via tech@; reminded by tedu
-rw-r--r-- | usr.bin/cvs/status.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c index f5d691efd93..aedf41bf462 100644 --- a/usr.bin/cvs/status.c +++ b/usr.bin/cvs/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.95 2015/04/04 14:19:10 stsp Exp $ */ +/* $OpenBSD: status.c,v 1.96 2015/04/04 14:20:11 stsp Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2005-2008 Xavier Santolaria <xsa@openbsd.org> @@ -121,6 +121,7 @@ cvs_status_local(struct cvs_file *cf) size_t len; RCSNUM *head; const char *status; + struct rcs_delta *rdp; char buf[PATH_MAX + CVS_REV_BUFSZ + 128]; char timebuf[CVS_TIME_BUFSZ], revbuf[CVS_REV_BUFSZ]; struct rcs_sym *sym; @@ -211,6 +212,16 @@ cvs_status_local(struct cvs_file *cf) cvs_printf(" Repository revision:\t%s\n", buf); + if (cf->file_rcs != NULL && head != NULL) { + rdp = rcs_findrev(cf->file_rcs, head); + if (rdp == NULL) { + fatal("cvs_status_local: No head revision delta"); + } + + cvs_printf(" Commit Identifier:\t%s\n", + (rdp->rd_commitid != NULL) ? rdp->rd_commitid : "(none)"); + } + if (cf->file_ent != NULL) { if (cf->file_ent->ce_tag != NULL) cvs_printf(" Sticky Tag:\t\t%s\n", |