Thursday, January 27, 2011

how i can get all svn repository in notpad or excel sheet for example ? (OS = sunsolaris)

after execute $svn list command i found a large number of repository ...and it is complex to find all repository(some svn repository exist in folder within folder within folder and so on) ...if you can help me by give me a method to design a something to write this repository list in excel sheet or notpad for example (OS = sunsolaris)

  • Shell redirection (">") to a text file?
    Shell pipe ("|") to any given program?
    Plain old cut & paste from a terminal emulator (such as Putty)?

    This can be done in just so many ways...

    From Massimo
  • You're doing it wrong!

    Instead of manually trying to find something and copying & pasting everything around all the time, please learn the basics of Linux/Unix shell. It WILL boost your productivity through the roof.

    Don't believe me?

    Let's suppose you need to find where a repository called myimportantrepository is located. This will find it for you:

    svn list | grep myimportantrepository
    

    If you want to see couple of lines before and after that match, grep parameter -C will help you. This would print 5 lines of text before and after the found match:

    svn list | grep -C5 myimportantrepository
    
  • The basic idea is that you will have to write a shell or python script to traverse your SVN tree and then print the names of your directories.

    In SVN a repository holds folders. What you are referring to a as a repository may only be a folder? In that case you have to figure out how to tell what is a repository or not.

    It is not trivial, one way I can think of is to use python on the output of

    svnlook tree --full-paths
    

    Then you can grep the lines which end with a '/' to filter only directories. Then assuming the 'repositories' you are looking for have a 'trunk', 'branches' and 'tags' subdirectory. You can figure out which folders are 'repositories'

    I don't see a simpler way.

    Osama Ahmad : i want to ask you this command show all level ... how i can show just two level
    Amala : You can simply truncate what you don't need, the svnlook command has limited functionality, but is many times easier than writing your own access to SVN repositories.
    Amala : The 'svnlook' command works directly on the repository on the disk, has to be run on the server SVN is running. The 'svn look' command given above works as a client.
    From Amala

0 comments:

Post a Comment