bzr switch --force does not cope with down servers

Bug #308798 reported by Alexander Belchenko
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Medium
Unassigned

Bug Description

C:\Temp\1>bzr init master
Created a standalone tree (format: pack-0.92)

C:\Temp\1>bzr ci -m1 master --unchanged
Committing to: C:/Temp/1/master/
Committed revision 1.

C:\Temp\1>bzr get master copy
Branched 1 revision(s).

C:\Temp\1>start bzr server --allow-writes --dir=.

# server started, check the available branches

C:\Temp\1>bzr branches bzr://localhost/
copy
master

C:\Temp\1>bzr co --light bzr://localhost/master checkout

# halt bzr server

C:\Temp\1>bzr branches bzr://localhost/
bzr: ERROR: Connection error: failed to connect to localhost:4155:
Connection refused

C:\Temp\1\checkout>bzr switch ../copy --force
bzr: ERROR: Connection error: failed to connect to localhost:4155:
Connection refused

C:\Temp\1\checkout>bzr switch C:\Temp\1\copy\ --force
bzr: ERROR: Connection error: failed to connect to localhost:4155:
Connection refused

Tags: switch
Revision history for this message
Robert Collins (lifeless) wrote :

This is a dup of a bug I fixed a few weeks back, I don't recall the number sorry.

Changed in bzr:
status: New → Fix Released
Revision history for this message
Alexander Belchenko (bialix) wrote :

I don't see it fixed in 2.0.

For which version it was fixed?

Revision history for this message
Robert Collins (lifeless) wrote :

(working is a branch of 2.0)
robertc@lifelessdesktop:/tmp$ rm -rf foo
robertc@lifelessdesktop:/tmp$ mkdir foo
robertc@lifelessdesktop:/tmp$ ~/source/bzr/working/bzr init abc
Created a standalone tree (format: 2a)
robertc@lifelessdesktop:/tmp$ rm -rf wt
robertc@lifelessdesktop:/tmp$ ~/source/bzr/working/bzr co --lightweight abc wt
robertc@lifelessdesktop:/tmp$ mv abc ab
robertc@lifelessdesktop:/tmp$ cd wt
robertc@lifelessdesktop:/tmp/wt$ bzr switch ab
bzr: ERROR: Not a branch: "/tmp/abc/".
robertc@lifelessdesktop:/tmp/wt$ bzr switch ab --force
Updated to revision 1.
Switched to branch: /tmp/ab/

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 308798] Re: Unable to switch lightweight checkout when it's parent branch is renamed

Robert Collins пишет:
> (working is a branch of 2.0)

Does it mean 2.0.1?

Revision history for this message
Robert Collins (lifeless) wrote :

On Wed, 2009-09-30 at 08:49 +0000, Alexander Belchenko wrote:
> Robert Collins пишет:
> > (working is a branch of 2.0)
>
> Does it mean 2.0.1?

I'd be surprised if its not fixed in 2.0.0, I thought I fixed it around
1.18 time frame. What do you see when you try - can you post a
transcript like I just did?

-Rob

Revision history for this message
Alexander Belchenko (bialix) wrote :

Robert Collins пишет:
> On Wed, 2009-09-30 at 08:49 +0000, Alexander Belchenko wrote:
>> Robert Collins пишет:
>>> (working is a branch of 2.0)
>> Does it mean 2.0.1?
>
> I'd be surprised if its not fixed in 2.0.0, I thought I fixed it around
> 1.18 time frame. What do you see when you try - can you post a
> transcript like I just did?

OK, It works for local branches BUT does not work for bzr:// protocol
when server is down.

Local case:

C:\Temp\1>bzr init master
Created a standalone tree (format: pack-0.92)

C:\Temp\1>bzr ci -m1 master --unchanged
Committing to: C:/Temp/1/master/
Committed revision 1.

C:\Temp\1>bzr get master copy
Branched 1 revision(s).

C:\Temp\1>bzr co --light master checkout

C:\Temp\1>ren master master-renamed

C:\Temp\1\checkout>bzr switch ../copy
bzr: ERROR: Not a branch: "C:/Temp/1/master/".

C:\Temp\1\checkout>bzr switch ../copy --force
Tree is up to date at revision 1.
Switched to branch: C:/Temp/1/copy/

With bzr:// server:

C:\Temp\1>bzr init master
Created a standalone tree (format: pack-0.92)

C:\Temp\1>bzr ci -m1 master --unchanged
Committing to: C:/Temp/1/master/
Committed revision 1.

C:\Temp\1>bzr get master copy
Branched 1 revision(s).

C:\Temp\1>start bzr server --allow-writes --dir=.

# server started, check the available branches

C:\Temp\1>bzr branches bzr://localhost/
copy
master

C:\Temp\1>bzr co --light bzr://localhost/master checkout

# halt bzr server

C:\Temp\1>bzr branches bzr://localhost/
bzr: ERROR: Connection error: failed to connect to localhost:4155:
Connection refused

C:\Temp\1\checkout>bzr switch ../copy --force
bzr: ERROR: Connection error: failed to connect to localhost:4155:
Connection refused

C:\Temp\1\checkout>bzr switch C:\Temp\1\copy\ --force
bzr: ERROR: Connection error: failed to connect to localhost:4155:
Connection refused

Revision history for this message
Robert Collins (lifeless) wrote :

Should be pretty easy to fix if you're interested in doing that - just
need to catch an extra exception.

-Rob

summary: - Unable to switch lightweight checkout when it's parent branch is renamed
+ bzr switch --force does not cope with down servers
Changed in bzr:
status: Fix Released → Confirmed
importance: Undecided → Medium
description: updated
Jelmer Vernooij (jelmer)
tags: added: switch
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.