From: Glenn Morris <rgm@gnu.org>
To: 1046@emacsbugs.donarmstrong.com
Cc: Nick Roberts <nickrob@gnu.org>
Subject: bug#1046: 23.0.60; vc-dir with Subversion
Date: Wed, 01 Oct 2008 19:03:01 -0400 [thread overview]
Message-ID: <pgwsgrex5m.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <uhprmkepug.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed, 01 Oct 2008 03:28:39 -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."
next prev parent reply other threads:[~2008-10-01 23:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-28 7:33 bug#1046: 23.0.60; vc-dir with Subversion Nick Roberts
2008-10-01 7:28 ` Glenn Morris
2008-10-01 16:05 ` Glenn Morris
2008-10-01 23:03 ` Glenn Morris [this message]
2008-10-04 8:53 ` Nick Roberts
2008-10-04 19:54 ` Glenn Morris
2008-10-06 14:18 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pgwsgrex5m.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=1046@emacsbugs.donarmstrong.com \
--cc=nickrob@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).