Re: [StGIT PATCH] Better diagnostic for wrong branch configuration.
- From
- Catalin Marinas <catalin.marinas@gmail.com>
- Date
- Oct 8, 2007, 13:00 UTC
- Message-ID
- <b0943d9e0710080600y55aeeeeei8dbd27d069c681e@mail.gmail.com>
- In-Reply-To
- <20071005204452.30902.60246.stgit@gandelf.nowhere.earth>
On 05/10/2007, Yann Dirson <ydirson@altern.org> wrote:
Show 14 quoted lines
> --- a/stgit/git.py
> +++ b/stgit/git.py
> @@ -1003,11 +1003,14 @@ def fetch_head():
> m = re.match('^([^\t]*)\t\t', line)
> if m:
> if fetch_head:
> - raise GitException, "StGit does not support multiple FETCH_HEAD"
> + raise GitException, 'StGit does not support multiple FETCH_HEAD'
> else:
> fetch_head=m.group(1)
> stream.close()
>
> + if not fetch_head:
> + raise GitException, 'No for-merge remote head found in FETCH_HEAD'OK, I tried and it doesn't work with my StGIT over SVN configuration.
What I did is defining 'pull-policy' as 'fetch-rebase', 'fetchcmd' as 'git svn fetch' which doesn't create any FETCH_HEAD. The 'pullcmd' is defined as 'git svn rebase' and it doesn't use any argument if git.fetch_head() return None.
I also think it is better for the pull command to re-raise the git.fetch_head exception as this one contains more detailed information about the error (after the out.error call). It currently shows that the remote head couldn't be found but there is the multiple heads case raised by git.fetch_head.
-- Catalin