Merge remote branch 'refs/remotes/philjackson/svn-find-rev'
This commit is contained in:
commit
f9283aaa0d
2 changed files with 24 additions and 0 deletions
18
magit.el
18
magit.el
|
@ -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 "e") 'magit-interactive-resolve-item)
|
||||||
(define-key map (kbd "N r") 'magit-svn-rebase)
|
(define-key map (kbd "N r") 'magit-svn-rebase)
|
||||||
(define-key map (kbd "N c") 'magit-svn-dcommit)
|
(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") 'magit-rebase-step)
|
||||||
(define-key map (kbd "r s") 'magit-rewrite-start)
|
(define-key map (kbd "r s") 'magit-rewrite-start)
|
||||||
(define-key map (kbd "r t") 'magit-rewrite-stop)
|
(define-key map (kbd "r t") 'magit-rewrite-stop)
|
||||||
|
@ -2332,6 +2333,23 @@ merge will be squashed."
|
||||||
|
|
||||||
;; git svn commands
|
;; 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 ()
|
(defun magit-svn-rebase ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(magit-run-git-async "svn" "rebase"))
|
(magit-run-git-async "svn" "rebase"))
|
||||||
|
|
|
@ -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
|
Typing @kbd{N r} runs @code{git svn rebase} and typing @kbd{N c} runs
|
||||||
@code{git svn dcommit}.
|
@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
|
@bye
|
||||||
|
|
Loading…
Add table
Reference in a new issue