explicit URL for pull command: bzr eats trailing slash from URL and then complains about permanent redirection

Bug #397046 reported by Alexander Belchenko
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Bazaar Subversion Plugin
Invalid
Low
Unassigned

Bug Description

C:\work\Bazaar\bzr-repo\bzr>bzr info
Repository tree (format: pack-0.92)
Location:
  shared repository: C:/work/Bazaar/bzr-repo
  repository branch: .

Related branches:
  parent branch: http://bazaar-vcs.org/bzr/bzr.dev/

C:\work\Bazaar\bzr-repo\bzr>bzr pull
Using saved parent location: http://bazaar-vcs.org/bzr/bzr.dev/
No revisions to pull.

C:\work\Bazaar\bzr-repo\bzr>bzr pull http://bazaar-vcs.org/bzr/bzr.dev/
http://bazaar-vcs.org/bzr/bzr.dev is permanently redirected to http://bazaar-vcs.org/bzr/bzr.dev/
No revisions to pull.

The last pull command provides explicit URL with trailing slash, but bzr eats it and then complains about redirection because bzr used URL without trailing slash.

This counter-intuitive behavior affects qpull command from QBzr plugin, because qpull run `bzr pull URL` under the hood.

Changed in qbzr:
importance: Undecided → Low
status: New → Triaged
description: updated
tags: added: qpull
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 397046] [NEW] explicit URL for pull command: bzr eats trailing slash from URL and then complains about permanent redirection

this is a dupe, I don't recall the other bugs number offhand

Vincent Ladeuil (vila)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
Changed in qbzr:
status: Triaged → Confirmed
Revision history for this message
Eugene Tarasenko (etarasenko) wrote :

I tests pull command on svn repository with and without trailing slash, but bazaar always complains about permanent redirection.

C:\Temp\bzr>bzr branch http://opo/svn/common/trunk/lib/Tri
Branched 20 revision(s).

C:\Temp\bzr\Tri>bzr pull
Using saved parent location: http://opo/svn/common/trunk/lib/Tri
No revisions to pull.

C:\Temp\bzr\Tri>bzr pull http://opo/svn/common/trunk/lib/Tri
http://opo/svn/common/trunk/lib/Tri is permanently redirected to http://opo/svn/common/trunk/lib/Tri/
No revisions to pull.

C:\Temp\bzr\Tri>bzr pull http://opo/svn/common/trunk/lib/Tri/
http://opo/svn/common/trunk/lib/Tri is permanently redirected to http://opo/svn/common/trunk/lib/Tri/
No revisions to pull.

Also I tests pull command on bazaar repository with and without trailing slash, it is ok.

C:\Temp\bzr>bzr branch bzr+http://opo/bzr/test/trunk test
Branched 122 revision(s).

C:\Temp\bzr\test>bzr pull
Using saved parent location: bzr+http://opo/bzr/test/trunk/
No revisions to pull.

C:\Temp\bzr\test>bzr pull bzr+http://opo/bzr/test/trunk
No revisions to pull.

C:\Temp\bzr\test>bzr pull bzr+http://opo/bzr/test/trunk/
No revisions to pull.

I use windows standalone bazaar 2.0.1

Revision history for this message
John A Meinel (jameinel) wrote :

Eugene, I think you just don't have a server that tells you about the redirection.

The specific cause is because we first check if the mentioned path is a bundle to be merged, rather than a branch. And we do that after stripping the trailing slash. (So we check if "http://bazaar-vcs.org/bzr/bzr.dev" is a bundle, and then try http://bazaar-vcs.org/bzr/bzr.dev/.bzr/branch-format to see if it is a branch.)

Part of the problem is that the layering means that even if the user supplies "http://bazaar-vcs.org/bzr/bzr.dev/" we still remove that trailing slash and check anyway. So step 1 is to not do that.

Step 2 is that it will still fail on Launchpad code hosting, because "http://bazaar.launchpad.net/~user/project/branch/" is always redirected to "http://bazaar.launchpad.net/~user/project/branch/changes" so that when you access a branch via HTTP you end up seeing the loggerhead view.

Note that if bzr just didn't tell the user about the redirection, I don't think that anyone would notice or really care about the problem.

Revision history for this message
Eugene Tarasenko (etarasenko) wrote :

I dont understand why work with svn and bzr repositories should differ? In my example access to bzr repository is ok but access to svn tells about the redirection. I try work both methods - with and without slash.

Revision history for this message
Eugene Tarasenko (etarasenko) wrote :

This error occurs with access to svn repository, on native bzr repository is ok.

affects: qbzr → bzr-svn
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

bzr-svn strips the slash from the URL because the subversion libraries assert() that URLs don't have trailing slashes.

Changed in bzr-svn:
status: Confirmed → Triaged
Changed in bzr:
status: Confirmed → Invalid
Revision history for this message
Alexander Belchenko (bialix) wrote :

Jelmer, why you have marked bug as Invalid for bzr?

Changed in bzr:
status: Invalid → Confirmed
Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 397046] Re: explicit URL for pull command: bzr eats trailing slash from URL and then complains about permanent redirection

On Thu, 2010-04-08 at 04:33 +0000, Alexander Belchenko wrote:
> Jelmer, why you have marked bug as Invalid for bzr?
It's a bzr-svn, not a bzr issue.

Cheers,

Jelmer

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

Jelmer Vernooij пишет:
> On Thu, 2010-04-08 at 04:33 +0000, Alexander Belchenko wrote:
>> Jelmer, why you have marked bug as Invalid for bzr?
> It's a bzr-svn, not a bzr issue.

IIUC, this happens inside bzr too.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

On Thu, 2010-04-08 at 09:05 +0000, Alexander Belchenko wrote:
> Jelmer Vernooij пишет:
> > On Thu, 2010-04-08 at 04:33 +0000, Alexander Belchenko wrote:
> >> Jelmer, why you have marked bug as Invalid for bzr?
> > It's a bzr-svn, not a bzr issue.
>
> IIUC, this happens inside bzr too.

I haven't seen it reproduced using Bazaar itself, unless you're talking
about the unconditional removal of the last character that was present
in one command.

Cheers,

Jelmer

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Sorry, my bad. This is actually a bzr and not a bzr-svn issue. We pass the stripped URL to the svn libs but we don't fix the URL in the python code anywhere.

Changed in bzr-svn:
status: Triaged → Invalid
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.