emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc-git.el,v


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-git.el,v
Date: Thu, 26 Jul 2007 17:26:10 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   07/07/26 17:26:10

Index: vc-git.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-git.el,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- vc-git.el   25 Jul 2007 15:08:09 -0000      1.15
+++ vc-git.el   26 Jul 2007 17:26:08 -0000      1.16
@@ -51,10 +51,10 @@
 ;; STATE-QUERYING FUNCTIONS
 ;; * registered (file)                            OK
 ;; * state (file)                                 OK
-;; - state-heuristic (file)                       ?? PROBABLY NOT NEEDED
+;; - state-heuristic (file)                       NOT NEEDED
 ;; - dir-state (dir)                              OK
 ;; * workfile-version (file)                      OK
-;; - latest-on-branch-p (file)                    ??
+;; - latest-on-branch-p (file)                    NOT NEEDED
 ;; * checkout-model (file)                        OK
 ;; - workfile-unchanged-p (file)                  OK
 ;; - mode-line-string (file)                      NOT NEEDED
@@ -62,16 +62,16 @@
 ;; STATE-CHANGING FUNCTIONS
 ;; * create-repo ()                               OK
 ;; * register (files &optional rev comment)       OK
-;; - init-version (file)                          ??
+;; - init-version (file)                          NOT NEEDED
 ;; - responsible-p (file)                         OK
-;; - could-register (file)                        NEEDED
-;; - receive-file (file rev)                      ??
+;; - could-register (file)                        NOT NEEDED, DEFAULT IS GOOD
+;; - receive-file (file rev)                      NOT NEEDED
 ;; - unregister (file)                            OK
 ;; * checkin (files rev comment)                  OK
 ;; * find-version (file rev buffer)               OK
 ;; * checkout (file &optional editable rev)       OK
 ;; * revert (file &optional contents-done)        OK
-;; - rollback (files)                             ?? PROBABLY NOT NEEDED
+;; - rollback (files)                             COULD BE SUPPORTED
 ;; - merge (file rev1 rev2)                       It would be possible to 
merge changes into 
 ;;                                                 a single file, but when 
committing they 
 ;;                                                 wouldn't be identified as a 
merge by git, 
@@ -82,32 +82,32 @@
 ;; * print-log (files &optional buffer)                   OK
 ;; - log-view-mode ()                             OK
 ;; - show-log-entry (version)                     NOT NEEDED, DEFAULT IS GOOD
-;; - wash-log (file)                              ??
-;; - logentry-check ()                            ??
+;; - wash-log (file)                              COULD BE SUPPORTED
+;; - logentry-check ()                            NOT NEEDED
 ;; - comment-history (file)                       ??
-;; - update-changelog (files)                     ??
+;; - update-changelog (files)                     COULD BE SUPPORTED
 ;; * diff (file &optional rev1 rev2 buffer)       OK
 ;; - revision-completion-table (file)             NEEDED?
 ;; - diff-tree (dir &optional rev1 rev2)          OK
 ;; - annotate-command (file buf &optional rev)    OK
 ;; - annotate-time ()                             OK
-;; - annotate-current-time ()                     ?? NOT NEEDED
+;; - annotate-current-time ()                     NOT NEEDED
 ;; - annotate-extract-revision-at-line ()         OK
 ;; SNAPSHOT SYSTEM
 ;; - create-snapshot (dir name branchp)                   OK
 ;; - assign-name (file name)                      NOT NEEDED
 ;; - retrieve-snapshot (dir name update)          OK, needs to update buffers
 ;; MISCELLANEOUS
-;; - make-version-backups-p (file)                ??
-;; - repository-hostname (dirname)                ??
+;; - make-version-backups-p (file)                NOT NEEDED
+;; - repository-hostname (dirname)                NOT NEEDED
 ;; - previous-version (file rev)                  OK
 ;; - next-version (file rev)                      OK
-;; - check-headers ()                             ??
-;; - clear-headers ()                             ??
+;; - check-headers ()                             COULD BE SUPPORTED
+;; - clear-headers ()                             NOT NEEDED
 ;; - delete-file (file)                                   OK
 ;; - rename-file (old new)                        OK
-;; - find-file-hook ()                            PROBABLY NOT NEEDED
-;; - find-file-not-found-hook ()                   PROBABLY NOT NEEDED
+;; - find-file-hook ()                            NOT NEEDED
+;; - find-file-not-found-hook ()                   NOT NEEDED
 
 (eval-when-compile (require 'cl) (require 'vc))
 
@@ -318,6 +318,22 @@
         (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 
"--")
       (vc-git-command buf 1 files "diff-index" "--exit-code" "-p" (or rev1 
"HEAD") "--"))))
 
+(defun vc-git-revision-table (file)
+  (let ((table (list "HEAD")))
+    (with-temp-buffer
+      (vc-git-command t nil nil "for-each-ref" "--format=%(refname)")
+      (goto-char (point-min))
+      (while (re-search-forward "^refs/\\(heads\\|tags\\)/\\(.*\\)$" nil t)
+        (push (match-string 2) table)))
+    table))
+
+(defun vc-git-revision-completion-table (file)
+  (lexical-let ((file file)
+                table)
+    (setq table (lazy-completion-table
+                 table (lambda () (vc-git-revision-table file))))
+    table))
+
 (defun vc-git-diff-tree (dir &optional rev1 rev2)
   (vc-git-diff dir rev1 rev2))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]