"bzr push" to a bound branch without a working tree

John Arbash Meinel john at arbash-meinel.com
Wed May 18 08:17:45 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 5/18/2011 10:11 AM, Eli Zaretskii wrote:
> On one of my machines, I have a bound branch without a working tree.
> "bzr info" reports:
> 
>   D:\usr\eli\bzr\emacs\trunk>bzr info
>   Repository bound branch (format: 2a)
>   Location:
>     shared repository: D:/usr/eli/bzr/emacs
>     repository branch: .
> 
>   Related branches:
>     public branch: bzr+ssh://eliz@bzr.savannah.gnu.org/emacs/trunk/
>     parent branch: bzr+ssh://eliz@bzr.savannah.gnu.org/emacs/trunk/
> 
> I also have there a local branch with a tree whose parent is the above
> treeless branch:
> 
>   D:\usr\eli\bzr\emacs\quickfixes>bzr info
>   Repository tree (format: 2a)
>   Location:
>     shared repository: D:/usr/eli/bzr/emacs
>     repository branch: .
> 
>   Related branches:
>       push branch: D:/usr/eli/bzr/emacs/trunk
>     parent branch: D:/usr/eli/bzr/emacs/trunk
> 
> I never before used this machine for committing changes, only for
> tracking the upstream repo.  Today I tried, and saw a strange failure.
> 
> Here's what I did:
> 
>   . Made a change in quickfixes, then committed the change.  That
>     worked as expected.

If quickfixes is a lightweight checkout of trunk, and trunk is a bound
branch to upstream trunk, then committing in "quickfixes" will commit
directly to local trunk, which commits to remote trunk.

> 
>   . Went to ../trunk and tried merging with quickfixes.  This failed
>     with the following error message:
> 
>     D:\usr\eli\bzr\emacs\quickfixes>cd ..\trunk
> 
>     D:\usr\eli\bzr\emacs\trunk>bzr merge ../quickfixes
>     NoWorkingTree: No WorkingTree exists for "file:///D:/usr/eli/bzr/emacs/trunk/.bzr/checkout/".
> 
>     Is this expected?  I don't think the documentation of "merge" says
>     anything about working trees.

You have to have a tree to merge. Because we are merging the contents of
one branch into another, giving you an opportunity to commit. And
hopefully its obvious that you have to have a tree to commit.

> 
>   . Then I tried pushing from quickfixes/ to trunk/.  This also
>     failed:
> 
>     D:\usr\eli\bzr\emacs\trunk>cd ../quickfixes
> 
>     D:\usr\eli\bzr\emacs\quickfixes>bzr push ../trunk
>     Connected (version 2.0, client OpenSSH_5.5p1)
>     Authentication (publickey) successful!
>     Secsh channel 1 opened.
>     Connected (version 2.0, client OpenSSH_5.5p1)hing stream
>     Authentication (publickey) successful!
>     Secsh channel 1 opened.
>     bzr: ERROR: Could not acquire lock "(remote lock)": bzr+ssh://eliz@bzr.savannah.gnu.org/emacs/
> 
>     It sounds like it tried to acquire a second lock while the first
>     was still in use, and that failed, is that right?  Here's what I
>     have in .bzr.log about this:

1) It doesn't make sense to push from a branch to itself, which is what
you are doing. Since quickfixes is a lightweight checkout *of* trunk,
pushing from quickfixes to trunk is pushing to itself.

2) There is certainly potential for a bug here, especially since on top
of pushing to self, you are including a bound branch. And pushing from
trunk => trunk is trying to also push to upstream_trunk, though that is
probably already locked elsewhere.

...

> Is this configuration (a tree-less bound branch and its child local
> branch with a tree) supported?  If so, did I do something wrong?
> 
> TIA
> 

It is perfectly supported. I think what you missed is that you don't
have a "local branch with a tree", you have a "local tree" and the
*branch* is the "tree-less bound branch". So committing in the "local
tree" automatically updates the "tree-less bound branch" and because the
branch is bound, it also updates the master branch.

One thing that could have helped. Run "bzr log" in trunk, and notice
that your commit is already there.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk3TgKkACgkQJdeBCYSNAAOL7ACfZvuOy1IJqm4jumUm1jxjX+a2
D74AoMYldQlBA92eyyQeVg67aM+UvUjM
=GqoY
-----END PGP SIGNATURE-----



More information about the bazaar mailing list