+2007-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * vc-bzr.el (vc-functions): Clear up the cache when reloading the file.
+ (vc-bzr-workfile-version, vc-bzr-could-register): Don't hardcode
+ point-min == 1.
+
2007-06-28 Nick Roberts <nickrob@snap.net.nz>
- * pcvs-util.el (cvs-strings->string, cvs-string->strings): Rename
- and move to...
+ * pcvs-util.el (cvs-strings->string, cvs-string->strings):
+ Rename and move to...
* subr.el (strings->string, string->strings): ...here.
(require 'cl)
(require 'vc)) ; for vc-exec-after
+;; Clear up the cache to force vc-call to check again and discover
+;; new functions when we reload this file.
+(put 'BZR 'vc-functions nil)
+
(defgroup vc-bzr nil
"VC bzr backend."
;; :version "22"
;; the file to be up-to-date.
(goto-char (point-min))
(when
- (re-search-forward
- (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+"
+ (re-search-forward
+ (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+"
(file-name-nondirectory file) "[ \t\n]*$")
(point-max) t)
(let ((start (match-beginning 0))
(end (match-end 0)))
(goto-char start)
(setq state
- (cond
+ (cond
((not (equal ret 0)) nil)
((looking-at "added\\|renamed\\|modified\\|removed") 'edited)
((looking-at "unknown\\|ignored") nil)))
;; left in the buffer after removing the above status
;; keywords, let us just presume that any other message from
;; "bzr" is a user warning, and display it.
- (message "Warnings in `bzr' output: %s"
+ (message "Warnings in `bzr' output: %s"
(buffer-substring (point-min) (point-max))))
(when state
(vc-file-setprop file 'vc-workfile-version
(eq 'up-to-date (vc-bzr-state file)))
(defun vc-bzr-workfile-version (file)
+ ;; Looks like this could be obtained via counting lines in
+ ;; .bzr/branch/revision-history.
(with-temp-buffer
(vc-bzr-command "revno" t 0 file)
- (goto-char 1)
- (buffer-substring 1 (line-end-position))))
+ (goto-char (point-min))
+ (buffer-substring (point) (line-end-position))))
(defun vc-bzr-checkout-model (file)
'implicit)
(vc-bzr-command "add" t 0 file "--dry-run")
;; The command succeeds with no output if file is
;; registered (in bzr 0.8).
- (goto-char 1)
+ (goto-char (point-min))
(looking-at "added "))
(error))))