Merge remote branch 'refs/remotes/philjackson/svn-find-rev'

This commit is contained in:
Phil Jackson 2010-03-26 14:00:13 +00:00
commit f9283aaa0d
2 changed files with 24 additions and 0 deletions

View file

@ -1293,6 +1293,7 @@ Many Magit faces inherit from this one by default."
(define-key map (kbd "e") 'magit-interactive-resolve-item)
(define-key map (kbd "N r") 'magit-svn-rebase)
(define-key map (kbd "N c") 'magit-svn-dcommit)
(define-key map (kbd "N f") 'magit-svn-find-rev)
(define-key map (kbd "R") 'magit-rebase-step)
(define-key map (kbd "r s") 'magit-rewrite-start)
(define-key map (kbd "r t") 'magit-rewrite-stop)
@ -2332,6 +2333,23 @@ merge will be squashed."
;; git svn commands
(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 %s could not be mapped to a commit" rev))))
(defun magit-svn-rebase ()
(interactive)
(magit-run-git-async "svn" "rebase"))

View file

@ -638,4 +638,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