--relocate alias for bzr switch --force

Bug #334028 reported by Brad Burch
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned
Bazaar Subversion Plugin
Invalid
Undecided
Unassigned

Bug Description

I ran into a dead-end trying to get my existing bzr checkout to point to our new svn server. There is probably a simple way to do this without botching it like I did, but hours of searching yielded no help. I ended up creating a new checkout and manually merging in my changes, but hopefully this report might be of help to others.

I've been working on a somewhat long-running project not being committed to svn. These steps have been working great until we moved our svn server. Here are the steps:
1. existing svn server with history
2. bzr checkout svn://server1/product/trunk trunk
3. bzr branch trunk MyProject
4. make changes in MyProject and bzr commit
5. bzr update trunk
6. bzr merge trunk MyProject

Then the server was moved to a new server. With svn a simple "svn switch --relocate svn://server2/product/trunk" does the trick since the repository was loaded with the same UUID. Using "bzr switch" does not work. After I started from scratch, I did find a way to relocate the server that seems to work, though I'm not certain if there could be ramifications.

Do not use bzr to do any of this, simple edit these files:
1. replace the old repository path in subversion.conf with the new svn server path
2. replace the old repository path in .bzr\branches\branch.conf with the new svn server path

After that, "bzr update" seems to work perfectly. Again, I ran a test and this seems to work, but there might be more files that need tweaking. It might be nice to have a bzr-svn command to do this, or better yet add "bzr switch --relocate" like svn.

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 334028] [NEW] svn switch --relocate

Hi Brad,

Thanks for the bugreport.

On Tue, 2009-02-24 at 20:51 +0000, Brad Burch wrote:
> Public bug reported:
>
> I ran into a dead-end trying to get my existing bzr checkout to point to
> our new svn server. There is probably a simple way to do this without
> botching it like I did, but hours of searching yielded no help. I ended
> up creating a new checkout and manually merging in my changes, but
> hopefully this report might be of help to others.
>
> I've been working on a somewhat long-running project not being committed to svn. These steps have been working great until we moved our svn server. Here are the steps:
> 1. existing svn server with history
> 2. bzr checkout svn://server1/product/trunk trunk
> 3. bzr branch trunk MyProject
> 4. make changes in MyProject and bzr commit
> 5. bzr update trunk
> 6. bzr merge trunk MyProject
>
> Then the server was moved to a new server. With svn a simple "svn
> switch --relocate svn://server2/product/trunk" does the trick since the
> repository was loaded with the same UUID. Using "bzr switch" does not
> work. After I started from scratch, I did find a way to relocate the
> server that seems to work, though I'm not certain if there could be
> ramifications.
This is what the "bzr switch" command is for.

What exactly didn't work when you used "bzr switch
svn://server2/product/trunk" ?

Cheers,

Jelmer
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Wesley J. Landaker (wjl) wrote : Re: svn switch --relocate

FWIW, I started making a reproduction recipe, since I thought I'd seen something like this in the past. However, this worked with no trouble when I tried in with bzr-svn 0.5dev:

mkdir /tmp/bzr-bug-334028
cd /tmp/bzr-bug-334028
svnadmin create svn-repo1
bzr co svn-repo1 bzr-co
cd bzr-co
touch A
bzr add A
bzr commit -m "Adding file A"
cd ..
svnadmin create svn-repo2
svnadmin dump svn-repo1 | svnadmin load --force-uuid svn-repo2
cd bzr-co
bzr switch ../svn-repo2

Brad, you might try running this example and see if it fails for you -- perhaps this was a bug in an older version of bzr-svn?

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 334028] Re: svn switch --relocate

  status incomplete
--
Jelmer Vernooij <email address hidden> - http://samba.org/~jelmer/
Jabber: <email address hidden>

Revision history for this message
Brad Burch (brad-burch) wrote :
Download full text (3.3 KiB)

Well, when I first issued "bzr switch", it failed outright with:

bzr: ERROR: Unable to connect to target of bound branch
BzrBranch6('/PATH_TO_BZR_CHECKOUT/') => svn://server1/product/trunk: Not a
branch: "svn://server1/product/trunk/".

I attribute the error to the fact that the old svn server had been taken
offline so no new commits crept in. The command may likely have completed
properly if the old svn server was still online, however I didn't have that
luxury.

I suppose I was blinded by my experience with svn, expecting a --relocate
switch. Testing the same scenario again today, I see that --force appears
to work just as --relocate would with svn. This is no bug, just ignorance.
Still, hopefully some poor soul with this same problem in the future will
find this report and not start on the wrong foot as I did.

Thanks,
--Brad Burch

