]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt to Subversion change, with no .svn directory in each sub directory.
authorKarl Pflästerer <k@rl.pflaesterer.de>
Sat, 12 Feb 2011 01:12:53 +0000 (20:12 -0500)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 12 Feb 2011 01:12:53 +0000 (20:12 -0500)
http://lists.gnu.org/archive/html/emacs-devel/2011-02/msg00357.html

* vc/vc-svn.el (vc-svn-registered): Use vc-svn-root.
(vc-svn-root): New function.  Make vc-svn-responsible-p an alias.
(vc-svn-repository-hostname): Use "svn info".

lisp/ChangeLog
lisp/vc/vc-svn.el

index 68fdfbf4d2e6f39dd1dc5e4eb03daf68bcc6ff1c..d97d7cee4b61bba3f4fa3e5aec30bc53c27f568c 100644 (file)
@@ -1,3 +1,11 @@
+2011-02-12  Karl Pflästerer  <k@rl.pflaesterer.de>  (tiny change)
+
+       * vc/vc-svn.el: Adapt to Subversion change, with no .svn directory
+       in each sub directory.
+       (vc-svn-registered): Use vc-svn-root.
+       (vc-svn-root): New function.  Make vc-svn-responsible-p an alias.
+       (vc-svn-repository-hostname): Use "svn info".
+
 2011-02-11  Deniz Dogan  <deniz.a.m.dogan@gmail.com>
 
        * simple.el (delete-trailing-whitespace): New optional buffer
index aefef50cf79942eae7e8fcfff1918d56ec28195b..20c7689f4012d695a9287a5f79fc82b96778fd9c 100644 (file)
@@ -117,17 +117,13 @@ If you want to force an empty list of arguments, use t."
 ;;;###autoload                                (getenv "SVN_ASP_DOT_NET_HACK"))
 ;;;###autoload                           "_svn")
 ;;;###autoload                          (t ".svn"))))
-;;;###autoload     (when (file-readable-p (expand-file-name
-;;;###autoload                             (concat admin-dir "/entries")
-;;;###autoload                             (file-name-directory f)))
+;;;###autoload     (when (vc-find-root f admin-dir)
 ;;;###autoload       (load "vc-svn")
 ;;;###autoload       (vc-svn-registered f))))
 
 (defun vc-svn-registered (file)
   "Check if FILE is SVN registered."
-  (when (file-readable-p (expand-file-name (concat vc-svn-admin-directory
-                                                  "/entries")
-                                          (file-name-directory file)))
+  (when (vc-svn-root file)
     (with-temp-buffer
       (cd (file-name-directory file))
       (let* (process-file-side-effects
@@ -275,14 +271,12 @@ Passes either `vc-svn-register-switches' or `vc-register-switches'
 to the SVN command."
   (apply 'vc-svn-command nil 0 files "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 vc-svn-admin-directory
-                                     (if (file-directory-p file)
-                                         file
-                                       (file-name-directory file)))))
+(defun vc-svn-root (file)
+  (vc-find-root file vc-svn-admin-directory))
 
-(defalias 'vc-svn-could-register 'vc-svn-responsible-p
+(defalias 'vc-svn-responsible-p 'vc-svn-root)
+
+(defalias 'vc-svn-could-register 'vc-svn-root
   "Return non-nil if FILE could be registered in SVN.
 This is only possible if SVN is responsible for FILE's directory.")
 
@@ -594,20 +588,10 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
 
 (defun vc-svn-repository-hostname (dirname)
   (with-temp-buffer
-    (let ((coding-system-for-read
-          (or file-name-coding-system
-              default-file-name-coding-system)))
-      (vc-insert-file (expand-file-name (concat vc-svn-admin-directory
-                                               "/entries")
-                                       dirname)))
+    (let (process-file-side-effects)
+      (vc-svn-command t t dirname "info" "--xml"))
     (goto-char (point-min))
-    (when (re-search-forward
-          ;; Old `svn' used name="svn:this_dir", newer use just name="".
-          (concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*"
-                  "\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
-                  "url=\"\\(?1:[^\"]+\\)\""
-                   ;; Yet newer ones don't use XML any more.
-                   "\\|^\ndir\n[0-9]+\n\\(?1:.*\\)") nil t)
+    (when (re-search-forward "<url>\\(.*\\)</url>" nil t)
       ;; This is not a hostname but a URL.  This may actually be considered
       ;; as a feature since it allows vc-svn-stay-local to specify different
       ;; behavior for different modules on the same server.