comparison lisp/vc-svn.el @ 101669:7f3372c8c319

(vc-svn-dir-status): Correct logic for remote connection. (vc-svn-diff): Use old version number even when it is the working revision. This is needed, e.g, in the vc-print-log buffer.
author Nick Roberts <nickrob@snap.net.nz>
date Fri, 30 Jan 2009 08:16:26 +0000
parents 929f3ad94b86
children 6bc8fe0c390a
comparison
equal deleted inserted replaced
101668:1862311ef4a1 101669:7f3372c8c319
184 "Run 'svn status' for DIR and update BUFFER via CALLBACK. 184 "Run 'svn status' for DIR and update BUFFER via CALLBACK.
185 CALLBACK is called as (CALLBACK RESULT BUFFER), where 185 CALLBACK is called as (CALLBACK RESULT BUFFER), where
186 RESULT is a list of conses (FILE . STATE) for directory DIR." 186 RESULT is a list of conses (FILE . STATE) for directory DIR."
187 ;; FIXME should this rather be all the files in dir? 187 ;; FIXME should this rather be all the files in dir?
188 (let* ((local (vc-stay-local-p dir)) 188 (let* ((local (vc-stay-local-p dir))
189 (remote (and local (not (eq local 'only-file))))) 189 (remote (or (not local) (eq local 'only-file))))
190 (vc-svn-command (current-buffer) 'async nil "status" 190 (vc-svn-command (current-buffer) 'async nil "status"
191 (if remote "-u")) 191 (if remote "-u"))
192 (vc-exec-after 192 (vc-exec-after
193 `(vc-svn-after-dir-status (quote ,callback) ,remote)))) 193 `(vc-svn-after-dir-status (quote ,callback) ,remote))))
194 194
477 ;; Dump log for the entire directory. 477 ;; Dump log for the entire directory.
478 (vc-svn-command buffer 0 nil "log" "-rHEAD:0"))))) 478 (vc-svn-command buffer 0 nil "log" "-rHEAD:0")))))
479 479
480 (defun vc-svn-diff (files &optional oldvers newvers buffer) 480 (defun vc-svn-diff (files &optional oldvers newvers buffer)
481 "Get a difference report using SVN between two revisions of fileset FILES." 481 "Get a difference report using SVN between two revisions of fileset FILES."
482 (and oldvers
483 files
484 (catch 'no
485 (dolist (f files)
486 (or (equal oldvers (vc-working-revision f))
487 (throw 'no nil)))
488 t)
489 ;; Use nil rather than the current revision because svn handles
490 ;; it better (i.e. locally). Note that if _any_ of the files
491 ;; has a different revision, we fetch the lot, which is
492 ;; obviously sub-optimal.
493 (setq oldvers nil))
494 (let* ((switches 482 (let* ((switches
495 (if vc-svn-diff-switches 483 (if vc-svn-diff-switches
496 (vc-switches 'SVN 'diff) 484 (vc-switches 'SVN 'diff)
497 (list "--diff-cmd=diff" "-x" 485 (list "--diff-cmd=diff" "-x"
498 (mapconcat 'identity (vc-switches nil 'diff) " ")))) 486 (mapconcat 'identity (vc-switches nil 'diff) " "))))