Friday, January 28, 2011

How i can List directory entries in the repository ? (i have a large number of repository)

I know "list command" -> List directory entries in the repository ... but my problem is i have a large number of repository ... if i want to perform list command to each repository the result is large number of command ...and you must not forget enter the password for each command ... so it hard work and not logical

  • If you have shell access to the server that hosts your repositories (and read permission on the repository directories themselves), you could do something like this:

    for i in /parent/path/of/repos/* ; do
        # while not a perfect check for a repository, it's likely
        # right unless you're doing something very weird.
        if [-d "$i"] && [-f "$i/format"] ; then
            svn ls "file://$i"
        fi
    done
    

    You can also replace svn ls with svnlook tree, depending on the kind of output you're looking for (svnlook tree produces output similar to that tree).

    If you have to access the repositories remotely, you're stuck using the svn command, unfortunately. If you have list of the repositories in, say, a file (or can get the list in a programmatic way, hard to give a concrete example without a better idea of how your Subversion server is configured), you can do do a similar for loop and make use of the --username and --password options to svn.

    From mark

0 comments:

Post a Comment