aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-12-13 06:30:40 +0000
committerStefan Monnier2004-12-13 06:30:40 +0000
commit17a5a3014db451821e4bfaeb84980de7ac650be1 (patch)
treecf7c970bab019c54dcbabbbe32110c7cb347f855
parent37ed0ee5e3e5d17f2141ad45806ddbf826e3fde2 (diff)
downloademacs-17a5a3014db451821e4bfaeb84980de7ac650be1.tar.gz
emacs-17a5a3014db451821e4bfaeb84980de7ac650be1.zip
(vc-svn-repository-hostname): Adjust to new format.
Reported by Ville Skytt�scop@xemacs.org>. (vc-svn-annotate-current-time, vc-svn-annotate-time-of-rev) (vc-svn-annotate-time, vc-svn-annotate-extract-revision-at-line) (vc-svn-annotate-command, vc-svn-annotate-re): Support for svn annotate.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/vc-svn.el34
2 files changed, 39 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 866339b7ca5..b5cc31b9363 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12004-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc-svn.el (vc-svn-repository-hostname): Adjust to new format.
4 Reported by Ville Skytt,Ad(B <scop@xemacs.org>.
5 (vc-svn-annotate-current-time, vc-svn-annotate-time-of-rev)
6 (vc-svn-annotate-time, vc-svn-annotate-extract-revision-at-line)
7 (vc-svn-annotate-command, vc-svn-annotate-re): Support for svn annotate.
8
12004-12-12 Juri Linkov <juri@jurta.org> 92004-12-12 Juri Linkov <juri@jurta.org>
2 10
3 * files.el (find-file-other-window, find-file-other-frame): 11 * files.el (find-file-other-window, find-file-other-frame):
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index fafb5eff7cd..cbb951d60b7 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -447,10 +447,14 @@ and that it passes `vc-svn-global-switches' to it before FLAGS."
447 (vc-insert-file (expand-file-name ".svn/entries" dirname))) 447 (vc-insert-file (expand-file-name ".svn/entries" dirname)))
448 (goto-char (point-min)) 448 (goto-char (point-min))
449 (when (re-search-forward 449 (when (re-search-forward
450 (concat "name=\"svn:this_dir\"[\n\t ]*" 450 ;; Old `svn' used name="svn:dir", newer use just name="".
451 "\\([-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?" 451 (concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*"
452 "\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
452 "url=\"\\([^\"]+\\)\"") nil t) 453 "url=\"\\([^\"]+\\)\"") nil t)
453 (match-string 2)))) 454 ;; This is not a hostname but a URL. This may actually be considered
455 ;; as a feature since it allows vc-svn-stay-local to specify different
456 ;; behavior for different modules on the same server.
457 (match-string 1))))
454 458
455(defun vc-svn-parse-status (localp) 459(defun vc-svn-parse-status (localp)
456 "Parse output of \"svn status\" command in the current buffer. 460 "Parse output of \"svn status\" command in the current buffer.
@@ -505,6 +509,30 @@ essential information."
505 (and (string-match "^[0-9]" tag) 509 (and (string-match "^[0-9]" tag)
506 (not (string-match "[^0-9]" tag)))) 510 (not (string-match "[^0-9]" tag))))
507 511
512;; Support for `svn annotate'
513
514(defun vc-svn-annotate-command (file buf &optional rev)
515 (vc-svn-command buf 0 file "annotate" (if rev (concat "-r" rev))))
516
517(defun vc-svn-annotate-time-of-rev (rev)
518 ;; Arbitrarily assume 10 commmits per day.
519 (/ (string-to-number rev) 10.0))
520
521(defun vc-svn-annotate-current-time ()
522 (vc-svn-annotate-time-of-rev vc-annotate-parent-rev))
523
524(defconst vc-svn-annotate-re "[ \t]*\\([0-9]+\\)[ \t]+[^\t ]+ ")
525
526(defun vc-svn-annotate-time ()
527 (when (looking-at vc-svn-annotate-re)
528 (goto-char (match-end 0))
529 (vc-svn-annotate-time-of-rev (match-string 1))))
530
531(defun vc-svn-annotate-extract-revision-at-line ()
532 (save-excursion
533 (beginning-of-line)
534 (if (looking-at vc-svn-annotate-re) (match-string 1))))
535
508(provide 'vc-svn) 536(provide 'vc-svn)
509 537
510;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d 538;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d