aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2008-11-12 04:47:18 +0000
committerSam Steingold2008-11-12 04:47:18 +0000
commit05342dca46131c1726f503def80e45012e5cbc0f (patch)
tree71f9ee5f9b5b2abdcd24531698bcaf175b40a0c1
parent978d723ed975bf68d4187f39d8ffd1fd99b70a89 (diff)
downloademacs-05342dca46131c1726f503def80e45012e5cbc0f.tar.gz
emacs-05342dca46131c1726f503def80e45012e5cbc0f.zip
(vc-cvs-parse-root): Handle roots without colon between hostname and path.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/vc-cvs.el17
2 files changed, 16 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 935fa82b10d..a9f5e15987a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-11-12 Sam Steingold <sds@gnu.org>
2
3 * vc-cvs.el (vc-cvs-parse-root): Handle roots without colon
4 between hostname and path.
5
12008-11-11 Juri Linkov <juri@jurta.org> 62008-11-11 Juri Linkov <juri@jurta.org>
2 7
3 * dired-aux.el (dired-isearch-filenames) 8 * dired-aux.el (dired-isearch-filenames)
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index cd5c86fe7f2..1e47a6543f2 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -720,10 +720,16 @@ and that it passes `vc-cvs-global-switches' to it before FLAGS."
720 (buffer-substring (point) 720 (buffer-substring (point)
721 (line-end-position)))))))) 721 (line-end-position))))))))
722 722
723(defun vc-cvs-parse-uhp (path)
724 "parse user@host/path into (user@host /path)"
725 (if (string-match "\\([^/]+\\)\\(/.*\\)" path)
726 (list (match-string 1 path) (match-string 2 path))
727 (list nil path)))
728
723(defun vc-cvs-parse-root (root) 729(defun vc-cvs-parse-root (root)
724 "Split CVS ROOT specification string into a list of fields. 730 "Split CVS ROOT specification string into a list of fields.
725A CVS root specification of the form 731A CVS root specification of the form
726 [:METHOD:][[USER@]HOSTNAME:]/path/to/repository 732 [:METHOD:][[USER@]HOSTNAME]:?/path/to/repository
727is converted to a normalized record with the following structure: 733is converted to a normalized record with the following structure:
728 \(METHOD USER HOSTNAME CVS-ROOT). 734 \(METHOD USER HOSTNAME CVS-ROOT).
729The default METHOD for a CVS root of the form 735The default METHOD for a CVS root of the form
@@ -745,17 +751,16 @@ For an empty string, nil is returned (invalid CVS root)."
745 ;; Invalid CVS root 751 ;; Invalid CVS root
746 nil) 752 nil)
747 ((= len 1) 753 ((= len 1)
748 ;; Simple PATH => method `local' 754 (let ((uhp (vc-cvs-parse-uhp (car root-list))))
749 (cons "local" 755 (cons (if (car uhp) "ext" "local") uhp)))
750 (cons nil root-list)))
751 ((= len 2) 756 ((= len 2)
752 ;; [USER@]HOST:PATH => method `ext' 757 ;; [USER@]HOST:PATH => method `ext'
753 (and (not (equal (car root-list) "")) 758 (and (not (equal (car root-list) ""))
754 (cons "ext" root-list))) 759 (cons "ext" root-list)))
755 ((= len 3) 760 ((= len 3)
756 ;; :METHOD:PATH 761 ;; :METHOD:PATH or :METHOD:USER@HOSTNAME/PATH
757 (cons (cadr root-list) 762 (cons (cadr root-list)
758 (cons nil (cddr root-list)))) 763 (vc-cvs-parse-uhp (caddr root-list))))
759 (t 764 (t
760 ;; :METHOD:[USER@]HOST:PATH 765 ;; :METHOD:[USER@]HOST:PATH
761 (cdr root-list))))) 766 (cdr root-list)))))