[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Checkout a branch in cvs-tree
From: |
Masatake YAMATO |
Subject: |
Re: Checkout a branch in cvs-tree |
Date: |
Sat, 21 Aug 2004 20:44:12 +0900 (JST) |
> > 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 <address@hidden>
* 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))