[issue2920] attempt to create an existing branch in a git subrepo

0 views
Skip to first unread message

ben hockey

unread,
Jul 22, 2011, 5:22:08 PM7/22/11
to mercuri...@selenic.com

New submission from ben hockey <neonst...@gmail.com>:

i have a situation where mercurial fails to properly update a git subrepo.

it seems that at some point a branch called 'origin/master' is mistakenly
created - the 'master' branch existed and should have been used. after
this, when i try to hg pull --update i get an error because another attempt
is made to create the 'origin/master' branch again.

i haven't yet been able to pinpoint the exact conditions that cause this but
below is some of the debug output for a failed command:

static/cws2/external/twine: git config
branch.refs/heads/origin/master.remote
static/cws2/external/twine: git config branch.refs/heads/master.remote
static/cws2/external/twine: git checkout -b origin/master
refs/remotes/origin/master
fatal: git checkout: branch origin/master already exists
abort: git checkout error 128 in static/cws2/external/twine

the first call to git config should be like this

git config branch.master.remote

it seems that there is some mismatch with string substitution using branch
names, refs, etc. i'm not sure if i have found the root cause but the line
that results in the wrong call to config is
http://selenic.com/repo/hg/file/96a72cbc6c29/mercurial/subrepo.py#l812 - its
using the ref instead of the branch name.

----------
messages: 16955
nosy: neonstalwart
priority: bug
status: unread
title: attempt to create an existing branch in a git subrepo

____________________________________________________
Mercurial issue tracker <bu...@mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2920>
____________________________________________________
_______________________________________________
Mercurial-devel mailing list
Mercuri...@selenic.com
http://selenic.com/mailman/listinfo/mercurial-devel

Reply all
Reply to author
Forward
0 new messages