[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn URL's with '..' elements

From: Chris Pickett <chris.pickett_at_mail.mcgill.ca>
Date: 2005-02-28 19:25:35 CET

Vincent Lefevre wrote:
> On 2005-02-24 11:08:59 -0800, Ben Reser wrote:
>
>>Firefox gives /home/breser if you ask fore
>>file:///home/breser/foo-tmp/..
>
>
> Ditto for Mozilla, links and w3m. However lynx gives the root directory,
> but IMHO this is a bug. The .. rule for URLs is described for relative
> URLs only (RFCs 1808 and 2396), but for consistency, it would be a good
> idea to use this rule for absolute URLs too IMHO.

I think saying .. always removes one element from the specified path and
documenting that clearly would be a good solution.

If your shell is going to screw with the path before it gets to svn (by
following symlinks, or by making the .. adjustment for you), that's
going to happen anyway, even if you disallow .. completely within svn.
If not, then you can dictate what happens (and also give a good
disambiguating error message if needed, by printing the name of the path
before and after removal).

Locally, it seems like .. is only rejected by svn if the resultant path
isn't a WC and you issue your command from within a WC and also use a
relative path.

~/temp $ pwd
/home/chris/temp

~/temp $ ls
sablevm

~/temp $ ls sablevm/
AUTHORS INSTALL LICENSE README THANKS
autogen.sh INSTALL-DEVEL Makefile.am regression
types.header
configure.ac java-sablevm.tmpl NEWS src
doc LGPL-2.1 permute-options svn-commit.tmp~

~/temp $ svn ls sablevm/
.indent.pro
AUTHORS
INSTALL
INSTALL-DEVEL
LGPL-2.1
LICENSE
Makefile.am
NEWS
README
THANKS
autogen.sh
configure.ac
doc/
java-sablevm.tmpl
permute-options
regression/
src/
types.header

~/temp $ svn ls sablevm/..
svn: '.' is not a working copy

~/temp $ cd sablevm/

~/temp/sablevm $ svn ls .
.indent.pro
AUTHORS
INSTALL
INSTALL-DEVEL
LGPL-2.1
LICENSE
Makefile.am
NEWS
README
THANKS
autogen.sh
configure.ac
doc/
java-sablevm.tmpl
permute-options
regression/
src/
types.header

~/temp/sablevm $ svn ls ..
svn: Path '..' ends in '..', which is unsupported for this operation

~/temp/sablevm $ svn ls ../sablevm
.indent.pro
AUTHORS
INSTALL
INSTALL-DEVEL
LGPL-2.1
LICENSE
Makefile.am
NEWS
README
THANKS
autogen.sh
configure.ac
doc/
java-sablevm.tmpl
permute-options
regression/
src/
types.header

~/temp/sablevm $ cd src/

~/temp/sablevm/src $ svn ls
Makefile.am
include/
libsablevm/
sablevm/
spmt/

~/temp/sablevm/src $ svn ls ..
.indent.pro
AUTHORS
INSTALL
INSTALL-DEVEL
LGPL-2.1
LICENSE
Makefile.am
NEWS
README
THANKS
autogen.sh
configure.ac
doc/
java-sablevm.tmpl
permute-options
regression/
src/
types.header

~/temp/sablevm/src $ svn ls ../src/..
.indent.pro
AUTHORS
INSTALL
INSTALL-DEVEL
LGPL-2.1
LICENSE
Makefile.am
NEWS
README
THANKS
autogen.sh
configure.ac
doc/
java-sablevm.tmpl
permute-options
regression/
src/
types.header

~/temp/sablevm/src $ svn ls ../..
svn: Path '../..' ends in '..', which is unsupported for this operation

~/temp/sablevm/src $ svn ls /home/chris/temp/sablevm/src/../..
svn: '/home/chris/temp' is not a working copy

~/temp/sablevm/src $ svn ls file:///home/chris/temp/sablevm/
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///home/chris/temp/sablevm'

~/temp/sablevm/src $ svn ls file:///home/chris/temp/sablevm/..
svn: URL 'file:///home/chris/temp/sablevm/..' contains a '..' element

Cheers,
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Feb 28 19:27:36 2005

This is an archived mail posted to the Subversion Dev mailing list.