Mercurial > emacs
comparison lisp/vc-svn.el @ 50922:bdc62a6694f7
(vc-svn-rename-file): New fun.
(vc-svn-diff): Correctly check svn's return status.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 09 May 2003 14:13:40 +0000 |
parents | d853a98e1678 |
children | 6f478e2878c7 |
comparison
equal
deleted
inserted
replaced
50921:0c19fe613e38 | 50922:bdc62a6694f7 |
---|---|
288 ;; that the actual update will get the head of the trunk | 288 ;; that the actual update will get the head of the trunk |
289 (if (or (not rev) (string= rev "")) | 289 (if (or (not rev) (string= rev "")) |
290 "-A" | 290 "-A" |
291 (concat "-r" rev)) | 291 (concat "-r" rev)) |
292 switches))) | 292 switches))) |
293 | |
294 (defun vc-svn-rename-file (old new) | |
295 (vc-svn-command nil 0 new "move" (file-relative-name old))) | |
293 | 296 |
294 (defun vc-svn-revert (file &optional contents-done) | 297 (defun vc-svn-revert (file &optional contents-done) |
295 "Revert FILE to the version it was based on." | 298 "Revert FILE to the version it was based on." |
296 (unless contents-done | 299 (unless contents-done |
297 (vc-svn-command nil 0 file "revert")) | 300 (vc-svn-command nil 0 file "revert")) |
393 ;; Even if it's empty, it's locally modified. | 396 ;; Even if it's empty, it's locally modified. |
394 1) | 397 1) |
395 (let* ((switches (vc-switches 'SVN 'diff)) | 398 (let* ((switches (vc-switches 'SVN 'diff)) |
396 (async (and (vc-svn-stay-local-p file) | 399 (async (and (vc-svn-stay-local-p file) |
397 (or oldvers newvers) ; Svn diffs those locally. | 400 (or oldvers newvers) ; Svn diffs those locally. |
398 (fboundp 'start-process))) | 401 (fboundp 'start-process)))) |
399 (status | 402 (apply 'vc-svn-command "*vc-diff*" |
400 (apply 'vc-svn-command "*vc-diff*" | 403 (if async 'async 0) |
401 (if async 'async 1) | 404 file "diff" |
402 file "diff" | 405 (append |
403 (append | 406 (when switches |
404 (when switches | 407 (list "-x" (mapconcat 'identity switches " "))) |
405 (list "-x" (mapconcat 'identity switches " "))) | 408 (when oldvers |
406 (when oldvers | 409 (list "-r" (if newvers (concat oldvers ":" newvers) |
407 (list "-r" (if newvers (concat oldvers ":" newvers) | 410 oldvers))))) |
408 oldvers))))))) | |
409 (if async 1 ; async diff => pessimistic assumption | 411 (if async 1 ; async diff => pessimistic assumption |
410 ;; For some reason `svn diff' does not return a useful | 412 ;; For some reason `svn diff' does not return a useful |
411 ;; status w.r.t whether the diff was empty or not. | 413 ;; status w.r.t whether the diff was empty or not. |
412 (buffer-size (get-buffer "*vc-diff*")))))) | 414 (buffer-size (get-buffer "*vc-diff*")))))) |
413 | 415 |