Comment 11 for bug 250451

Revision history for this message
Wouter van Heyst (larstiq) wrote : Re: [Bug 250451] Re: bzr suggests wrong URL for break-lock with a LP hosted branch

On Mon, May 04, 2009 at 12:43:53AM -0000, Andrew Bennetts wrote:

...

> The message in the bug report seems to be printed by the wait_lock method in
> bzrlib/lockdir.py though. I'm not sure how that's getting invoked here,
> maybe stick a "import pdb; pdb.set_trace()" or "import traceback;
> traceback.print_stack()" or similar in there just before it calls
> self._report_function? Oh, _report_function is bzrlib.trace.note: that text
> is actually being emitted *server-side*, and SSH is faithfully conveying it
> to the local terminal. If you run a local TCP bzr server (with “bzr serve
> --allow-writes”) you'll see that the server process does the printing!

Aha, it is not bzr but ssh that is doing the printing locally, now my
difficulty finding the code where it happened makes sense :)

> So actually a) has a few parts:
>
> a.1) make the client ignore the URL from the server (except perhaps if it is
> a relpath).
> a.2) fix bzrlib.lockdir to not spew over stdout. It's mixed UI code with
> low-level logic.
> a.3) make the text that bzrlib.lockdir get spewed in a more appropriate
> place so that the client can do it (and substitute in its own URLs).

Looks good. Now just need someone to implement your analysis. I won't
make the mistake of volunteering for that again.

> Brief reproduction notes:
>
> $ cd /tmp
> $ bzr init locked-branch
> $ python -c "from bzrlib.bzrdir import BzrDir; BzrDir.open('/tmp/locked-branch').open_branch().lock_write()"
> $ bzr --no-plugins serve --allow-writes
>
> [now launch a separate terminal]
>
> $ bzr push -d [path-of-any-branch] bzr://localhost/locked-branch

Very clear illustration of the lock message being printed on stdout,
thank you.

Wouter van Heyst