Mercurial > emacs
changeset 94521:2a61c5f918a5
Change 'needs-patch to 'needs-update.
author | Eric S. Raymond <esr@snark.thyrsus.com> |
---|---|
date | Thu, 01 May 2008 19:13:16 +0000 |
parents | 069edac43148 |
children | a69dcc2c42ae |
files | lisp/ChangeLog lisp/vc-arch.el lisp/vc-bzr.el lisp/vc-cvs.el lisp/vc-git.el lisp/vc-hooks.el lisp/vc-mtn.el lisp/vc-rcs.el lisp/vc-sccs.el lisp/vc-svn.el lisp/vc.el |
diffstat | 11 files changed, 82 insertions(+), 68 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Thu May 01 17:46:27 2008 +0000 +++ b/lisp/ChangeLog Thu May 01 19:13:16 2008 +0000 @@ -1,3 +1,19 @@ +2008-05-01 Eric S. Raymond <esr@snark.thyrsus.com> + + * vc-bzr.el (vc-bzr-state): Allow this to return 'ignored + when appropriate. + * vc-sccs.el (vc-sccs-state): Call vc-sccs-unregistered so + we report the 'unregistered state reliably. + * vc-rcs.el (vc-rcs-state): Call vc-rcs-unregistered so + we report the 'unregistered state reliably. + * vc-git.el (vc-git-state): Call vc-git-unregistered so + we report the 'unregistered state reliably. + * vc-hooks (vc-state): Document that vc-unregistered is + now expected to be returned reliably. + * vc.el (vc-default-dired-state): Change needs-patch state to + needs-update, since the name now shows up in dir-status listings + and was somewhat misleading. + 2008-05-01 Sam Steingold <sds@gnu.org> * vc.el (vc-delete-file): Check if the file has uncommitted changed.
--- a/lisp/vc-arch.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-arch.el Thu May 01 19:13:16 2008 +0000 @@ -329,7 +329,7 @@ (setq rev (replace-match (cdr rule) t nil rev)))) (format "Arch%c%s" (case (vc-state file) - ((up-to-date needs-patch) ?-) + ((up-to-date needs-update) ?-) (added ?@) (t ?:)) rev)))
--- a/lisp/vc-bzr.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-bzr.el Thu May 01 19:13:16 2008 +0000 @@ -275,7 +275,7 @@ (renamed . edited) (modified . edited) (removed . removed) - (ignored . unregistered) + (ignored . ignored) (unknown . unregistered) (unchanged . up-to-date)))))))
--- a/lisp/vc-cvs.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-cvs.el Thu May 01 19:13:16 2008 +0000 @@ -838,7 +838,7 @@ ((string-match "Locally Modified" status) 'edited) ((string-match "Needs Merge" status) 'needs-merge) ((string-match "Needs \\(Checkout\\|Patch\\)" status) - (if missing 'missing 'needs-patch)) + (if missing 'missing 'needs-update)) ((string-match "Locally Added" status) 'added) ((string-match "Locally Removed" status) 'removed) ((string-match "File had conflicts " status) 'conflict) @@ -903,7 +903,7 @@ ((string-match "Locally Modified" status-str) 'edited) ((string-match "Needs Merge" status-str) 'needs-merge) ((string-match "Needs \\(Checkout\\|Patch\\)" status-str) - (if missing 'missing 'needs-patch)) + (if missing 'missing 'needs-update)) ((string-match "Locally Added" status-str) 'added) ((string-match "Locally Removed" status-str) 'removed) ((string-match "File had conflicts " status-str) 'conflict) @@ -922,7 +922,7 @@ ;; (?M . edited) ;; (?P . needs-merge) ;; (?R . removed) - ;; (?U . needs-patch)))) + ;; (?U . needs-update)))) ;; (goto-char (point-min)) ;; (while (not (eobp)) ;; (if (looking-at "^[ACMPRU?] \\(.*\\)$")
--- a/lisp/vc-git.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-git.el Thu May 01 19:13:16 2008 +0000 @@ -156,12 +156,14 @@ (defun vc-git-state (file) "Git-specific version of `vc-state'." ;; FIXME: This can't set 'ignored yet - (vc-git--call nil "add" "--refresh" "--" (file-relative-name file)) - (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--"))) - (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0" - diff)) - (vc-git--state-code (match-string 1 diff)) - (if (vc-git--empty-db-p) 'added 'up-to-date)))) + (if (not (vc-git-registered file)) + 'unregistered + (vc-git--call nil "add" "--refresh" "--" (file-relative-name file)) + (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--"))) + (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0" + diff)) + (vc-git--state-code (match-string 1 diff)) + (if (vc-git--empty-db-p) 'added 'up-to-date))))) (defun vc-git--ls-files-state (state &rest args) "Set state to STATE on all files found with git-ls-files ARGS."
--- a/lisp/vc-hooks.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-hooks.el Thu May 01 19:13:16 2008 +0000 @@ -491,7 +491,7 @@ USER The current version of the working file is locked by some other USER (a string). - 'needs-patch The file has not been edited by the user, but there is + 'needs-update The file has not been edited by the user, but there is a more recent version on the current branch stored in the master file. @@ -528,12 +528,7 @@ that any file with vc-state nil might be ignorable without VC knowing it. - 'unregistered The file showed up in a dir-state listing with a flag - indicating that it is not under version control. - Note: This property is not set reliably (some VCSes - don't have useful directory-status commands) so assume - that any file with vc-state nil might be unregistered - without VC knowing it. + 'unregistered The file is not under version control. A return of nil from this function means we have no information on the status of this file. @@ -856,7 +851,7 @@ (rev (vc-working-revision file))) (propertize (cond ((or (eq state 'up-to-date) - (eq state 'needs-patch)) + (eq state 'needs-update)) (setq state-echo "Up to date file") (concat backend "-" rev)) ((stringp state) @@ -877,7 +872,7 @@ (t ;; Not just for the 'edited state, but also a fallback ;; for all other states. Think about different symbols - ;; for 'needs-patch and 'needs-merge. + ;; for 'needs-update and 'needs-merge. (setq state-echo "Locally modified file") (concat backend ":" rev))) 'help-echo (concat state-echo " under the " backend
--- a/lisp/vc-mtn.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-mtn.el Thu May 01 19:13:16 2008 +0000 @@ -125,7 +125,7 @@ (setq branch (replace-match (cdr rule) t nil branch)))) (format "Mtn%c%s" (case (vc-state file) - ((up-to-date needs-patch) ?-) + ((up-to-date needs-update) ?-) (added ?@) (t ?:)) branch)))
--- a/lisp/vc-rcs.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-rcs.el Thu May 01 19:13:16 2008 +0000 @@ -118,23 +118,25 @@ (defun vc-rcs-state (file) "Implementation of `vc-state' for RCS." - (or (boundp 'vc-rcs-headers-result) - (and vc-consult-headers - (vc-rcs-consult-headers file))) - (let ((state - ;; vc-working-revision might not be known; in that case the - ;; property is nil. vc-rcs-fetch-master-state knows how to - ;; handle that. - (vc-rcs-fetch-master-state file - (vc-file-getprop file - 'vc-working-revision)))) - (if (not (eq state 'up-to-date)) - state - (if (vc-workfile-unchanged-p file) - 'up-to-date - (if (eq (vc-rcs-checkout-model file) 'locking) - 'unlocked-changes - 'edited))))) + (if (not (vc-rc-registered f)) + 'unregistered + (or (boundp 'vc-rcs-headers-result) + (and vc-consult-headers + (vc-rcs-consult-headers file))) + (let ((state + ;; vc-working-revision might not be known; in that case the + ;; property is nil. vc-rcs-fetch-master-state knows how to + ;; handle that. + (vc-rcs-fetch-master-state file + (vc-file-getprop file + 'vc-working-revision)))) + (if (not (eq state 'up-to-date)) + state + (if (vc-workfile-unchanged-p file) + 'up-to-date + (if (eq (vc-rcs-checkout-model file) 'locking) + 'unlocked-changes + 'edited)))))) (defun vc-rcs-state-heuristic (file) "State heuristic for RCS." @@ -889,7 +891,7 @@ ;; workfile version is latest on branch 'up-to-date ;; workfile version is not latest on branch - 'needs-patch)) + 'needs-update)) ;; locked by the calling user ((and (stringp locking-user) (string= locking-user (vc-user-login-name file)))
--- a/lisp/vc-sccs.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-sccs.el Thu May 01 19:13:16 2008 +0000 @@ -117,19 +117,21 @@ (defun vc-sccs-state (file) "SCCS-specific function to compute the version control state." - (with-temp-buffer - (if (vc-insert-file (vc-sccs-lock-file file)) - (let* ((locks (vc-sccs-parse-locks)) - (working-revision (vc-working-revision file)) - (locking-user (cdr (assoc working-revision locks)))) - (if (not locking-user) - (if (vc-workfile-unchanged-p file) - 'up-to-date - 'unlocked-changes) - (if (string= locking-user (vc-user-login-name file)) - 'edited - locking-user))) - 'up-to-date))) + (if (not (vc-sccs-registered file)) + 'unregistered + (with-temp-buffer + (if (vc-insert-file (vc-sccs-lock-file file)) + (let* ((locks (vc-sccs-parse-locks)) + (working-revision (vc-working-revision file)) + (locking-user (cdr (assoc working-revision locks)))) + (if (not locking-user) + (if (vc-workfile-unchanged-p file) + 'up-to-date + 'unlocked-changes) + (if (string= locking-user (vc-user-login-name file)) + 'edited + locking-user))) + 'up-to-date)))) (defun vc-sccs-state-heuristic (file) "SCCS-specific state heuristic."
--- a/lisp/vc-svn.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc-svn.el Thu May 01 19:13:16 2008 +0000 @@ -625,7 +625,7 @@ (cond ((eq status ?\ ) (if (eq (char-after (match-beginning 1)) ?*) - 'needs-patch + 'needs-update (vc-file-setprop file 'vc-checkout-time (nth 5 (file-attributes file))) 'up-to-date))
--- a/lisp/vc.el Thu May 01 17:46:27 2008 +0000 +++ b/lisp/vc.el Thu May 01 19:13:16 2008 +0000 @@ -148,7 +148,8 @@ ;; possible values, see `vc-state'. This function should do a full and ;; reliable state computation; it is usually called immediately after ;; C-x v v. If you want to use a faster heuristic when visiting a -;; file, put that into `state-heuristic' below. +;; file, put that into `state-heuristic' below. Note that under most +;; VCSes this won't be called at all, dir-state or dir-stus is used instead. ;; ;; - state-heuristic (file) ;; @@ -618,12 +619,6 @@ ;; - make it easier to write logs. Maybe C-x 4 a should add to the log ;; buffer, if one is present, instead of adding to the ChangeLog. ;; -;; - make vc-state for all backends return 'unregistered instead of -;; nil for unregistered files, then update vc-next-action. -;; -;; - vc-default-registered should return 'unregistered not nil for -;; unregistered files. -;; ;; - vc-register should register a fileset at a time. The backends ;; already support this, only the front-end needs to be changed to ;; handle multiple files at a time. @@ -1661,12 +1656,11 @@ ;; Do the right thing (cond ;; Files aren't registered - ((or (not state) ;; RCS uses nil for unregistered files. - (eq state 'unregistered) + ((or (eq state 'unregistered) (eq state 'ignored)) (mapc 'vc-register files)) ;; Files are up-to-date, or need a merge and user specified a revision - ((or (eq state 'up-to-date) (and verbose (eq state 'needs-patch))) + ((or (eq state 'up-to-date) (and verbose (eq state 'needs-update))) (cond (verbose ;; go to a different revision @@ -1745,8 +1739,8 @@ ;; conflict ((eq state 'conflict) (vc-mark-resolved files)) - ;; needs-patch - ((eq state 'needs-patch) + ;; needs-update + ((eq state 'needs-update) (dolist (file files) (if (yes-or-no-p (format "%s is not up-to-date. Get latest revision? " @@ -1789,7 +1783,10 @@ "Revert to checked-in revision, instead? ")) (error "Checkout aborted") (vc-revert-buffer-internal t t) - (vc-checkout file t)))))))) + (vc-checkout file t))))) + ;; Unknown fileset state + (t + (error "Fileset is in an unknown state %s" state))))) (defun vc-create-repo (backend) "Create an empty repository in the current directory." @@ -1974,7 +1971,7 @@ (not writable)) (if (vc-call latest-on-branch-p file) 'up-to-date - 'needs-patch) + 'needs-update) 'edited)) (vc-checkout-time . ,(nth 5 (file-attributes file)))))) (vc-resynch-buffer file t t) @@ -4277,7 +4274,7 @@ ((stringp state) (concat "(" state ")")) ((eq state 'edited) "(modified)") ((eq state 'needs-merge) "(merge)") - ((eq state 'needs-patch) "(patch)") + ((eq state 'needs-update) "(update)") ((eq state 'added) "(added)") ((eq state 'removed) "(removed)") ((eq state 'ignored) "(ignored)") ;; dired-hook filters this out