[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [patch] fix vc-svn for Subversion r3396

From: Martin Pool <mbp_at_sourcefrog.net>
Date: 2002-12-01 04:11:38 CET

This amended patch handles the case of finding a new file in a
Subversion-controlled directory. In this case Subversion the file is
neither new nor edited, so svn status just gives a blank line.

Checking for exactly 40 spaces is a bit icky, but at the moment I
don't see an alternative that will work reliably.

Index: vc-svn.el
===================================================================
--- vc-svn.el (revision 3946)
+++ vc-svn.el (working copy)
@@ -130,12 +130,13 @@
     (cond
      ((not state) nil)
      ;; A newly added file has no revision.
- ((looking-at "\\S-+\\s-+\\(\\*\\s-+\\)?\\0\\s-+\\?")
+ ((looking-at "....\\s-+\\(\\*\\s-+\\)?\\0\\s-+\\?")
       (list state "0" nil))
- ((looking-at "\\S-+\\s-+\\(\\*\\s-+\\)?\\([0-9]+\\)\\s-+\\([0-9]+\\)")
+ ((looking-at "....\\s-+\\(\\*\\s-+\\)?\\([0-9]+\\)\\s-+\\([0-9]+\\)")
       (list state
             (match-string 2)
             (match-string 3)))
+ ((looking-at " \\{40\\}") nil) ;; A file that is not in the wc nor in svn?
      (t (error "Couldn't parse output from `svn status -v'")))))
 
 
@@ -154,12 +155,17 @@
    ;; user, but there is a more recent version
    ;; on the current branch stored in the
    ;; master file.
- ((looking-at "_[_ ]..\\s-+\\*") 'needs-patch)
+ ((looking-at " ..\\s-+\\*") 'needs-patch)
 
    ;; 'up-to-date The working file is unmodified with
    ;; respect to the latest version on the
    ;; current branch, and not locked.
- ((looking-at "_[_ ]") 'up-to-date)
+ ;;
+ ;; This is also returned for files which do not
+ ;; exist, as will be the case when finding a
+ ;; new file in a svn-controlled directory. That
+ ;; case is handled in vc-svn-parse-status
+ ((looking-at " ") 'up-to-date)
 
    ;; 'needs-merge The file has been edited by the user,
    ;; and there is also a more recent version

-- 
Martin
please cc me on replies
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Dec 1 04:15:20 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.