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: Checkout a branch in cvs-tree Date: Tue, 20 Apr 2004 17:12:30 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <20040420.171230.136508869.yamato@redhat.com> References: <4nvfjzazzg.fsf@lifelogs.com> <87smf2sbnq.fsf@emptyhost.emptydomain.de> 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 1082449164 20330 80.91.224.253 (20 Apr 2004 08:19:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Apr 2004 08:19:24 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 20 10:19:16 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BFqTL-0005hK-00 for ; Tue, 20 Apr 2004 10:19:15 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BFqTL-0003zG-00 for ; Tue, 20 Apr 2004 10:19:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BFqQX-0002XN-TM for emacs-devel@quimby.gnus.org; Tue, 20 Apr 2004 04:16:21 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BFqPz-0002Ue-AB for emacs-devel@gnu.org; Tue, 20 Apr 2004 04:15:47 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BFqPN-0002E7-Kr for emacs-devel@gnu.org; Tue, 20 Apr 2004 04:15:40 -0400 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BFqNQ-0001Md-Cz for emacs-devel@gnu.org; Tue, 20 Apr 2004 04:13:08 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i3K8D0JW016025; Tue, 20 Apr 2004 04:13:00 -0400 Original-Received: from ns.tokyo.redhat.com (ns.tokyo.redhat.com [172.16.33.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i3K8Cxj04513; Tue, 20 Apr 2004 04:12:59 -0400 Original-Received: from localhost (gls07.tokyo.redhat.com [172.16.32.104]) by ns.tokyo.redhat.com (8.11.6/8.11.6) with ESMTP id i3K8Cjl23522; Tue, 20 Apr 2004 17:12:45 +0900 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.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21930 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21930 Hi, 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. The question is how to set the cvs root for `cvs-checkout' command. I'm using CVSROOT environment variable. It may be wrong way. Regards, Masatake YAMATO Index: lisp/cvs-status.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/cvs-status.el,v retrieving revision 1.16 diff -u -r1.16 cvs-status.el --- lisp/cvs-status.el 26 Mar 2004 15:20:20 -0000 1.16 +++ lisp/cvs-status.el 20 Apr 2004 08:06:43 -0000 @@ -442,6 +442,22 @@ ;;(sit-for 0) )))))) +(easy-mmode-defmap cvs-status-tag-map + `((">" . cvs-tree-checkout)) + "The keymap only used on a tag of cvs tree.") + +(defun cvs-tree-checkout (dir) + (interactive "DDirectory: ") + (let ((modules (list (cvs-get-module))) + (flags (cons "-r" (cons (get-text-property (point) 'tag-name) + (cvs-flags-query 'cvs-checkout-flags)))) + (env (getenv "CVSROOT"))) + (unwind-protect + (progn + (setenv "CVSROOT" (cvs-get-cvsroot)) + (cvs-checkout modules dir flags)) + (setenv "CVSROOT" env)))) + (defun cvs-tree-tags-insert (tags prev) (when tags (let* ((tag (car tags)) @@ -462,11 +478,20 @@ (ps prev (cdr ps)) (as after (cdr as))) ((and (null as) (null vs) (null ps)) - (let ((revname (cvs-status-vl-to-str vlist))) + (let ((revname (cvs-status-vl-to-str vlist)) + (tname (cvs-tag->name tag))) + (setq tname (if tname + (propertize tname + 'help-echo (substitute-command-keys "\{cvs-status-tag-map}") + 'mouse-face 'highlight + 'keymap cvs-status-tag-map + 'tag-name tname + ) + "")) (if (cvs-every 'identity (cvs-map 'equal prev vlist)) (insert (make-string (+ 4 (length revname)) ? ) - (or (cvs-tag->name tag) "")) - (insert " " revname ": " (or (cvs-tag->name tag) ""))))) + tname) + (insert " " revname ": " tname)))) (let* ((eq (and pe (equal (car ps) (car vs)))) (next-eq (equal (cadr ps) (cadr vs)))) (let* ((na+char