comparison lisp/vc-git.el @ 85139:8ba0e30716a5

Terminology cleanup.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Wed, 10 Oct 2007 18:52:45 +0000
parents 5039706521c9
children b16f7408cd3f
comparison
equal deleted inserted replaced
85138:9eb84ff59d9b 85139:8ba0e30716a5
51 ;; STATE-QUERYING FUNCTIONS 51 ;; STATE-QUERYING FUNCTIONS
52 ;; * registered (file) OK 52 ;; * registered (file) OK
53 ;; * state (file) OK 53 ;; * state (file) OK
54 ;; - state-heuristic (file) NOT NEEDED 54 ;; - state-heuristic (file) NOT NEEDED
55 ;; - dir-state (dir) OK 55 ;; - dir-state (dir) OK
56 ;; * workfile-version (file) OK 56 ;; * working-revision (file) OK
57 ;; - latest-on-branch-p (file) NOT NEEDED 57 ;; - latest-on-branch-p (file) NOT NEEDED
58 ;; * checkout-model (file) OK 58 ;; * checkout-model (file) OK
59 ;; - workfile-unchanged-p (file) OK 59 ;; - workfile-unchanged-p (file) OK
60 ;; - mode-line-string (file) OK 60 ;; - mode-line-string (file) OK
61 ;; - dired-state-info (file) OK 61 ;; - dired-state-info (file) OK
62 ;; STATE-CHANGING FUNCTIONS 62 ;; STATE-CHANGING FUNCTIONS
63 ;; * create-repo () OK 63 ;; * create-repo () OK
64 ;; * register (files &optional rev comment) OK 64 ;; * register (files &optional rev comment) OK
65 ;; - init-version (file) NOT NEEDED 65 ;; - init-revision (file) NOT NEEDED
66 ;; - responsible-p (file) OK 66 ;; - responsible-p (file) OK
67 ;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD 67 ;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD
68 ;; - receive-file (file rev) NOT NEEDED 68 ;; - receive-file (file rev) NOT NEEDED
69 ;; - unregister (file) OK 69 ;; - unregister (file) OK
70 ;; * checkin (files rev comment) OK 70 ;; * checkin (files rev comment) OK
71 ;; * find-version (file rev buffer) OK 71 ;; * find-revision (file rev buffer) OK
72 ;; * checkout (file &optional editable rev) OK 72 ;; * checkout (file &optional editable rev) OK
73 ;; * revert (file &optional contents-done) OK 73 ;; * revert (file &optional contents-done) OK
74 ;; - rollback (files) COULD BE SUPPORTED 74 ;; - rollback (files) COULD BE SUPPORTED
75 ;; - merge (file rev1 rev2) It would be possible to merge changes into 75 ;; - merge (file rev1 rev2) It would be possible to merge changes into
76 ;; a single file, but when committing they 76 ;; a single file, but when committing they
175 ((eq status-char ??) 175 ((eq status-char ??)
176 (vc-file-setprop file 'vc-backend 'none) 176 (vc-file-setprop file 'vc-backend 'none)
177 (vc-file-setprop file 'vc-state 'nil))) 177 (vc-file-setprop file 'vc-state 'nil)))
178 (forward-line))))) 178 (forward-line)))))
179 179
180 (defun vc-git-workfile-version (file) 180 (defun vc-git-working-revision (file)
181 "Git-specific version of `vc-workfile-version'." 181 "Git-specific version of `vc-working-revision'."
182 (let ((str (with-output-to-string 182 (let ((str (with-output-to-string
183 (with-current-buffer standard-output 183 (with-current-buffer standard-output
184 (call-process "git" nil '(t nil) nil "symbolic-ref" "HEAD"))))) 184 (call-process "git" nil '(t nil) nil "symbolic-ref" "HEAD")))))
185 (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str) 185 (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
186 (match-string 2 str) 186 (match-string 2 str)
192 (defun vc-git-workfile-unchanged-p (file) 192 (defun vc-git-workfile-unchanged-p (file)
193 (eq 'up-to-date (vc-git-state file))) 193 (eq 'up-to-date (vc-git-state file)))
194 194
195 (defun vc-git-mode-line-string (file) 195 (defun vc-git-mode-line-string (file)
196 "Return string for placement into the modeline for FILE." 196 "Return string for placement into the modeline for FILE."
197 (let* ((branch (vc-git-workfile-version file)) 197 (let* ((branch (vc-git-working-revision file))
198 (def-ml (vc-default-mode-line-string 'Git file)) 198 (def-ml (vc-default-mode-line-string 'Git file))
199 (help-echo (get-text-property 0 'help-echo def-ml))) 199 (help-echo (get-text-property 0 'help-echo def-ml)))
200 (if (zerop (length branch)) 200 (if (zerop (length branch))
201 (propertize 201 (propertize
202 (concat def-ml "!") 202 (concat def-ml "!")
230 230
231 (defun vc-git-checkin (files rev comment) 231 (defun vc-git-checkin (files rev comment)
232 (let ((coding-system-for-write git-commits-coding-system)) 232 (let ((coding-system-for-write git-commits-coding-system))
233 (vc-git-command nil 0 files "commit" "-m" comment "--only" "--"))) 233 (vc-git-command nil 0 files "commit" "-m" comment "--only" "--")))
234 234
235 (defun vc-git-find-version (file rev buffer) 235 (defun vc-git-find-revision (file rev buffer)
236 (let ((coding-system-for-read 'binary) 236 (let ((coding-system-for-read 'binary)
237 (coding-system-for-write 'binary) 237 (coding-system-for-write 'binary)
238 (fullname (substring 238 (fullname (substring
239 (vc-git--run-command-string 239 (vc-git--run-command-string
240 file "ls-files" "-z" "--full-name" "--") 240 file "ls-files" "-z" "--full-name" "--")