From: Glenn Morris <rgm@gnu.org>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: 1046@emacsbugs.donarmstrong.com
Subject: bug#1046: 23.0.60; vc-dir with Subversion
Date: Wed, 01 Oct 2008 03:28:39 -0400 [thread overview]
Message-ID: <uhprmkepug.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <18655.13103.295021.779321@kahikatea.snap.net.nz> (Nick Roberts's message of "Sun, 28 Sep 2008 19:33:03 +1200")
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?
> I now see that with SVN, vc-dir also ignores vc-stay-local but this time
> never consults the repository.
>
> I'm not sure if it worked with vc-directory, but for this function, the
> command "svn log -u" was used when vc-stay-local was nil. In Emacs 23.0.60
> it always just sends "svn log"
You meant "svn status", not "log". Anyway, here is an attempt at a
simple-minded patch.
*** vc-svn.el.~1.96.~ 2008-09-09 19:28:20.000000000 -0700
--- vc-svn.el 2008-10-01 00:26:48.000000000 -0700
***************
*** 146,152 ****
"SVN-specific state heuristic."
(vc-svn-state file 'local))
! (defun vc-svn-after-dir-status (callback)
(let ((state-map '((?A . added)
(?C . conflict)
(?D . removed)
--- 146,152 ----
"SVN-specific state heuristic."
(vc-svn-state file 'local))
! (defun vc-svn-after-dir-status (callback &optional remote)
(let ((state-map '((?A . added)
(?C . conflict)
(?D . removed)
***************
*** 156,166 ****
(?? . unregistered)
;; This is what vc-svn-parse-status does.
(?~ . edited)))
result)
(goto-char (point-min))
! (while (re-search-forward "^\\(.\\)..... \\(.*\\)$" nil t)
! (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
! (filename (match-string 2)))
(when state
(setq result (cons (list filename state) result)))))
(funcall callback result)))
--- 156,170 ----
(?? . unregistered)
;; This is what vc-svn-parse-status does.
(?~ . edited)))
+ (re (if remote "^\\(.\\)..... \\([ *]\\) +[-0-9]+ +\\(.*\\)$"
+ "^\\(.\\)....\\(.\\) \\(.*\\)$"))
result)
(goto-char (point-min))
! (while (re-search-forward re nil t)
! (let ((state (or (cdr (assq (aref (match-string 1) 0) state-map))
! (and remote (string-equal (match-string 2) "*")
! 'needs-merge)))
! (filename (match-string 3)))
(when state
(setq result (cons (list filename state) result)))))
(funcall callback result)))
***************
*** 169,177 ****
"Run 'svn status' for DIR and update BUFFER via CALLBACK.
CALLBACK is called as (CALLBACK RESULT BUFFER), where
RESULT is a list of conses (FILE . STATE) for directory DIR."
! (vc-svn-command (current-buffer) 'async nil "status")
(vc-exec-after
! `(vc-svn-after-dir-status (quote ,callback))))
(defun vc-svn-status-extra-headers (dir)
"Generate extra status headers for a Subversion working copy."
--- 173,184 ----
"Run 'svn status' for DIR and update BUFFER via CALLBACK.
CALLBACK is called as (CALLBACK RESULT BUFFER), where
RESULT is a list of conses (FILE . STATE) for directory DIR."
! ;; FIXME should this rather be all the files in dir?
! (let ((remote (not (vc-stay-local-p dir))))
! (vc-svn-command (current-buffer) 'async nil "status"
! (if remote "-u"))
(vc-exec-after
! `(vc-svn-after-dir-status (quote ,callback) ,remote))))
(defun vc-svn-status-extra-headers (dir)
"Generate extra status headers for a Subversion working copy."
next prev parent reply other threads:[~2008-10-01 7:28 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 [this message]
2008-10-01 16:05 ` Glenn Morris
2008-10-01 23:03 ` Glenn Morris
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=uhprmkepug.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=1046@emacsbugs.donarmstrong.com \
--cc=nickrob@snap.net.nz \
/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).