On Tue, Feb 24, 2009 at 3:26 PM, Wesley J. Landaker <email address hidden>wrote:

> FWIW, I started making a reproduction recipe, since I thought I'd seen
> something like this in the past. However, this worked with no trouble
> when I tried in with bzr-svn 0.5dev:
>
> mkdir /tmp/bzr-bug-334028
> cd /tmp/bzr-bug-334028
> svnadmin create svn-repo1
> bzr co svn-repo1 bzr-co
> cd bzr-co
> touch A
> bzr add A
> bzr commit -m "Adding file A"
> cd ..
> svnadmin create svn-repo2
> svnadmin dump svn-repo1 | svnadmin load --force-uuid svn-repo2
> cd bzr-co
> bzr switch ../svn-repo2
>
> Brad, you might try running this example and see if it fails for you --
> perhaps this was a bug in an older version of bzr-svn?
>
> --
> svn switch --relocate
> https://bugs.launchpad.net/bugs/334028
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Subversion branch support for Bazaar: New
>
> Bug description:
> I ran into a dead-end trying to get my existing bzr checkout to point to
> our new svn server. There is probably a simple way to do this without
> botching it like I did, but hours of searching yielded no help. I ended up
> creating a new checkout and manually merging in my changes, but hopefully
> this report might be of help to others.
>
> I've been working on a somewhat long-running project not being committed to
> svn. These steps have been working great until we moved our svn server.
> Here are the steps:
> 1. existing svn server with history
> 2. bzr checkout svn://server1/product/trunk trunk
> 3. bzr branch trunk MyProject
> 4. make changes in MyProject and bzr commit
> 5. bzr update trunk
> 6. bzr merge trunk MyProject
>
> Then the server was moved to a new server. With svn a simple "svn switch
> --relocate svn://server2/product/trunk" does the trick since the repository
> was loaded with the same UUID. Using "bzr switch" does not work. After I
> started from scratch, I did find a way to relocate the server that seems to
> work, though I'm not certain if there could be ramifications.
>
> Do not use bzr to do any of this, simple edit these files:
> 1. replace the old repository path in subversion.conf with the new svn
> server path
> 2. replace the old repository path in .bzr\branches\branch.conf with the
> new svn server path
>
> After that, "bzr update" seems to...

Read more...

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: New → Incomplete
Revision history for this message
Jelmer Vernooij (jelmer) wrote :
Download full text (4.0 KiB)

Hi Brad,

It would indeed be nice to have --relocate be an alias for --force, for
people who are used to Subversion such as yourself. I'll leave this bug
open as wishlist for that.

  affects bzr
  status triaged
  importance wishlist
  summary "--relocate alias for bzr switch --force"

  affects bzr-svn
  status invalid

Cheers,

Jelmer

On Tue, 2009-02-24 at 21:40 +0000, Brad Burch wrote:
> Well, when I first issued "bzr switch", it failed outright with:
>
> bzr: ERROR: Unable to connect to target of bound branch
> BzrBranch6('/PATH_TO_BZR_CHECKOUT/') => svn://server1/product/trunk: Not a
> branch: "svn://server1/product/trunk/".
>
> I attribute the error to the fact that the old svn server had been taken
> offline so no new commits crept in. The command may likely have completed
> properly if the old svn server was still online, however I didn't have that
> luxury.
>
> I suppose I was blinded by my experience with svn, expecting a --relocate
> switch. Testing the same scenario again today, I see that --force appears
> to work just as --relocate would with svn. This is no bug, just ignorance.
> Still, hopefully some poor soul with this same problem in the future will
> find this report and not start on the wrong foot as I did.
>
> Thanks,
> --Brad Burch
>
> On Tue, Feb 24, 2009 at 3:26 PM, Wesley J. Landaker
> <email address hidden>wrote:
>
> > FWIW, I started making a reproduction recipe, since I thought I'd seen
> > something like this in the past. However, this worked with no trouble
> > when I tried in with bzr-svn 0.5dev:
> >
> > mkdir /tmp/bzr-bug-334028
> > cd /tmp/bzr-bug-334028
> > svnadmin create svn-repo1
> > bzr co svn-repo1 bzr-co
> > cd bzr-co
> > touch A
> > bzr add A
> > bzr commit -m "Adding file A"
> > cd ..
> > svnadmin create svn-repo2
> > svnadmin dump svn-repo1 | svnadmin load --force-uuid svn-repo2
> > cd bzr-co
> > bzr switch ../svn-repo2
> >
> > Brad, you might try running this example and see if it fails for you --
> > perhaps this was a bug in an older version of bzr-svn?
> >
> > --
> > svn switch --relocate
> > https://bugs.launchpad.net/bugs/334028
> > You received this bug notification because you are a direct subscriber
> > of the bug.
> >
> > Status in Subversion branch support for Bazaar: New
> >
> > Bug description:
> > I ran into a dead-end trying to get my existing bzr checkout to point to
> > our new svn server. There is probably a simple way to do this without
> > botching it like I did, but hours of searching yielded no help. I ended up
> > creating a new checkout and manually merging in my changes, but hopefully
> > this report might be of help to others.
> >
> > I've been working on a somewhat long-running project not being committed to
> > svn. These steps have been working great until we moved our svn server.
> > Here are the steps:
> > 1. existing svn server with history
> > 2. bzr checkout svn://server1/product/trunk trunk
> > 3. bzr branch trunk MyProject
> > 4. make changes in MyProject and bzr commit
> > 5. bzr update trunk
> > 6. bzr merge trunk MyProject
> >
> > Then the server was moved to a new server. With svn a simple "svn switch
> > --relocate svn://server2/product/trunk" doe...

