diff options
| author | Stefan Monnier | 2007-06-28 02:01:54 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-06-28 02:01:54 +0000 |
| commit | 360cf7bc8899964e8699550eb3d755909f4af606 (patch) | |
| tree | 637741efcdf1402d0f474108062107c06eafa25b | |
| parent | 77676c1bd322ec1adfffb918daef9689989d8ed0 (diff) | |
| download | emacs-360cf7bc8899964e8699550eb3d755909f4af606.tar.gz emacs-360cf7bc8899964e8699550eb3d755909f4af606.zip | |
(vc-functions): Clear up the cache when reloading the file.
(vc-bzr-workfile-version, vc-bzr-could-register): Don't hardcode point-min == 1.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/vc-bzr.el | 20 |
2 files changed, 21 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c20c546db3c..e7b0dee39e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,13 @@ | |||
| 1 | 2007-06-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * vc-bzr.el (vc-functions): Clear up the cache when reloading the file. | ||
| 4 | (vc-bzr-workfile-version, vc-bzr-could-register): Don't hardcode | ||
| 5 | point-min == 1. | ||
| 6 | |||
| 1 | 2007-06-28 Nick Roberts <nickrob@snap.net.nz> | 7 | 2007-06-28 Nick Roberts <nickrob@snap.net.nz> |
| 2 | 8 | ||
| 3 | * pcvs-util.el (cvs-strings->string, cvs-string->strings): Rename | 9 | * pcvs-util.el (cvs-strings->string, cvs-string->strings): |
| 4 | and move to... | 10 | Rename and move to... |
| 5 | 11 | ||
| 6 | * subr.el (strings->string, string->strings): ...here. | 12 | * subr.el (strings->string, string->strings): ...here. |
| 7 | 13 | ||
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index b6a432970b0..23ce0d9c17a 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el | |||
| @@ -61,6 +61,10 @@ | |||
| 61 | (require 'cl) | 61 | (require 'cl) |
| 62 | (require 'vc)) ; for vc-exec-after | 62 | (require 'vc)) ; for vc-exec-after |
| 63 | 63 | ||
| 64 | ;; Clear up the cache to force vc-call to check again and discover | ||
| 65 | ;; new functions when we reload this file. | ||
| 66 | (put 'BZR 'vc-functions nil) | ||
| 67 | |||
| 64 | (defgroup vc-bzr nil | 68 | (defgroup vc-bzr nil |
| 65 | "VC bzr backend." | 69 | "VC bzr backend." |
| 66 | ;; :version "22" | 70 | ;; :version "22" |
| @@ -194,15 +198,15 @@ Return nil if there isn't one." | |||
| 194 | ;; the file to be up-to-date. | 198 | ;; the file to be up-to-date. |
| 195 | (goto-char (point-min)) | 199 | (goto-char (point-min)) |
| 196 | (when | 200 | (when |
| 197 | (re-search-forward | 201 | (re-search-forward |
| 198 | (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" | 202 | (concat "^\\(" vc-bzr-state-words "\\):[ \t\n]+" |
| 199 | (file-name-nondirectory file) "[ \t\n]*$") | 203 | (file-name-nondirectory file) "[ \t\n]*$") |
| 200 | (point-max) t) | 204 | (point-max) t) |
| 201 | (let ((start (match-beginning 0)) | 205 | (let ((start (match-beginning 0)) |
| 202 | (end (match-end 0))) | 206 | (end (match-end 0))) |
| 203 | (goto-char start) | 207 | (goto-char start) |
| 204 | (setq state | 208 | (setq state |
| 205 | (cond | 209 | (cond |
| 206 | ((not (equal ret 0)) nil) | 210 | ((not (equal ret 0)) nil) |
| 207 | ((looking-at "added\\|renamed\\|modified\\|removed") 'edited) | 211 | ((looking-at "added\\|renamed\\|modified\\|removed") 'edited) |
| 208 | ((looking-at "unknown\\|ignored") nil))) | 212 | ((looking-at "unknown\\|ignored") nil))) |
| @@ -216,7 +220,7 @@ Return nil if there isn't one." | |||
| 216 | ;; left in the buffer after removing the above status | 220 | ;; left in the buffer after removing the above status |
| 217 | ;; keywords, let us just presume that any other message from | 221 | ;; keywords, let us just presume that any other message from |
| 218 | ;; "bzr" is a user warning, and display it. | 222 | ;; "bzr" is a user warning, and display it. |
| 219 | (message "Warnings in `bzr' output: %s" | 223 | (message "Warnings in `bzr' output: %s" |
| 220 | (buffer-substring (point-min) (point-max)))) | 224 | (buffer-substring (point-min) (point-max)))) |
| 221 | (when state | 225 | (when state |
| 222 | (vc-file-setprop file 'vc-workfile-version | 226 | (vc-file-setprop file 'vc-workfile-version |
| @@ -228,10 +232,12 @@ Return nil if there isn't one." | |||
| 228 | (eq 'up-to-date (vc-bzr-state file))) | 232 | (eq 'up-to-date (vc-bzr-state file))) |
| 229 | 233 | ||
| 230 | (defun vc-bzr-workfile-version (file) | 234 | (defun vc-bzr-workfile-version (file) |
| 235 | ;; Looks like this could be obtained via counting lines in | ||
| 236 | ;; .bzr/branch/revision-history. | ||
| 231 | (with-temp-buffer | 237 | (with-temp-buffer |
| 232 | (vc-bzr-command "revno" t 0 file) | 238 | (vc-bzr-command "revno" t 0 file) |
| 233 | (goto-char 1) | 239 | (goto-char (point-min)) |
| 234 | (buffer-substring 1 (line-end-position)))) | 240 | (buffer-substring (point) (line-end-position)))) |
| 235 | 241 | ||
| 236 | (defun vc-bzr-checkout-model (file) | 242 | (defun vc-bzr-checkout-model (file) |
| 237 | 'implicit) | 243 | 'implicit) |
| @@ -258,7 +264,7 @@ or a superior directory.") | |||
| 258 | (vc-bzr-command "add" t 0 file "--dry-run") | 264 | (vc-bzr-command "add" t 0 file "--dry-run") |
| 259 | ;; The command succeeds with no output if file is | 265 | ;; The command succeeds with no output if file is |
| 260 | ;; registered (in bzr 0.8). | 266 | ;; registered (in bzr 0.8). |
| 261 | (goto-char 1) | 267 | (goto-char (point-min)) |
| 262 | (looking-at "added ")) | 268 | (looking-at "added ")) |
| 263 | (error)))) | 269 | (error)))) |
| 264 | 270 | ||