`magit-get-svn-ref' now emulates the git-svn way of remote fetching.
* magit.el (magit-get-svn-ref): Parse log output for the remote svn url.
This commit is contained in:
parent
e38987412d
commit
ee01adf1f3
1 changed files with 14 additions and 6 deletions
20
magit.el
20
magit.el
|
@ -2193,12 +2193,20 @@ in log buffer."
|
|||
(not (null (magit-get-svn-ref))))
|
||||
|
||||
(defun magit-get-svn-ref ()
|
||||
(cond ((magit-ref-exists-p "refs/remotes/git-svn")
|
||||
"refs/remotes/git-svn")
|
||||
((magit-ref-exists-p "refs/remotes/trunk")
|
||||
"refs/remotes/trunk")
|
||||
(t
|
||||
nil)))
|
||||
"Get the best guess remote ref for the current git-svn based
|
||||
branch."
|
||||
(let* ((info (magit-get "svn-remote" "svn" "fetch"))
|
||||
(refs))
|
||||
(when info
|
||||
(concat
|
||||
(file-name-directory (cadr (split-string info ":")))
|
||||
(with-temp-buffer
|
||||
;; grab the git-svn-id information, this is how git-svn.perl
|
||||
;; does it :/
|
||||
(insert (magit-git-string "log" "--first-parent"))
|
||||
(goto-char (point-min))
|
||||
(when (re-search-forward "git-svn-id: .+/\\(.+?\\)@" nil t)
|
||||
(match-string 1)))))))
|
||||
|
||||
;;; Resetting
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue