`magit-svn-find-rev' now supports the prefix arg.

* magit.el (magit-svn-find-rev): Prefix support for branch name.
* magit.texi: Documenting magit-svn-find-rev.
This commit is contained in:
Phil Jackson 2009-11-06 14:52:33 +00:00
parent 869c6059b6
commit 83992a9ec2
2 changed files with 21 additions and 9 deletions

View file

@ -2182,16 +2182,22 @@ in log buffer."
;; git svn commands
(defun magit-svn-find-rev (rev)
(interactive "SVN revision: ")
(let* ((sha (magit-git-string "svn" "find-rev"
(concat "r" (number-to-string rev)))))
(defun magit-svn-find-rev (rev &optional branch)
(interactive
(list (read-input "SVN revision: ")
(if current-prefix-arg
(read-input "In branch: "))))
(let* ((sha (apply 'magit-git-string
`("svn"
"find-rev"
,(concat "r" rev)
,@(when branch (list branch))))))
(if sha
(magit-show-commit
(magit-with-section sha 'commit
(magit-set-section-info sha)
sha))
(error "Revision %d could not be mapped to a commit" rev))))
(magit-show-commit
(magit-with-section sha 'commit
(magit-set-section-info sha)
sha))
(error "Revision %s could not be mapped to a commit" rev))))
(defun magit-svn-rebase ()
(interactive)

View file

@ -634,4 +634,10 @@ Magit shows them in a section called @emph{Unpulled changes}. Typing
Typing @kbd{N r} runs @code{git svn rebase} and typing @kbd{N c} runs
@code{git svn dcommit}.
@kbd{N f} will prompt you for a (numeric, Subversion) revision and
then search for a corresponding Git sha1 for the commit. This is
limited to the path of the remote Subversion repository. With a prefix
(@kbd{C-u N f} the user will also be prompted for a branch to search
in.
@bye