Reputation: 43235
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
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
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
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