comparison lisp/vc-git.el @ 104616:2d38fd635554

(vc-git-register): Use "git add" for directories.
author Dan Nicolaescu <dann@ics.uci.edu>
date Wed, 26 Aug 2009 06:48:58 +0000
parents 1c78b6ed2b93
children abce8d2d9707
comparison
equal deleted inserted replaced
104615:6915f976dcd2 104616:2d38fd635554
41 41
42 ;; Implement the rest of the vc interface. See the comment at the 42 ;; Implement the rest of the vc interface. See the comment at the
43 ;; beginning of vc.el. The current status is: 43 ;; beginning of vc.el. The current status is:
44 ;; ("??" means: "figure out what to do about it") 44 ;; ("??" means: "figure out what to do about it")
45 ;; 45 ;;
46 ;; FUNCTION NAME STATUS 46 ;; FUNCTION NAME STATUS
47 ;; BACKEND PROPERTIES 47 ;; BACKEND PROPERTIES
48 ;; * revision-granularity OK 48 ;; * revision-granularity OK
49 ;; STATE-QUERYING FUNCTIONS 49 ;; STATE-QUERYING FUNCTIONS
50 ;; * registered (file) OK 50 ;; * registered (file) OK
51 ;; * state (file) OK 51 ;; * state (file) OK
52 ;; - state-heuristic (file) NOT NEEDED 52 ;; - state-heuristic (file) NOT NEEDED
53 ;; * working-revision (file) OK 53 ;; * working-revision (file) OK
54 ;; - latest-on-branch-p (file) NOT NEEDED 54 ;; - latest-on-branch-p (file) NOT NEEDED
55 ;; * checkout-model (files) OK 55 ;; * checkout-model (files) OK
56 ;; - workfile-unchanged-p (file) OK 56 ;; - workfile-unchanged-p (file) OK
57 ;; - mode-line-string (file) OK 57 ;; - mode-line-string (file) OK
58 ;; STATE-CHANGING FUNCTIONS 58 ;; STATE-CHANGING FUNCTIONS
59 ;; * create-repo () OK 59 ;; * create-repo () OK
60 ;; * register (files &optional rev comment) OK 60 ;; * register (files &optional rev comment) OK
61 ;; - init-revision (file) NOT NEEDED 61 ;; - init-revision (file) NOT NEEDED
62 ;; - responsible-p (file) OK 62 ;; - responsible-p (file) OK
63 ;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD 63 ;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD
64 ;; - receive-file (file rev) NOT NEEDED 64 ;; - receive-file (file rev) NOT NEEDED
65 ;; - unregister (file) OK 65 ;; - unregister (file) OK
66 ;; * checkin (files rev comment) OK 66 ;; * checkin (files rev comment) OK
67 ;; * find-revision (file rev buffer) OK 67 ;; * find-revision (file rev buffer) OK
68 ;; * checkout (file &optional editable rev) OK 68 ;; * checkout (file &optional editable rev) OK
69 ;; * revert (file &optional contents-done) OK 69 ;; * revert (file &optional contents-done) OK
70 ;; - rollback (files) COULD BE SUPPORTED 70 ;; - rollback (files) COULD BE SUPPORTED
71 ;; - merge (file rev1 rev2) It would be possible to merge 71 ;; - merge (file rev1 rev2) It would be possible to merge
72 ;; changes into a single file, but when 72 ;; changes into a single file, but when
73 ;; committing they wouldn't 73 ;; committing they wouldn't
74 ;; be identified as a merge 74 ;; be identified as a merge
75 ;; by git, so it's probably 75 ;; by git, so it's probably
76 ;; not a good idea. 76 ;; not a good idea.
77 ;; - merge-news (file) see `merge' 77 ;; - merge-news (file) see `merge'
78 ;; - steal-lock (file &optional revision) NOT NEEDED 78 ;; - steal-lock (file &optional revision) NOT NEEDED
79 ;; HISTORY FUNCTIONS 79 ;; HISTORY FUNCTIONS
80 ;; * print-log (files &optional buffer) OK 80 ;; * print-log (files &optional buffer shortlog) OK
81 ;; - log-view-mode () OK 81 ;; - log-view-mode () OK
82 ;; - show-log-entry (revision) OK 82 ;; - show-log-entry (revision) OK
83 ;; - comment-history (file) ?? 83 ;; - comment-history (file) ??
84 ;; - update-changelog (files) COULD BE SUPPORTED 84 ;; - update-changelog (files) COULD BE SUPPORTED
85 ;; * diff (file &optional rev1 rev2 buffer) OK 85 ;; * diff (file &optional rev1 rev2 buffer) OK
86 ;; - revision-completion-table (files) OK 86 ;; - revision-completion-table (files) OK
87 ;; - annotate-command (file buf &optional rev) OK 87 ;; - annotate-command (file buf &optional rev) OK
88 ;; - annotate-time () OK 88 ;; - annotate-time () OK
89 ;; - annotate-current-time () NOT NEEDED 89 ;; - annotate-current-time () NOT NEEDED
90 ;; - annotate-extract-revision-at-line () OK 90 ;; - annotate-extract-revision-at-line () OK
91 ;; TAG SYSTEM 91 ;; TAG SYSTEM
92 ;; - create-tag (dir name branchp) OK 92 ;; - create-tag (dir name branchp) OK
93 ;; - retrieve-tag (dir name update) OK, needs to update buffers 93 ;; - retrieve-tag (dir name update) OK
94 ;; MISCELLANEOUS 94 ;; MISCELLANEOUS
95 ;; - make-version-backups-p (file) NOT NEEDED 95 ;; - make-version-backups-p (file) NOT NEEDED
96 ;; - repository-hostname (dirname) NOT NEEDED 96 ;; - repository-hostname (dirname) NOT NEEDED
97 ;; - previous-revision (file rev) OK 97 ;; - previous-revision (file rev) OK
98 ;; - next-revision (file rev) OK 98 ;; - next-revision (file rev) OK
99 ;; - check-headers () COULD BE SUPPORTED 99 ;; - check-headers () COULD BE SUPPORTED
100 ;; - clear-headers () NOT NEEDED 100 ;; - clear-headers () NOT NEEDED
101 ;; - delete-file (file) OK 101 ;; - delete-file (file) OK
102 ;; - rename-file (old new) OK 102 ;; - rename-file (old new) OK
103 ;; - find-file-hook () NOT NEEDED 103 ;; - find-file-hook () NOT NEEDED
104 104
105 (eval-when-compile 105 (eval-when-compile
106 (require 'cl) 106 (require 'cl)
107 (require 'vc) 107 (require 'vc)
108 (require 'vc-dir) 108 (require 'vc-dir)
424 (defun vc-git-create-repo () 424 (defun vc-git-create-repo ()
425 "Create a new Git repository." 425 "Create a new Git repository."
426 (vc-git-command nil 0 nil "init")) 426 (vc-git-command nil 0 nil "init"))
427 427
428 (defun vc-git-register (files &optional rev comment) 428 (defun vc-git-register (files &optional rev comment)
429 "Register FILE into the git version-control system." 429 "Register FILES into the git version-control system."
430 (vc-git-command nil 0 files "update-index" "--add" "--")) 430 (let (flist dlist)
431 (dolist (crt files)
432 (if (file-directory-p crt)
433 (push crt dlist)
434 (push crt flist)))
435 (when flist
436 (vc-git-command nil 0 flist "update-index" "--add" "--"))
437 (when dlist
438 (vc-git-command nil 0 dlist "add"))))
431 439
432 (defalias 'vc-git-responsible-p 'vc-git-root) 440 (defalias 'vc-git-responsible-p 'vc-git-root)
433 441
434 (defun vc-git-unregister (file) 442 (defun vc-git-unregister (file)
435 (vc-git-command nil 0 file "rm" "-f" "--cached" "--")) 443 (vc-git-command nil 0 file "rm" "-f" "--cached" "--"))