-(defun vc-svn-stay-local-p (file)
- "Return non-nil if VC should stay local when handling FILE.
-See `vc-svn-stay-local'."
- (when vc-svn-stay-local
- (let* ((dirname (if (file-directory-p file)
- (directory-file-name file)
- (file-name-directory file)))
- (prop
- (or (vc-file-getprop dirname 'vc-svn-stay-local-p)
- (vc-file-setprop
- dirname 'vc-svn-stay-local-p
- (let ((rootname (expand-file-name ".svn/entries" dirname)))
- (cond
- ((not (file-readable-p rootname)) 'no)
- ((stringp vc-svn-stay-local)
- (with-temp-buffer
- (let ((coding-system-for-read
- (or file-name-coding-system
- default-file-name-coding-system)))
- (vc-insert-file rootname))
- (goto-char (point-min))
- (when (re-search-forward
- (concat "name=\"svn:this_dir\"[\n\t ]*"
- "url=\"\\([^\"]+\\)\"") nil t)
- (let ((hostname (match-string 1)))
- (if (not hostname)
- 'no
- (let* ((stay-local t)
- (rx
- (cond
- ;; vc-svn-stay-local: rx
- ((stringp vc-svn-stay-local)
- vc-svn-stay-local)
- ;; vc-svn-stay-local: '( [except] rx ... )
- ((consp vc-svn-stay-local)
- (mapconcat
- 'identity
- (if (not (eq (car vc-svn-stay-local)
- 'except))
- vc-svn-stay-local
- (setq stay-local nil)
- (cdr vc-svn-stay-local))
- "\\|")))))
- (if (not rx)
- 'yes
- (if (not (string-match rx hostname))
- (setq stay-local (not stay-local)))
- (if stay-local
- 'yes
- 'no))))))))))))))
- (if (eq prop 'yes) t nil))))
+(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 ".svn/entries" dirname)))
+ (goto-char (point-min))
+ (when (re-search-forward
+ ;; Old `svn' used name="svn:dir", newer use just name="".
+ (concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*"
+ "\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
+ "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.
+ (match-string 1))))