Problems with percent and/or colon in paths

Asked by Phil Black on 2010-02-09

I have a repository with a file that had a percent symbol in it, and while I have no problems getting info when running commands against the local tree, I get errors if trying to access via bzr+ssh or over http. For example

> ls bzr branch bzr+ssh://server/foobar/trunk fooboar
> bzr ls foobar
foobar/somefile%3a.txt
> bzr ls bzr+ssh://server/foobar/trunk
bzr+ssh://werver/foobar/trunk/somefile%3a.txt
> bzr log foobar/somfile%3a.txt
<some log history>
> bzr log bzr+ssh://server/foobar/trunk/somefile%3a.txt
bzr: ERROR: Path unknown at end or start of revision range: somefile:.txt

I've tried with a couple of other paths, all with similar results. It seems that at some point bzr is percent decoding the file names. Even more confusing is that it seems to do it multiple times, but I can't figure out a way to get info about the particular file. For example, I get the following:

> bzr log bzr+ssh://server/foobar/trunk/somefile%253a.txt
bzr: ERROR: Path unknown at end or start of revision range: somefile:.txt

> bzr log bzr+ssh://server/foobar/trunk/somefile%25%25%3a.txt
bzr: ERROR: Path unknown at end or start of revision range: somefile%:.txt

> bzr log bzr+ssh://server/foobar/trunk/somefile%25%25%%253a.txt
bzr: ERROR: Path unknown at end or start of revision range: somefile%%:.txt

For some reason, it always urldecodes the last sequence. In general, I don't much care if bzr cannot support %'s in filenames, but if it can't then it would be nice to be prevented when the attempt to 'bzr add' is made.

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
2010-02-09
Last reply:
2010-02-10
Phil Black (phil-black) said : #1

Sorry, my question is how to deal with this? What symbols are illegal in a bzr path, and/or how do I correctly encode a path to be access just the information on a particular file with a percent?

Martin Pool (mbp) said : #2

On 10 February 2010 08:24, Phil Black
<email address hidden> wrote:
> Question #100475 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/100475
>
> Phil Black gave more information on the question:
> Sorry, my question is how to deal with this?  What symbols are illegal
> in a bzr path, and/or how do I correctly encode a path to be access just
> the information on a particular file with a percent?

% is supported in filenames. Backslash and newline are forbidden at
the moment; we would like to relax that.

URLs are URL encoded, so escaping % to %25 should work. This is probably a bug.

--
Martin <http://launchpad.net/~mbp/>

Ralf Doering (rdoering) said : #3

Is there some official specification/documentation which mentions that backslashes and newlines are forbidden in filenames?

Martin Pool (mbp) said : #4

On 10 February 2010 19:37, Ralf Doering
<email address hidden> wrote:
> Question #100475 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/100475
>
> Ralf Doering posted a new comment:
> Is there some official specification/documentation which mentions that
> backslashes and newlines are forbidden in filenames?

We consider the limit to be a bug and there are bugs for them.

--
Martin <http://launchpad.net/~mbp/>

Can you help with this problem?

Provide an answer of your own, or ask Phil Black for more information if necessary.

To post a message you must log in.