emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introducing 'unrecognized and 'ignored


From: Tom Tromey
Subject: Re: Introducing 'unrecognized and 'ignored
Date: Sun, 06 Jan 2008 13:00:33 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (gnu/linux)

>>>>> "Dan" == Dan Nicolaescu <address@hidden> writes:

Dan> I checked in some code to do that. I whipped it out quickly, so it's not
Dan> complete in any way. It provides a M-x vc-status command which is the
Dan> replacement for vc-dired. 

Dan> It can only be used with Mercurial for now.

Appended is a patch to make it work with svn.  This patch is kind of a
hack in that, if vc-status ever wants to support "non-terse" mode,
then the function will have to be rewritten (since "svn status" and
"svn status -v" have different formats).

I don't understand how the 'dir' argument works with the existing
vc-hg-dir-status.  The argument is never used in the function.  When I
tried vc-status on a mercurial working directory, I got results for
the whole tree, not the particular subdirectory I requested, which is
also weird.

The resulting buffer is always called *vc-status*, which is
unfriendly.  Perhaps it should be named after the requested directory.

I think it would be best to make vc-status work asynchronously from the
very beginning.  That is what pcl-cvs and psvn do, and it is nicer to
use on larger trees.  I think this is important to do first because it
is simpler to redesign the back end hooks now, if needed.

Tom

2008-01-06  Tom Tromey  <address@hidden>

        * vc-svn.el (vc-svn-dir-status): New function.

*** vc-svn.el   02 Jan 2008 12:34:31 -0700      1.59
--- vc-svn.el   06 Jan 2008 12:39:14 -0700      
***************
*** 1,6 ****
  ;;; vc-svn.el --- non-resident support for Subversion version-control
  
! ;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
  
  ;; Author:      FSF (see vc.el for full credits)
  ;; Maintainer:  Stefan Monnier <address@hidden>
--- 1,6 ----
  ;;; vc-svn.el --- non-resident support for Subversion version-control
  
! ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, 
Inc.
  
  ;; Author:      FSF (see vc.el for full credits)
  ;; Maintainer:  Stefan Monnier <address@hidden>
***************
*** 157,162 ****
--- 157,185 ----
        (vc-svn-command t 0 nil "status" (if localp "-v" "-u"))
        (vc-svn-parse-status))))
  
+ (defun vc-svn-dir-status (dir)
+   "Return a list of conses (FILE . STATE) for DIR."
+   (with-temp-buffer
+     (let ((default-directory (file-name-as-directory dir))
+         (state-map '((?A . added)
+                      (?C . edited)
+                      (?D . removed)
+                      (?I . ignored)
+                      (?M . edited)
+                      (?R . removed)
+                      (?? . unregistered)
+                      ;; This is what vc-svn-parse-status does.
+                      (?~ . edited)))
+         result)
+       (vc-svn-command t 0 nil "status")
+       (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 (cons filename state) result)))))
+       result)))
+ 
  (defun vc-svn-working-revision (file)
    "SVN-specific version of `vc-working-revision'."
    ;; There is no need to consult RCS headers under SVN, because we




reply via email to

[Prev in Thread] Current Thread [Next in Thread]