]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-git-checkin): Delete unused parameter and the code
authorDan Nicolaescu <dann@ics.uci.edu>
Mon, 23 Jul 2007 16:01:25 +0000 (16:01 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Mon, 23 Jul 2007 16:01:25 +0000 (16:01 +0000)
handling it. Use vc-git-command.
(vc-git-find-version, vc-git-diff-tree): New functions.
(vc-git-revert): Use vc-git-command.
(vc-git--run-command): Delete.

lisp/ChangeLog
lisp/vc-git.el

index c46ad1166bca5f01a48044f57217654cf307dd09..f474a0b19978208568802e19eed41c31aba9528c 100644 (file)
@@ -1,3 +1,11 @@
+2007-07-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc-git.el (vc-git-checkin): Delete unused parameter and the code
+       handling it. Use vc-git-command.
+       (vc-git-find-version, vc-git-diff-tree): New functions.
+       (vc-git-revert): Use vc-git-command.
+       (vc-git--run-command): Delete.
+
 2007-07-23  Alexandre Julliard <julliard@winehq.org>
 
        * vc-git.el (vc-git-workfile-unchanged-p): Update comment.
index 8b46c957cdf39f1a59900981652ea8a6be6ebd97..82ae7f21510a9b09581cdab3aeb2cd0727816671 100644 (file)
 ;; - receive-file (file rev)                      ??
 ;; - unregister (file)                            NEEDED
 ;; * checkin (files rev comment)                  OK
-;; * find-version (file rev buffer)               NEEDED!
+;; * find-version (file rev buffer)               OK
 ;; * checkout (file &optional editable rev)       OK
 ;; * revert (file &optional contents-done)        OK
-;; - rollback (files)                             NEEDED
+;; - rollback (files)                             ?? PROBABLY NOT NEEDED
 ;; - merge (file rev1 rev2)                       NEEDED
 ;; - merge-news (file)                            NEEDED
 ;; - steal-lock (file &optional version)          NOT NEEDED
@@ -85,7 +85,7 @@
 ;; - update-changelog (files)                     ??
 ;; * diff (file &optional rev1 rev2 buffer)       PORT TO NEW VC INTERFACE
 ;; - revision-completion-table (file)             NEEDED?
-;; - diff-tree (dir &optional rev1 rev2)          NEEDED
+;; - diff-tree (dir &optional rev1 rev2)          OK
 ;; - annotate-command (file buf &optional rev)    OK
 ;; - annotate-time ()                             OK
 ;; - annotate-current-time ()                     ?? NOT NEEDED
 ;; - next-version (file rev)                      ??
 ;; - check-headers ()                             ??
 ;; - clear-headers ()                             ??
-;; - delete-file (file)                                   NEEDED
-;; - rename-file (old new)                        NEEDED
+;; - delete-file (file)                                   COMMENTED OUT, VERIFY IF CORRECT
+;; - rename-file (old new)                        COMMENTED OUT, VERIFY IF CORRECT
 ;; - find-file-hook ()                            PROBABLY NOT NEEDED
 ;; - find-file-not-found-hook ()                   PROBABLY NOT NEEDED
 
-(eval-when-compile (require 'cl))
+(eval-when-compile (require 'cl) (require 'vc))
 
 (defvar git-commits-coding-system 'utf-8
   "Default coding system for git commits.")
   (let ((coding-system-for-write git-commits-coding-system))
     (vc-git-command nil 0 files "commit" "-m" comment "--only" "--")))
 
-(defun vc-git-checkout (file &optional editable rev destfile)
-  (if destfile
-      (let ((fullname (substring
-                       (vc-git--run-command-string file "ls-files" "-z" "--full-name" "--")
-                       0 -1))
-            (coding-system-for-read 'no-conversion)
-            (coding-system-for-write 'no-conversion))
-        (with-temp-file destfile
-          (eq 0 (call-process "git" nil t nil "cat-file" "blob"
-                              (concat (or rev "HEAD") ":" fullname)))))
-    (vc-git--run-command file "checkout" (or rev "HEAD"))))
+(defun vc-git-find-version (file rev buffer)
+  (let ((coding-system-for-read 'binary)
+        (coding-system-for-write 'binary))
+    (vc-git-command 
+     buffer 0 
+     (concat (if rev rev "HEAD") ":" file) "cat-file" "blob")))
+
+(defun vc-git-checkout (file &optional editable rev)
+  (vc-git-command nil0 file "checkout" (or rev "HEAD")))
 
 (defun vc-git-revert (file &optional contents-done)
   "Revert FILE to the version stored in the git repository."
   (if contents-done
-      (vc-git--run-command file "update-index" "--")
-    (vc-git--run-command file "checkout" "HEAD")))
+      (vc-git-command nil 0 file "update-index" "--")
+    (vc-git-command nil 0 file "checkout" "HEAD")))
 
 ;;; HISTORY FUNCTIONS
 
     ;; git-diff-index doesn't set exit status like diff does
     (if (vc-git-workfile-unchanged-p file) 0 1)))
 
+(defun vc-git-diff-tree (dir &optional rev1 rev2)
+  (vc-git-diff dir rev1 rev2))
+
 (defun vc-git-annotate-command (file buf &optional rev)
   ;; FIXME: rev is ignored
   (let ((name (file-relative-name file)))
              (point)
              (progn (forward-line 1) (1- (point))))))))))
 
+;; XXX verify this is correct
+;; (defun vc-hg-delete-file (file)
+;;   (condition-case ()
+;;       (delete-file file)
+;;     (file-error nil))
+;;   (vc-hg-command nil 0 file "update-index" "--remove"))
+
+;; XXX verify this is correct
+;; (defun vc-hg-rename-file (old new)
+;;   (vc-git-command nil 0 new old "mv"))
+
 \f
 ;; Internal commands
 
@@ -403,11 +415,6 @@ The difference to vc-do-command is that this function always invokes `git'."
                     (setq ok nil))))))
     (and ok str)))
 
-(defun vc-git--run-command (file &rest args)
-  "Run a git command on FILE, discarding any output."
-  (let ((name (file-relative-name file)))
-    (eq 0 (apply #'call-process "git" nil (get-buffer "*Messages") nil (append args (list name))))))
-
 (defun vc-git-symbolic-commit (commit)
   "Translate COMMIT string into symbolic form.
 Returns nil if not possible."