Hi,
Let's bring status a bit more inline with its GNU cvs counter part.
This diff adds the branch revision for the sticky tag if set.
.joris
Index: status.c
===================================================================
RCS file: /cvs/src/usr.bin/cvs/status.c,v
retrieving revision 1.96
diff -u -p -r1.96 status.c
--- status.c 4 Apr 2015 14:20:11 -0000 1.96
+++ status.c 17 Oct 2016 09:06:12 -0000
@@ -16,6 +16,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
@@ -119,7 +120,7 @@ void
cvs_status_local(struct cvs_file *cf)
{
size_t len;
- RCSNUM *head;
+ RCSNUM *head, *brev;
const char *status;
struct rcs_delta *rdp;
char buf[PATH_MAX + CVS_REV_BUFSZ + 128];
@@ -223,11 +224,23 @@ cvs_status_local(struct cvs_file *cf)
}
if (cf->file_ent != NULL) {
- if (cf->file_ent->ce_tag != NULL)
- cvs_printf(" Sticky Tag:\t\t%s\n",
- cf->file_ent->ce_tag);
- else if (verbosity > 0)
+ if (cf->file_ent->ce_tag != NULL) {
+ if ((brev = rcs_sym_getrev(cf->file_rcs,
+ cf->file_ent->ce_tag)) == NULL) {
+ (void)strlcpy(buf, "- MISSING from RCS file!",
+ sizeof(buf));
+ } else {
+ rcsnum_tostr(brev, revbuf, sizeof(revbuf));
+ (void)xsnprintf(buf, sizeof(buf),
+ "(branch: %s)", revbuf);
+ free(brev);
+ }
+
+ cvs_printf(" Sticky Tag:\t\t%s %s\n",
+ cf->file_ent->ce_tag, buf);
+ } else if (verbosity > 0) {
cvs_printf(" Sticky Tag:\t\t(none)\n");
+ }
if (cf->file_ent->ce_date != -1) {
struct tm datetm;