Cool -- I knew this might be an issue when I sent the patch to Marius  
adding the svn-unpulled section, but I didn't know the best way to fix  
it.

This patch is an improvement, though I wonder if there's a more  
deterministic way to identify the svn branch than just trying the  
common names.

-Steve



On 7 Mar 2009, at 04:04, Travis B. Hartwell wrote:

>
> ---
> magit.el |   14 ++++++++------
> 1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/magit.el b/magit.el
> index b659aaf..93bd808 100644
> --- a/magit.el
> +++ b/magit.el
> @@ -1771,13 +1771,13 @@ in log buffer."
>   (magit-git-section 'svn-unpulled
>                    "Unpulled commits (SVN):" 'magit-wash-log
>                    "log" "--pretty=format:* %H %s"
> -                  (format "HEAD..remotes/git-svn")))
> +                  (format "HEAD..remotes/%s" (magit-get-svn-branch-name))))
>
> (defun magit-insert-unpushed-svn-commits ()
>   (magit-git-section 'svn-unpushed
>                    "Unpushed commits (SVN):" 'magit-wash-log
>                    "log" "--pretty=format:* %H %s"
> -                  (format "remotes/git-svn..HEAD")))
> +                  (format "remotes/%s..HEAD" (magit-get-svn-branch-name))))
>
> ;;; Status
>
> @@ -1995,11 +1995,13 @@ in log buffer."
>   (magit-run-git-async "svn" "dcommit"))
>
> (defun magit-svn-enabled ()
> -  (or (not (null (find "git-svn" (magit-list-interesting-revisions)
> -                    :test 'equal)))
> -      (not (null (find "trunk" (magit-list-interesting-revisions)
> -                    :test 'equal)))))
> +   (not (null (magit-get-svn-branch-name))))
>
> +(defun magit-get-svn-branch-name ()
> +  (or (find "git-svn" (magit-list-interesting-revisions)
> +         :test 'equal)
> +      (find "trunk" (magit-list-interesting-revisions)
> +         :test 'equal)))
> ;;; Resetting
>
> (defun magit-reset-head (rev &optional hard)
> -- 
> 1.6.2
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
-- 
http://groups.google.com/group/magit
-~----------~----~----~----~------~----~------~--~---

Reply via email to