Mercurial > emacs
comparison lisp/vc-hg.el @ 85139:8ba0e30716a5
Terminology cleanup.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Wed, 10 Oct 2007 18:52:45 +0000 |
parents | 493b2df20f41 |
children | b16f7408cd3f |
comparison
equal
deleted
inserted
replaced
85138:9eb84ff59d9b | 85139:8ba0e30716a5 |
---|---|
43 ;; STATE-QUERYING FUNCTIONS | 43 ;; STATE-QUERYING FUNCTIONS |
44 ;; * registered (file) OK | 44 ;; * registered (file) OK |
45 ;; * state (file) OK | 45 ;; * state (file) OK |
46 ;; - state-heuristic (file) ?? PROBABLY NOT NEEDED | 46 ;; - state-heuristic (file) ?? PROBABLY NOT NEEDED |
47 ;; - dir-state (dir) OK | 47 ;; - dir-state (dir) OK |
48 ;; * workfile-version (file) OK | 48 ;; * working-revision (file) OK |
49 ;; - latest-on-branch-p (file) ?? | 49 ;; - latest-on-branch-p (file) ?? |
50 ;; * checkout-model (file) OK | 50 ;; * checkout-model (file) OK |
51 ;; - workfile-unchanged-p (file) OK | 51 ;; - workfile-unchanged-p (file) OK |
52 ;; - mode-line-string (file) NOT NEEDED | 52 ;; - mode-line-string (file) NOT NEEDED |
53 ;; - dired-state-info (file) OK | 53 ;; - dired-state-info (file) OK |
54 ;; STATE-CHANGING FUNCTIONS | 54 ;; STATE-CHANGING FUNCTIONS |
55 ;; * register (files &optional rev comment) OK | 55 ;; * register (files &optional rev comment) OK |
56 ;; * create-repo () OK | 56 ;; * create-repo () OK |
57 ;; - init-version () NOT NEEDED | 57 ;; - init-revision () NOT NEEDED |
58 ;; - responsible-p (file) OK | 58 ;; - responsible-p (file) OK |
59 ;; - could-register (file) OK | 59 ;; - could-register (file) OK |
60 ;; - receive-file (file rev) ?? PROBABLY NOT NEEDED | 60 ;; - receive-file (file rev) ?? PROBABLY NOT NEEDED |
61 ;; - unregister (file) COMMENTED OUT, MAY BE INCORRECT | 61 ;; - unregister (file) COMMENTED OUT, MAY BE INCORRECT |
62 ;; * checkin (files rev comment) OK | 62 ;; * checkin (files rev comment) OK |
63 ;; * find-version (file rev buffer) OK | 63 ;; * find-revision (file rev buffer) OK |
64 ;; * checkout (file &optional editable rev) OK | 64 ;; * checkout (file &optional editable rev) OK |
65 ;; * revert (file &optional contents-done) OK | 65 ;; * revert (file &optional contents-done) OK |
66 ;; - rollback (files) ?? PROBABLY NOT NEEDED | 66 ;; - rollback (files) ?? PROBABLY NOT NEEDED |
67 ;; - merge (file rev1 rev2) NEEDED | 67 ;; - merge (file rev1 rev2) NEEDED |
68 ;; - merge-news (file) NEEDED | 68 ;; - merge-news (file) NEEDED |
196 ;; ! = deleted, but still tracked | 196 ;; ! = deleted, but still tracked |
197 ;; ? = not tracked | 197 ;; ? = not tracked |
198 ;; should not show up in vc-dired, so don't deal with them | 198 ;; should not show up in vc-dired, so don't deal with them |
199 ;; here. | 199 ;; here. |
200 ((eq status-char ?A) | 200 ((eq status-char ?A) |
201 (vc-file-setprop file 'vc-workfile-version "0") | 201 (vc-file-setprop file 'vc-working-revision "0") |
202 (vc-file-setprop file 'vc-state 'edited)) | 202 (vc-file-setprop file 'vc-state 'edited)) |
203 ((eq status-char ?M) | 203 ((eq status-char ?M) |
204 (vc-file-setprop file 'vc-state 'edited)) | 204 (vc-file-setprop file 'vc-state 'edited)) |
205 ((eq status-char ??) | 205 ((eq status-char ??) |
206 (vc-file-setprop file 'vc-backend 'none) | 206 (vc-file-setprop file 'vc-backend 'none) |
207 (vc-file-setprop file 'vc-state 'nil))) | 207 (vc-file-setprop file 'vc-state 'nil))) |
208 (forward-line))))) | 208 (forward-line))))) |
209 | 209 |
210 (defun vc-hg-workfile-version (file) | 210 (defun vc-hg-working-revision (file) |
211 "Hg-specific version of `vc-workfile-version'." | 211 "Hg-specific version of `vc-working-revision'." |
212 (let* | 212 (let* |
213 ((status nil) | 213 ((status nil) |
214 (out | 214 (out |
215 (with-output-to-string | 215 (with-output-to-string |
216 (with-current-buffer | 216 (with-current-buffer |
276 ("^date: \\(.+\\)" (1 'change-log-date)) | 276 ("^date: \\(.+\\)" (1 'change-log-date)) |
277 ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))) | 277 ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message)))))) |
278 | 278 |
279 (defun vc-hg-diff (files &optional oldvers newvers buffer) | 279 (defun vc-hg-diff (files &optional oldvers newvers buffer) |
280 "Get a difference report using hg between two versions of FILES." | 280 "Get a difference report using hg between two versions of FILES." |
281 (let ((working (vc-workfile-version (car files)))) | 281 (let ((working (vc-working-revision (car files)))) |
282 (if (and (equal oldvers working) (not newvers)) | 282 (if (and (equal oldvers working) (not newvers)) |
283 (setq oldvers nil)) | 283 (setq oldvers nil)) |
284 (if (and (not oldvers) newvers) | 284 (if (and (not oldvers) newvers) |
285 (setq oldvers working)) | 285 (setq oldvers working)) |
286 (apply #'vc-hg-command (or buffer "*vc-diff*") nil | 286 (apply #'vc-hg-command (or buffer "*vc-diff*") nil |
400 (defun vc-hg-checkin (files rev comment) | 400 (defun vc-hg-checkin (files rev comment) |
401 "Hg-specific version of `vc-backend-checkin'. | 401 "Hg-specific version of `vc-backend-checkin'. |
402 REV is ignored." | 402 REV is ignored." |
403 (vc-hg-command nil 0 files "commit" "-m" comment)) | 403 (vc-hg-command nil 0 files "commit" "-m" comment)) |
404 | 404 |
405 (defun vc-hg-find-version (file rev buffer) | 405 (defun vc-hg-find-revision (file rev buffer) |
406 (let ((coding-system-for-read 'binary) | 406 (let ((coding-system-for-read 'binary) |
407 (coding-system-for-write 'binary)) | 407 (coding-system-for-write 'binary)) |
408 (if rev | 408 (if rev |
409 (vc-hg-command buffer 0 file "cat" "-r" rev) | 409 (vc-hg-command buffer 0 file "cat" "-r" rev) |
410 (vc-hg-command buffer 0 file "cat")))) | 410 (vc-hg-command buffer 0 file "cat")))) |
430 | 430 |
431 (defun vc-hg-dired-state-info (file) | 431 (defun vc-hg-dired-state-info (file) |
432 "Hg-specific version of `vc-dired-state-info'." | 432 "Hg-specific version of `vc-dired-state-info'." |
433 (let ((hg-state (vc-state file))) | 433 (let ((hg-state (vc-state file))) |
434 (if (eq hg-state 'edited) | 434 (if (eq hg-state 'edited) |
435 (if (equal (vc-workfile-version file) "0") | 435 (if (equal (vc-working-revision file) "0") |
436 "(added)" "(modified)") | 436 "(added)" "(modified)") |
437 ;; fall back to the default VC representation | 437 ;; fall back to the default VC representation |
438 (vc-default-dired-state-info 'Hg file)))) | 438 (vc-default-dired-state-info 'Hg file)))) |
439 | 439 |
440 ;; Modelled after the similar function in vc-bzr.el | 440 ;; Modelled after the similar function in vc-bzr.el |