From a6ddbc6a8ce1d7cdeaa1087a009eed68c8c3c0ab Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Sat, 9 Feb 2008 14:34:41 +0000 Subject: Get date support into annotate, too. OK joris@ --- usr.bin/cvs/annotate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/cvs/annotate.c b/usr.bin/cvs/annotate.c index 32efd059a47..af242152fc4 100644 --- a/usr.bin/cvs/annotate.c +++ b/usr.bin/cvs/annotate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: annotate.c,v 1.52 2008/02/04 21:25:32 tobias Exp $ */ +/* $OpenBSD: annotate.c,v 1.53 2008/02/09 14:34:40 tobias Exp $ */ /* * Copyright (c) 2007 Tobias Stoeckmann * Copyright (c) 2006 Xavier Santolaria @@ -32,6 +32,7 @@ void cvs_annotate_local(struct cvs_file *); extern char *cvs_specified_tag; +static char *dateflag; static int force_head = 0; struct cvs_cmd cvs_cmd_annotate = { @@ -67,6 +68,8 @@ cvs_annotate(int argc, char **argv) cvs_cmd_annotate.cmd_opts : cvs_cmd_rannotate.cmd_opts)) != -1) { switch (ch) { case 'D': + dateflag = optarg; + cvs_specified_date = cvs_date_parse(dateflag); break; case 'f': force_head = 1; @@ -98,6 +101,9 @@ cvs_annotate(int argc, char **argv) cvs_client_connect_to_server(); cr.fileproc = cvs_client_sendfile; + if (dateflag != NULL) + cvs_client_send_request("Argument -D%s", dateflag); + if (force_head == 1) cvs_client_send_request("Argument -f"); @@ -197,7 +203,7 @@ cvs_annotate_local(struct cvs_file *cf) } rcsnum_free(rev); } else { - rcs_rev_getlines(cf->file_rcs, cf->file_rcs->rf_head, &alines); + rcs_rev_getlines(cf->file_rcs, cf->file_rcsrev, &alines); } /* Stick at weird GNU cvs, ignore error. */ -- cgit v1.2.3