=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/getlog.c,v retrieving revision 1.32 retrieving revision 1.33 diff -c -r1.32 -r1.33 *** src/usr.bin/cvs/getlog.c 2005/07/01 14:29:13 1.32 --- src/usr.bin/cvs/getlog.c 2005/07/01 14:55:30 1.33 *************** *** 1,4 **** ! /* $OpenBSD: getlog.c,v 1.32 2005/07/01 14:29:13 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: getlog.c,v 1.33 2005/07/01 14:55:30 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 46,55 **** #define CVS_GETLOG_REVEND \ "=============================================================================" ! static int cvs_getlog_remote (CVSFILE *, void *); ! static int cvs_getlog_local (CVSFILE *, void *); ! static int cvs_getlog_options(struct cvs_cmd *, int, char **, int *); ! static int cvs_getlog_sendflags(struct cvsroot *); struct cvs_cmd cvs_cmd_log = { CVS_OP_LOG, CVS_REQ_LOG, "log", --- 46,55 ---- #define CVS_GETLOG_REVEND \ "=============================================================================" ! static int cvs_getlog_init (struct cvs_cmd *, int, char **, int *); ! static int cvs_getlog_remote (CVSFILE *, void *); ! static int cvs_getlog_local (CVSFILE *, void *); ! static int cvs_getlog_pre_exec (struct cvsroot *); struct cvs_cmd cvs_cmd_log = { CVS_OP_LOG, CVS_REQ_LOG, "log", *************** *** 59,66 **** "bd:hlNRr:s:tw:", NULL, CF_RECURSE, ! cvs_getlog_options, ! NULL, cvs_getlog_remote, cvs_getlog_local, NULL, --- 59,66 ---- "bd:hlNRr:s:tw:", NULL, CF_RECURSE, ! cvs_getlog_init, ! cvs_getlog_pre_exec, cvs_getlog_remote, cvs_getlog_local, NULL, *************** *** 77,84 **** "d:hlRr:", NULL, CF_RECURSE, ! cvs_getlog_options, ! cvs_getlog_sendflags, cvs_getlog_remote, cvs_getlog_local, NULL, --- 77,84 ---- "d:hlRr:", NULL, CF_RECURSE, ! cvs_getlog_init, ! cvs_getlog_pre_exec, cvs_getlog_remote, cvs_getlog_local, NULL, *************** *** 92,98 **** static int log_notags = 0; static int ! cvs_getlog_options(struct cvs_cmd *cmd, int argc, char **argv, int *arg) { int ch; --- 92,98 ---- static int log_notags = 0; static int ! cvs_getlog_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) { int ch; *************** *** 133,148 **** } static int ! cvs_getlog_sendflags(struct cvsroot *root) { ! if (log_honly && (cvs_sendarg(root, "-h", 0) < 0)) ! return (CVS_EX_PROTO); ! if (log_notags && (cvs_sendarg(root, "-N", 0) < 0)) ! return (CVS_EX_PROTO); ! if (log_rfonly && (cvs_sendarg(root, "-R", 0) < 0)) ! return (CVS_EX_PROTO); ! if (log_lhonly && (cvs_sendarg(root, "-t", 0) < 0)) ! return (CVS_EX_PROTO); return (0); } --- 133,150 ---- } static int ! cvs_getlog_pre_exec(struct cvsroot *root) { ! if (root->cr_method != CVS_METHOD_LOCAL) { ! if (log_honly && (cvs_sendarg(root, "-h", 0) < 0)) ! return (CVS_EX_PROTO); ! if (log_notags && (cvs_sendarg(root, "-N", 0) < 0)) ! return (CVS_EX_PROTO); ! if (log_rfonly && (cvs_sendarg(root, "-R", 0) < 0)) ! return (CVS_EX_PROTO); ! if (log_lhonly && (cvs_sendarg(root, "-t", 0) < 0)) ! return (CVS_EX_PROTO); ! } return (0); } *************** *** 269,283 **** cvs_printf("keyword substitution: %s\n", rf->rf_expand == NULL ? "kv" : rf->rf_expand); ! if (log_honly) ! cvs_printf("total revisions: %u;\n", rf->rf_ndelta); ! else { ! cvs_printf("total revisions: %u;\tselected revisions: %u\n", ! rf->rf_ndelta, nrev); ! if (!log_lhonly) ! cvs_printf("description:\n%s", rf->rf_desc); TAILQ_FOREACH(rdp, &(rf->rf_delta), rd_list) { rcsnum_tostr(rdp->rd_num, numbuf, sizeof(numbuf)); cvs_printf(CVS_GETLOG_REVSEP "\nrevision %s\n", numbuf); --- 271,287 ---- cvs_printf("keyword substitution: %s\n", rf->rf_expand == NULL ? "kv" : rf->rf_expand); ! cvs_printf("total revisions: %u;", rf->rf_ndelta); ! if (!log_honly || !log_lhonly) ! cvs_printf("\tselected revisions: %u", nrev); ! ! cvs_printf("\n"); + if (!log_honly || log_lhonly) + cvs_printf("description:\n%s", rf->rf_desc); + + if (!log_honly && !log_lhonly) { TAILQ_FOREACH(rdp, &(rf->rf_delta), rd_list) { rcsnum_tostr(rdp->rd_num, numbuf, sizeof(numbuf)); cvs_printf(CVS_GETLOG_REVSEP "\nrevision %s\n", numbuf);