=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/annotate.c,v retrieving revision 1.46 retrieving revision 1.47 diff -c -r1.46 -r1.47 *** src/usr.bin/cvs/annotate.c 2008/02/01 13:36:43 1.46 --- src/usr.bin/cvs/annotate.c 2008/02/01 17:18:59 1.47 *************** *** 1,4 **** ! /* $OpenBSD: annotate.c,v 1.46 2008/02/01 13:36:43 tobias Exp $ */ /* * Copyright (c) 2007 Tobias Stoeckmann * Copyright (c) 2006 Xavier Santolaria --- 1,4 ---- ! /* $OpenBSD: annotate.c,v 1.47 2008/02/01 17:18:59 tobias Exp $ */ /* * Copyright (c) 2007 Tobias Stoeckmann * Copyright (c) 2006 Xavier Santolaria *************** *** 19,24 **** --- 19,25 ---- #include #include + #include #include #include #include *************** *** 43,48 **** --- 44,59 ---- cvs_annotate }; + struct cvs_cmd cvs_cmd_rannotate = { + CVS_OP_RANNOTATE, 0, "rannotate", + { "rann", "ra" }, + "Show last revision where each line was modified", + "[-flR] [-D date | -r rev] [file ...]", + "D:flRr:", + NULL, + cvs_annotate + }; + int cvs_annotate(int argc, char **argv) { *************** *** 76,81 **** --- 87,95 ---- argc -= optind; argv += optind; + if (cvs_cmdop == CVS_OP_RANNOTATE) + flags |= CR_REPO; + cr.enterdir = NULL; cr.leavedir = NULL; *************** *** 93,112 **** cvs_client_send_request("Argument -r%s", cvs_specified_tag); } else { cr.fileproc = cvs_annotate_local; } cr.flags = flags; ! if (argc > 0) ! cvs_file_run(argc, argv, &cr); ! else ! cvs_file_run(1, &arg, &cr); if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) { cvs_client_send_files(argv, argc); cvs_client_senddir("."); ! cvs_client_send_request("annotate"); cvs_client_get_responses(); } --- 107,136 ---- cvs_client_send_request("Argument -r%s", cvs_specified_tag); } else { + if (cvs_cmdop == CVS_OP_RANNOTATE && + chdir(current_cvsroot->cr_dir) == -1) + fatal("cvs_annotate: %s", strerror(errno)); + cr.fileproc = cvs_annotate_local; } cr.flags = flags; ! if (cvs_cmdop == CVS_OP_ANNOTATE || ! current_cvsroot->cr_method == CVS_METHOD_LOCAL) { ! if (argc > 0) ! cvs_file_run(argc, argv, &cr); ! else ! cvs_file_run(1, &arg, &cr); ! } if (current_cvsroot->cr_method != CVS_METHOD_LOCAL) { cvs_client_send_files(argv, argc); cvs_client_senddir("."); ! ! cvs_client_send_request((cvs_cmdop == CVS_OP_RANNOTATE) ? ! "rannotate" : "annotate"); ! cvs_client_get_responses(); }