unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* vc-svn.el and "the underscore hack"
@ 2006-10-16 13:20 AriT93
  0 siblings, 0 replies; 2+ messages in thread
From: AriT93 @ 2006-10-16 13:20 UTC (permalink / raw


This change may be trivial to others but as my elisp is not that
strong I though I would submit this.  On the windows platform
subversion can be configured to create it's directories as "_svn"
instead of the standard ".svn" I believe the reason for this was to
ensure it worked with websites served by IIS.  

This setting causes problems with vc-svn on windows.  vc-mode does not
recognize these files as being under version control.  To handle this
I have just replaced ".svn" with "_svn" in vc-svn.el.  So far I have
not seen any negative side effects of making this change.  However it
occured to me that there should be a more effective way of handling
this.  In looking at the file it would seem that eiter a variable
could be used to determine the name of the svn directory or an "or"
statement could be used where if no ".svn" directory is found a "_svn"
directory could be sought.

As I said my elisp skills are pretty weak but I am trying to get the
or statement to work. If I am able to get something working I will
submit a patch.

Ari
-- 

enjoy every sandwich

           -- W. Zevon

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: vc-svn.el and "the underscore hack"
@ 2006-10-16 15:02 AriT93
  0 siblings, 0 replies; 2+ messages in thread
From: AriT93 @ 2006-10-16 15:02 UTC (permalink / raw


[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 245 bytes --]


Following up to my previous email.  here is a patch that seems to be
functioning.  As I said my elisp skills are pretty weak.  If there is
a better way to accomplish these changes I would be very interested in
them as a learning experience.  


[-- Attachment #2: vc-svn.patch --]
[-- Type: text/plain, Size: 2908 bytes --]

--- /cygdrive/c/temp/cvs/emacs/lisp/vc-svn.el	2006-02-08 21:47:00.000000000 -0600
+++ /cygdrive/c/emacs/lisp/vc-svn.el	2006-10-16 09:37:34.240209600 -0500
@@ -100,18 +100,25 @@ This is only meaningful if you don't use
 ;;;
 
 ;;;###autoload (defun vc-svn-registered (f)
-;;;###autoload   (when (file-readable-p (expand-file-name
-;;;###autoload 			  ".svn/entries" (file-name-directory f)))
+;;;###autoload   (when (or (file-readable-p (expand-file-name
+;;;###autoload 			  "_svn/entries" (file-name-directory f)))
+;;;###autoload           (file-readable-p (expand-file-name 
+;;;###autoload           ".svn/entries" (file-name-directory f))))
 ;;;###autoload       (load "vc-svn")
 ;;;###autoload       (vc-svn-registered f)))
 
 ;;;###autoload
 (add-to-list 'completion-ignored-extensions ".svn/")
+(add-to-list 'completion-ignored-extensions "_svn/")
 
 (defun vc-svn-registered (file)
   "Check if FILE is SVN registered."
-  (when (file-readable-p (expand-file-name ".svn/entries"
-					   (file-name-directory file)))
+  ;;  (when (file-readable-p (expand-file-name "_svn/entries"
+  ;;					   (file-name-directory file)))
+  (when (or(file-readable-p (expand-file-name ".svn/entries"
+											  (file-name-directory file)))
+		   (file-readable-p (expand-file-name "_svn/entries"
+											  (file-name-directory file))))
     (with-temp-buffer
       (cd (file-name-directory file))
       (let ((status
@@ -206,12 +213,22 @@ COMMENT can be used to provide an initia
 the SVN command (in that order)."
   (apply 'vc-svn-command nil 0 file "add" (vc-switches 'SVN 'register)))
 
+;; (defun vc-svn-responsible-p (file)
+;;   "Return non-nil if SVN thinks it is responsible for FILE."
+;;   (file-directory-p (expand-file-name "_svn"
+;; 				      (if (file-directory-p file)
+;; 					  file
+;; 					(file-name-directory file)))))
 (defun vc-svn-responsible-p (file)
   "Return non-nil if SVN thinks it is responsible for FILE."
-  (file-directory-p (expand-file-name ".svn"
+  (or (file-directory-p (expand-file-name ".svn"
 				      (if (file-directory-p file)
 					  file
-					(file-name-directory file)))))
+					(file-name-directory file))))
+(file-directory-p (expand-file-name "_svn"
+				      (if (file-directory-p file)
+					  file
+					(file-name-directory file))))))
 
 (defalias 'vc-svn-could-register 'vc-svn-responsible-p
   "Return non-nil if FILE could be registered in SVN.
@@ -476,7 +493,8 @@ and that it passes `vc-svn-global-switch
     (let ((coding-system-for-read
 	   (or file-name-coding-system
 	       default-file-name-coding-system)))
-      (vc-insert-file (expand-file-name ".svn/entries" dirname)))
+      (or (vc-insert-file (expand-file-name ".svn/entries" dirname))
+		  (vc-insert-file (expand-file-name "_svn/entries" dirname))))
     (goto-char (point-min))
     (when (re-search-forward
 	   ;; Old `svn' used name="svn:dir", newer use just name="".

[-- Attachment #3: .signature --]
[-- Type: text/plain, Size: 51 bytes --]


-- 

enjoy every sandwich

           -- W. Zevon

[-- Attachment #4: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-16 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-16 13:20 vc-svn.el and "the underscore hack" AriT93
  -- strict thread matches above, loose matches on Subject: below --
2006-10-16 15:02 AriT93

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).