[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc-cvs.el,v [EMACS_22_BASE]
From: |
Dan Nicolaescu |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc-cvs.el,v [EMACS_22_BASE] |
Date: |
Mon, 30 Jul 2007 00:19:14 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Dan Nicolaescu <dann> 07/07/30 00:19:07
Index: lisp/vc-cvs.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-cvs.el,v
retrieving revision 1.80.2.1
retrieving revision 1.80.2.2
diff -u -b -r1.80.2.1 -r1.80.2.2
--- lisp/vc-cvs.el 25 Jul 2007 04:46:55 -0000 1.80.2.1
+++ lisp/vc-cvs.el 30 Jul 2007 00:19:01 -0000 1.80.2.2
@@ -29,8 +29,7 @@
;;; Code:
-(eval-when-compile
- (require 'vc))
+(eval-when-compile (require 'cl) (require 'vc))
;;;
;;; Customization options
@@ -960,6 +959,33 @@
(vc-file-setprop file 'vc-checkout-time 0)
(if set-state (vc-file-setprop file 'vc-state 'edited)))))))))
+;; Completion of revision names.
+;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use
+;; `cvs log' so I can list all the revision numbers rather than only
+;; tag names.
+
+(defun vc-cvs-revision-table (file)
+ (let ((default-directory (file-name-directory file))
+ (res nil))
+ (with-temp-buffer
+ (vc-cvs-command t nil file "log")
+ (goto-char (point-min))
+ (when (re-search-forward "^symbolic names:\n" nil t)
+ (while (looking-at "^ \\(.*\\): \\(.*\\)")
+ (push (cons (match-string 1) (match-string 2)) res)
+ (forward-line 1)))
+ (while (re-search-forward "^revision \\([0-9.]+\\)" nil t)
+ (push (match-string 1) res))
+ res)))
+
+(defun vc-cvs-revision-completion-table (file)
+ (lexical-let ((file file)
+ table)
+ (setq table (lazy-completion-table
+ table (lambda () (vc-cvs-revision-table file))))
+ table))
+
+
(provide 'vc-cvs)
;;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432