Read more...

Changed in bzr-svn:
status: Incomplete → Invalid
Revision history for this message
Brad Burch (brad-burch) wrote :
Download full text (7.1 KiB)

Actually thinking about it a bit, I think the problem is easily corrected by
extending the error message to something like this:

    bzr: ERROR: Unable to connect to target of bound branch
BzrBranch6('/PATH_TO_BZR_CHECKOUT/') => svn://server1/product/trunk: Not a
branch: "svn://server1/product/trunk/".
    If this branch or repository has been relocated, use bzr switch --force.

I don't think adding another switch alias is necessary. Still, adding a
line to the bzr-svn FAQ might be useful, since that was the first place I
looked for an answer.

BTW, bzr & bzr-svn rock!
It is the only way to roll (literally) for those of us still tethered to svn
servers.

Thanks,
--Brad Burch

On Tue, Feb 24, 2009 at 3:55 PM, Jelmer Vernooij <email address hidden> wrote:

> Hi Brad,
>
> It would indeed be nice to have --relocate be an alias for --force, for
> people who are used to Subversion such as yourself. I'll leave this bug
> open as wishlist for that.
>
> affects bzr
> status triaged
> importance wishlist
> summary "--relocate alias for bzr switch --force"
>
> affects bzr-svn
> status invalid
>
> Cheers,
>
> Jelmer
>
> On Tue, 2009-02-24 at 21:40 +0000, Brad Burch wrote:
> > Well, when I first issued "bzr switch", it failed outright with:
> >
> > bzr: ERROR: Unable to connect to target of bound branch
> > BzrBranch6('/PATH_TO_BZR_CHECKOUT/') => svn://server1/product/trunk: Not
> a
> > branch: "svn://server1/product/trunk/".
> >
> > I attribute the error to the fact that the old svn server had been taken
> > offline so no new commits crept in. The command may likely have
> completed
> > properly if the old svn server was still online, however I didn't have
> that
> > luxury.
> >
> > I suppose I was blinded by my experience with svn, expecting a --relocate
> > switch. Testing the same scenario again today, I see that --force
> appears
> > to work just as --relocate would with svn. This is no bug, just
> ignorance.
> > Still, hopefully some poor soul with this same problem in the future will
> > find this report and not start on the wrong foot as I did.
> >
> > Thanks,
> > --Brad Burch
> >
> > On Tue, Feb 24, 2009 at 3:26 PM, Wesley J. Landaker
> > <email address hidden>wrote:
> >
> > > FWIW, I started making a reproduction recipe, since I thought I'd seen
> > > something like this in the past. However, this worked with no trouble
> > > when I tried in with bzr-svn 0.5dev:
> > >
> > > mkdir /tmp/bzr-bug-334028
> > > cd /tmp/bzr-bug-334028
> > > svnadmin create svn-repo1
> > > bzr co svn-repo1 bzr-co
> > > cd bzr-co
> > > touch A
> > > bzr add A
> > > bzr commit -m "Adding file A"
> > > cd ..
> > > svnadmin create svn-repo2
> > > svnadmin dump svn-repo1 | svnadmin load --force-uuid svn-repo2
> > > cd bzr-co
> > > bzr switch ../svn-repo2
> > >
> > > Brad, you might try running this example and see if it fails for you --
> > > perhaps this was a bug in an older version of bzr-svn?
> > >
> > > --
> > > svn switch --relocate
> > > https://bugs.launchpad.net/bugs/334028
> > > You received this bug notification because you are a direct subscriber
> > > of the bug.
> > >
> > > Status in Subversion branch support for Bazaar: New
> > >
> > > Bug description:
> ...

Read more...

Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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