GNU bug report logs - #1046
23.0.60; vc-dir with Subversion

Previous Next

Package: emacs;

Reported by: Nick Roberts <nickrob <at> snap.net.nz>

Date: Sun, 28 Sep 2008 07:40:03 UTC

Severity: normal

Tags: patch

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: 1046 <at> debbugs.gnu.org
Cc: Nick Roberts <nickrob <at> gnu.org>
Subject: bug#1046: 23.0.60; vc-dir with Subversion
Date: Wed, 01 Oct 2008 19:03:01 -0400
Glenn Morris wrote:

> Nick Roberts wrote:
>
>> In the past I've remarked that with CVS vc-dir ignores vc-stay-local (and
>> vc-cvs-stay-local) and consults the repository, in any case.
>
> Can you file a separate bug for that please, if it still applies?

Never mind. For a limited time only, your initial bug report entitles
you to one complimentary patch for a second issue.


*** vc-cvs.el	7 Sep 2008 20:24:27 -0000	1.148
--- vc-cvs.el	1 Oct 2008 23:02:15 -0000
***************
*** 905,912 ****
--- 905,943 ----
    ;;   (funcall update-function result)))
    )
  
+ ;; Based on vc-cvs-dir-state-heuristic.
+ (defun vc-cvs-dir-status-heuristic (dir update-function &optional basedir)
+   "Find the CVS state of all files in DIR, using only local information."
+   (let (file basename status result dirlist)
+     (with-temp-buffer
+       (vc-cvs-get-entries dir)
+       (goto-char (point-min))
+       (while (not (eobp))
+         (if (looking-at "D/\\([^/]*\\)////")
+             (push (expand-file-name (match-string 1) dir) dirlist)
+           ;; CVS-removed files are not taken under VC control.
+           (when (looking-at "/\\([^/]*\\)/[^/-]")
+             (setq basename (match-string 1)
+                   file (expand-file-name basename dir)
+                   status (or (vc-file-getprop file 'vc-state)
+                              (vc-cvs-parse-entry file t)))
+             (unless (eq status 'up-to-date)
+               (push (list (if basedir
+                               (file-relative-name file basedir)
+                             basename)
+                           status) result))))
+         (forward-line 1)))
+     (dolist (subdir dirlist)
+       (setq result (append result
+                            (vc-cvs-dir-status-heuristic subdir nil dir))))
+     (if basedir result
+       (funcall update-function result))))
+ 
  (defun vc-cvs-dir-status (dir update-function)
    "Create a list of conses (file . state) for DIR."
+   ;; FIXME check all files in DIR instead?
+   (if (vc-stay-local-p dir)
+       (vc-cvs-dir-status-heuristic dir update-function)
      (vc-cvs-command (current-buffer) 'async dir "-f" "status")
      ;; Alternative implementation: use the "update" command instead of
      ;; the "status" command.
***************
*** 914,920 ****
    ;; 		  (file-relative-name dir)
    ;; 		  "-f" "-n" "update" "-d" "-P")
    (vc-exec-after
!    `(vc-cvs-after-dir-status (quote ,update-function))))
  
  (defun vc-cvs-file-to-string (file)
    "Read the content of FILE and return it as a string."
--- 945,951 ----
      ;; 		  (file-relative-name dir)
      ;; 		  "-f" "-n" "update" "-d" "-P")
      (vc-exec-after
!      `(vc-cvs-after-dir-status (quote ,update-function)))))
  
  (defun vc-cvs-file-to-string (file)
    "Read the content of FILE and return it as a string."




This bug report was last modified 16 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.