From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: Re: Checkout a branch in cvs-tree Date: Sat, 21 Aug 2004 20:44:12 +0900 (JST) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <20040821.204412.71107410.jet@gyve.org> References: <20040420.171230.136508869.yamato@redhat.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1093088809 24412 80.91.224.253 (21 Aug 2004 11:46:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 21 Aug 2004 11:46:49 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 21 13:46:39 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ByUKS-0008NT-00 for ; Sat, 21 Aug 2004 13:46:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ByUOo-00076D-Hf for ged-emacs-devel@m.gmane.org; Sat, 21 Aug 2004 07:51:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1ByUOh-00074C-UN for emacs-devel@gnu.org; Sat, 21 Aug 2004 07:51:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1ByUOg-00073P-Sw for emacs-devel@gnu.org; Sat, 21 Aug 2004 07:50:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ByUOg-00073H-QA for emacs-devel@gnu.org; Sat, 21 Aug 2004 07:50:58 -0400 Original-Received: from [210.130.136.40] (helo=r-maa.spacetown.ne.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ByUKD-0001Zs-K4 for emacs-devel@gnu.org; Sat, 21 Aug 2004 07:46:22 -0400 Original-Received: from localhost (h219-110-074-165.catv01.itscom.jp [219.110.74.165]) by r-maa.spacetown.ne.jp (8.11.6) with ESMTP id i7LBk8c18845; Sat, 21 Aug 2004 20:46:09 +0900 (JST) Original-To: monnier@iro.umontreal.ca In-Reply-To: X-Mailer: Mew version 4.0.62 on Emacs 21.3.50 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26368 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26368 > > The question is how to set the cvs root for `cvs-checkout' > > command. I'm using CVSROOT environment variable. It may be wrong way. > > It's probably easier to let-bind `cvs-cvsroot'. Thank you for your advice. Base on the advice, I have rewritten the patch. I explained the patch in the old mail: I wrote a patch to check out a branch under the point in cvs-tree buffer by hitting `>' to track the current emacs development:-P I found this function is useful. However patch is not clean enough. So I'd like to get your advice. With the new patch, you can do the same on cvs-status buffer. BTW, With gnuarch, finally I get what I wanted during writing the draft version of cvs-tree.el. I think you have interest: http://www.gyve.org/~jet/xtla/xtla-browse.png Regards, Masatake YAMATO 2004-08-21 Masatake YAMATO * cvs-status.el (cvs-status-checkout): New function. (cvs-status-mode-map): Add a key definition for `cvs-status-checkout'. Index: lisp/cvs-status.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/cvs-status.el,v retrieving revision 1.18 diff -u -r1.18 cvs-status.el --- lisp/cvs-status.el 28 May 2004 19:07:57 -0000 1.18 +++ lisp/cvs-status.el 21 Aug 2004 11:33:24 -0000 @@ -48,7 +48,8 @@ ("\M-n" . cvs-status-next) ("\M-p" . cvs-status-prev) ("t" . cvs-status-cvstrees) - ("T" . cvs-status-trees)) + ("T" . cvs-status-trees) + (">" . cvs-status-checkout)) "CVS-Status' keymap." :group 'cvs-status :inherit 'cvs-mode-map) @@ -464,6 +465,26 @@ ;;(sit-for 0) )))))) +(defun-cvs-mode (cvs-status-checkout . NOARGS) (dir) + "Run cvs-checkout against the tag under the point. +The files are stored to DIR. +With prefix argument, prompt for cvs flags." + (interactive + (let* ((module (cvs-get-module)) + (branch (cvs-prefix-get 'cvs-branch-prefix)) + (prompt (format "CVS Checkout Directory for `%s%s': " + module + (if branch (format "(branch: %s)" branch) + "")))) + (list + (read-directory-name prompt + nil default-directory nil)))) + (let ((modules (cvs-string->strings (cvs-get-module))) + (flags (cvs-add-branch-prefix + (cvs-flags-query 'cvs-checkout-flags "cvs checkout flags"))) + (cvs-cvsroot (cvs-get-cvsroot))) + (cvs-checkout modules dir flags))) + (defun cvs-tree-tags-insert (tags prev) (when tags (let* ((tag (car tags))