comparison lisp/vc-git.el @ 95020:4da572dc4992

Snapshot primitives globally renamed to refer to tags, documentation updated.
author Eric S. Raymond <esr@snark.thyrsus.com>
date Thu, 15 May 2008 17:38:50 +0000
parents 5e64dca662f0
children 09da7727f35f
comparison
equal deleted inserted replaced
95019:dacdc18f78bd 95020:4da572dc4992
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 ;; - prettify-state-info (file) OK 58 ;; - prettify-state-info (file) OK
59 ;; STATE-CHANGING FUNCTIONS 59 ;; STATE-CHANGING FUNCTIONS
60 ;; * create-repo () OK 60 ;; * create-repo () OK
61 ;; * register (files &optional rev comment) OK 61 ;; * register (files &optional rev comment) OK
62 ;; - init-revision (file) NOT NEEDED 62 ;; - init-revision (file) NOT NEEDED
63 ;; - responsible-p (file) OK 63 ;; - responsible-p (file) OK
64 ;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD 64 ;; - could-register (file) NOT NEEDED, DEFAULT IS GOOD
65 ;; - receive-file (file rev) NOT NEEDED 65 ;; - receive-file (file rev) NOT NEEDED
66 ;; - unregister (file) OK 66 ;; - unregister (file) OK
67 ;; * checkin (files rev comment) OK 67 ;; * checkin (files rev comment) OK
68 ;; * find-revision (file rev buffer) OK 68 ;; * find-revision (file rev buffer) OK
69 ;; * checkout (file &optional editable rev) OK 69 ;; * checkout (file &optional editable rev) OK
70 ;; * revert (file &optional contents-done) OK 70 ;; * revert (file &optional contents-done) OK
71 ;; - rollback (files) COULD BE SUPPORTED 71 ;; - rollback (files) COULD BE SUPPORTED
72 ;; - merge (file rev1 rev2) It would be possible to merge changes into 72 ;; - merge (file rev1 rev2) It would be possible to merge
73 ;; a single file, but when committing they 73 ;; changes into a single file, but when
74 ;; wouldn't be identified as a merge by git, 74 ;; committing they wouldn't
75 ;; so it's probably not a good idea. 75 ;; be identified as a merge
76 ;; - merge-news (file) see `merge' 76 ;; by git, so it's probably
77 ;; not a good idea.
78 ;; - merge-news (file) see `merge'
77 ;; - steal-lock (file &optional revision) NOT NEEDED 79 ;; - steal-lock (file &optional revision) NOT NEEDED
78 ;; HISTORY FUNCTIONS 80 ;; HISTORY FUNCTIONS
79 ;; * print-log (files &optional buffer) OK 81 ;; * print-log (files &optional buffer) OK
80 ;; - log-view-mode () OK 82 ;; - log-view-mode () OK
81 ;; - show-log-entry (revision) OK 83 ;; - show-log-entry (revision) OK
82 ;; - comment-history (file) ?? 84 ;; - comment-history (file) ??
83 ;; - update-changelog (files) COULD BE SUPPORTED 85 ;; - update-changelog (files) COULD BE SUPPORTED
84 ;; * diff (file &optional rev1 rev2 buffer) OK 86 ;; * diff (file &optional rev1 rev2 buffer) OK
85 ;; - revision-completion-table (files) OK 87 ;; - revision-completion-table (files) OK
86 ;; - annotate-command (file buf &optional rev) OK 88 ;; - annotate-command (file buf &optional rev) OK
87 ;; - annotate-time () OK 89 ;; - annotate-time () OK
88 ;; - annotate-current-time () NOT NEEDED 90 ;; - annotate-current-time () NOT NEEDED
89 ;; - annotate-extract-revision-at-line () OK 91 ;; - annotate-extract-revision-at-line () OK
90 ;; SNAPSHOT SYSTEM 92 ;; TAG SYSTEM
91 ;; - create-snapshot (dir name branchp) OK 93 ;; - create-tag (dir name branchp) OK
92 ;; - assign-name (file name) NOT NEEDED 94 ;; - retrieve-tag (dir name update) OK, needs to update buffers
93 ;; - retrieve-snapshot (dir name update) OK, needs to update buffers
94 ;; MISCELLANEOUS 95 ;; MISCELLANEOUS
95 ;; - make-version-backups-p (file) NOT NEEDED 96 ;; - make-version-backups-p (file) NOT NEEDED
96 ;; - repository-hostname (dirname) NOT NEEDED 97 ;; - repository-hostname (dirname) NOT NEEDED
97 ;; - previous-revision (file rev) OK 98 ;; - previous-revision (file rev) OK
98 ;; - next-revision (file rev) OK 99 ;; - next-revision (file rev) OK
99 ;; - check-headers () COULD BE SUPPORTED 100 ;; - check-headers () COULD BE SUPPORTED
100 ;; - clear-headers () NOT NEEDED 101 ;; - clear-headers () NOT NEEDED
101 ;; - delete-file (file) OK 102 ;; - delete-file (file) OK
102 ;; - rename-file (old new) OK 103 ;; - rename-file (old new) OK
103 ;; - find-file-hook () NOT NEEDED 104 ;; - find-file-hook () NOT NEEDED
104 ;; - find-file-not-found-hook () NOT NEEDED 105 ;; - find-file-not-found-hook () NOT NEEDED
105 106
106 (eval-when-compile 107 (eval-when-compile
107 (require 'cl) 108 (require 'cl)
108 (require 'vc) 109 (require 'vc)
109 (require 'grep)) 110 (require 'grep))
552 (save-excursion 553 (save-excursion
553 (move-beginning-of-line 1) 554 (move-beginning-of-line 1)
554 (and (looking-at "[0-9a-f^][0-9a-f]+") 555 (and (looking-at "[0-9a-f^][0-9a-f]+")
555 (buffer-substring-no-properties (match-beginning 0) (match-end 0))))) 556 (buffer-substring-no-properties (match-beginning 0) (match-end 0)))))
556 557
557 ;;; SNAPSHOT SYSTEM 558 ;;; TAG SYSTEM
558 559
559 (defun vc-git-create-snapshot (dir name branchp) 560 (defun vc-git-create-tag (dir name branchp)
560 (let ((default-directory dir)) 561 (let ((default-directory dir))
561 (and (vc-git-command nil 0 nil "update-index" "--refresh") 562 (and (vc-git-command nil 0 nil "update-index" "--refresh")
562 (if branchp 563 (if branchp
563 (vc-git-command nil 0 nil "checkout" "-b" name) 564 (vc-git-command nil 0 nil "checkout" "-b" name)
564 (vc-git-command nil 0 nil "tag" name))))) 565 (vc-git-command nil 0 nil "tag" name)))))
565 566
566 (defun vc-git-retrieve-snapshot (dir name update) 567 (defun vc-git-retrieve-tag (dir name update)
567 (let ((default-directory dir)) 568 (let ((default-directory dir))
568 (vc-git-command nil 0 nil "checkout" name) 569 (vc-git-command nil 0 nil "checkout" name)
569 ;; FIXME: update buffers if `update' is true 570 ;; FIXME: update buffers if `update' is true
570 )) 571 ))
571 572