Fetching a newly created branch via bzr-git
Jelmer Vernooij
jelmer at samba.org
Fri Apr 27 11:25:01 UTC 2012
On Fri, Apr 27, 2012 at 12:13:28PM +0300, Eli Zaretskii wrote:
> > On Wed, Apr 18, 2012 at 07:38:18PM +0300, Eli Zaretskii wrote:
> > > I have a bzr repository that tracks an upstream git repository. When
> > > I created it, I used "bzr git-import", and after that I use "bzr
> > > switch" to switch to some specific branch and "bzr pull" to sync that
> > > branch with upstream. So far so good.
> > >
> > > Now a new branch was created in the upstream repository. How can I
> > > import that new branch, except by deleting everything and doing the
> > > initial "bzr git-import" step again?
> > You shouldn't have to delete everything to run bzr-git again; it
> > should be incremental. Though please note that it will overwrite your
> > existing branches if you've changed them locally.
> Thanks. I tried that now, but it doesn't seem to create new
> branches. Here's the transcript:
>
> D:\gnu\bzr\gawk>bzr switch --force master
> Tree is up to date at revision 305.
> Switched to branch: D:/gnu/bzr/gawk/
>
> D:\gnu\bzr\gawk>bzr branches
> gawk-2.10-from-net
> gawk-4.0-stable
> gawk-stable
> gawk_mpfr
> * master
> xgawk
> xgawk-build
>
> D:\gnu\bzr\gawk>bzr git-import git://git.savannah.gnu.org/gawk.git
> Use 'bzr checkout' to create a working tree in the newly created branches.
>
> D:\gnu\bzr\gawk>bzr branches
> gawk-2.10-from-net
> gawk-4.0-stable
> gawk-stable
> gawk_mpfr
> * master
> xgawk
> xgawk-build
>
> However, in the upstream repo, a new branch called array-iface was
> recently added, and indeed if I clone the repository anew, I get it:
>
> D:\gnu\bzr>bzr git-import git://git.savannah.gnu.org/gawk.git gawk2
> Use 'bzr checkout' to create a working tree in the newly created branches.
>
> D:\gnu\bzr>cd gawk2
>
> D:\gnu\bzr\gawk2>bzr branches
> * (default)
> array-iface
> gawk-2.10-from-net
> gawk-4.0-stable
> gawk-stable
> gawk_mpfr
> master
> xgawk
> xgawk-build
>
> This is with bzr-git 0.6.7, the one that came with bzr 2.5.0. Do I
> need a newer bzr-git or something?
I don't know. If I remove a branch and then reimport the branch comes
back (which is the intended behaviour).
> Btw, what is that "(default)" branch that "bzr branches" shows as
> being current after the initial git-import? There's no such branch in
> the repo, and .bzr/branches/ directory doesn't have a subdirectory for
> it. Wouldn't it be better if the default were "master"?
The (default) branch is what corresponds to HEAD in git. We can't
simply name that branch "master" since that would conflict with the
actual master branch, which can be different from HEAD.
Cheers,
Jelmer
More information about the bazaar
mailing list