aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2016-04-24 14:59:05 +0200
committerMichael Albinus2016-04-24 14:59:05 +0200
commit5cb7620027f78a3a0f473972a0584c8ea1791398 (patch)
tree1571c0f33ee69290d52d9fe48bf140e97781c27a /lisp
parentb876ee8971a8a040e14251f9733e4209ef7ad637 (diff)
downloademacs-5cb7620027f78a3a0f473972a0584c8ea1791398.tar.gz
emacs-5cb7620027f78a3a0f473972a0584c8ea1791398.zip
Some improvements in vc
* lisp/vc/vc-hooks.el (vc-state, vc-working-revision): Check, whether FILE is registered. * lisp/vc/vc-rcs.el (vc-rcs-checkout-model): Return `locking' for nonexistent files. * test/lisp/vc/vc-tests.el (w32-application-type): Declare. (vc-test--revision-granularity-function) (vc-test--unregister-function): Use `vc-call-backend'. (vc-test--run-maybe-unsupported-function): New defmacro. (vc-test--register, vc-test--state, vc-test--working-revision) (vc-test--checkout-model): Use it. Fix also expected results. (vc-test-src02-state, vc-test-rcs04-checkout-model): They pass now.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/vc/vc-hooks.el15
-rw-r--r--lisp/vc/vc-rcs.el4
2 files changed, 12 insertions, 7 deletions
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 4c0161d7978..0535565db28 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -475,10 +475,11 @@ status of this file. Otherwise, the value returned is one of:
475 ;; FIXME: New (sub)states needed (?): 475 ;; FIXME: New (sub)states needed (?):
476 ;; - `copied' and `moved' (might be handled by `removed' and `added') 476 ;; - `copied' and `moved' (might be handled by `removed' and `added')
477 (or (vc-file-getprop file 'vc-state) 477 (or (vc-file-getprop file 'vc-state)
478 (and (not (vc-registered file)) 'unregistered)
478 (when (> (length file) 0) ;Why?? --Stef 479 (when (> (length file) 0) ;Why?? --Stef
479 (setq backend (or backend (vc-responsible-backend file))) 480 (setq backend (or backend (vc-responsible-backend file)))
480 (when backend 481 (when backend
481 (vc-state-refresh file backend))))) 482 (vc-state-refresh file backend)))))
482 483
483(defun vc-state-refresh (file backend) 484(defun vc-state-refresh (file backend)
484 "Quickly recompute the `state' of FILE." 485 "Quickly recompute the `state' of FILE."
@@ -494,11 +495,13 @@ status of this file. Otherwise, the value returned is one of:
494 "Return the repository version from which FILE was checked out. 495 "Return the repository version from which FILE was checked out.
495If FILE is not registered, this function always returns nil." 496If FILE is not registered, this function always returns nil."
496 (or (vc-file-getprop file 'vc-working-revision) 497 (or (vc-file-getprop file 'vc-working-revision)
497 (progn 498 (and (vc-registered file)
498 (setq backend (or backend (vc-responsible-backend file))) 499 (progn
499 (when backend 500 (setq backend (or backend (vc-responsible-backend file)))
500 (vc-file-setprop file 'vc-working-revision 501 (when backend
501 (vc-call-backend backend 'working-revision file)))))) 502 (vc-file-setprop file 'vc-working-revision
503 (vc-call-backend
504 backend 'working-revision file)))))))
502 505
503;; Backward compatibility. 506;; Backward compatibility.
504(define-obsolete-function-alias 507(define-obsolete-function-alias
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index 8d58611cb5b..b972956b109 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -120,7 +120,9 @@ For a description of possible values, see `vc-check-master-templates'."
120 (setq result (vc-file-getprop file 'vc-checkout-model))) 120 (setq result (vc-file-getprop file 'vc-checkout-model)))
121 (or result 121 (or result
122 (progn (vc-rcs-fetch-master-state file) 122 (progn (vc-rcs-fetch-master-state file)
123 (vc-file-getprop file 'vc-checkout-model))))) 123 (vc-file-getprop file 'vc-checkout-model))
124 ;; For non-existing files we assume strict locking.
125 'locking)))
124 126
125;;; 127;;;
126;;; State-querying functions 128;;; State-querying functions