DhruvPathak
DhruvPathak

Reputation: 43235

SVN list directories without having the latest checkout?

The command svn list will give me list of all the sub directories in the present directory. However,it is only restricted to directories which are present in current version.

eg. say repository url is :

"http://www.example.com/svncode/mainproduct/trunk" and inside trunk, there are 3 directories

trunk/
     1/
     2/
     3/

If I do svn list it will show me all the directories 1 2 3 . Now somebody else does a commit in trunk, which adds another directory 4 inside trunk. Is there a way to check existence of that directory without first taking an update ? As svn list only provides information till latest svn update , not about changes that happened after that .

Background : I want to retreive the latest directory present inside trunk ( largest number means latest, 4 in this case), and want to checkout only that part of the trunk codebase, not full trunk .

Upvotes: 3

Views: 5409

Answers (6)

Lonnie
Lonnie

Reputation: 86

If the location within the repositories' paths for the trunk-branches-tags fork is inconsistent, we have to use a filter like @bernard-de-rubinat suggests but alter it like:

svn ls -R https://some.server.com/svn/someRoot | grep '/trunk/$'

This selects only the output of the recursive ls that matches the pattern of being a string ending with .../trunk/.

That will select only directories named trunk.

Upvotes: 0

rflmyk
rflmyk

Reputation: 569

for SVN local use:

svn ls svn://yourlocaladdresssvn

Upvotes: 0

bluenote10
bluenote10

Reputation: 26540

As mentioned in other answers: Use svn list on a repository URL.

Note that if you have trouble remembering/typing the URL you can use the output of svn info to obtain the URL corresponding to the current working directory. In combination:

svn list `svn info | grep URL | cut -b6-`

Upvotes: 1

Bernard de Rubinat
Bernard de Rubinat

Reputation: 81

If you are only interested in directories and want to exclude files:

svn list -R http://www.example.com/svncode/mainproduct/trunk| grep -E  '/$'

Upvotes: 2

manojlds
manojlds

Reputation: 301097

You can ls on server:

svn ls http://server/repo

Upvotes: 5

David Chan
David Chan

Reputation: 7505

 svn ls http://www.example.com/svncode/mainproduct/trunk

Upvotes: 6

Related Questions