Announcement

Collapse
No announcement yet.

Import snapshot folders, requesting step-by-step guide for using svn_load_dirs.pl

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Import snapshot folders, requesting step-by-step guide for using svn_load_dirs.pl

    I need a step-by-step guide (willing to buy a book) on how to use svn_load_dirs.pl to import a series of snapshots of my code in folders.

    I've developed code locally and taken a fairly regular snapshot whenever I reach a significant point in development, e.g. a working build.

    So I have a long-ish list of about 40 folders, each folder being a snapshot e.g. in ascending date YYYYMMDD order, e.g.:-

    20100523
    20100614
    20100721
    20100722
    20100809
    20100901
    20101001
    20101003
    20101104
    20101119
    20101203
    20101218
    20110102

    I want to use svn_load_dirs.pl to import each of these snapshots as a new subversion revision to the source tree. The end result being that the HEAD revision is the same as the last snapshot, and other revisions are as numbered.

    Some other requirements:

    that the HEAD revision is not cumulative of the previous snapshots, i.e., files that appeared in older snapshots but which don't appear in later ones (e.g. due to refactoring etc.) should not appear in the HEAD revision.

    Meanwhile, there should be continuity between files that do persist between snapshots. Subversion should know that there are previous versions of these files and not treat them as brand new files within each revision.

    I need to formally revision control this work rather than keep local private snapshot copies.

    I am aware that using svn_load_dirs.pl for this purpose should be possible, from the post:

    http://www.svnforum.org/threads/3451...l-full-backups

    ...however this does not provide enough detail, step by step. I have attempted to use svn_load_dirs.pl but got error messages:

    C:\>svn_load_dirs.pl -t 20090604 http://127.0.0.1:9890/ubersvn/repo/trunk/ repo "Y:\My Documents\assignments\code\20090604"
    Use of uninitialized value $ENV{"HOME"} in concatenation (.) or string at C:\svn_load_dirs.pl line 194.
    Directory Y:\My Documents\assignments\code\20090604 will be tagged as 20090604
    Please examine identified tags. Are they acceptable? (Y/n) Y

    Checking that the base URL is a Subversion repository.
    Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9890/ubersvn/repo/trunk
    svn: Repository moved temporarily to 'http://127.0.0.1:9890/ubersvn/views/platform/shared/welcome.jsf'; please relocate
    C:\svn_load_dirs.pl: C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe log -r HEAD --non-interactive http://127.0.0.1:9890/ubersvn/repo/trunk failed with this output:

    Press return to quit and clean up svn working directory:



    [no directory is given after the colon]

    * P.S. I have changed the path names for commercial reasons but they should all match up so as to not make you think that my problem is actually a typo (e.g. things like repo etc.)
    Last edited by arjaydavis; 04-24-2012, 08:49 AM. Reason: path names changed for security / commercial reasons

  • #2
    Anyone? This forum does not seem very helpful. Standard Subversion tools like svn_load_dirs.pl don't seem to work with UberSVN out of the box, nor is there any specific instructions to get it going.

    Comment


    • #3
      Sorry for the delay in this response.

      Looking at those examples shows that you are trying to access your repositories via the ubersvn admin console port and not your apache port which is 9880 by default. Can you confirm that in a web browser you can access your repositories at http://127.0.0.1:9880/repo/trunk ?

      uberSVN installs both a tomcat web server on port 9890 (default) for access to the admin ui and apache on port 9880 (default) for access to your svn repositories.

      Comment


      • #4
        Here is a screenshot that shows you how to find out what URL you need to use to access your repositories:

        http://mbooth.fedorapeople.org/screenshot-uber-repo.png

        Comment


        • #5
          Originally posted by John.Chambers View Post
          Sorry for the delay in this response.

          Looking at those examples shows that you are trying to access your repositories via the ubersvn admin console port and not your apache port which is 9880 by default. Can you confirm that in a web browser you can access your repositories at http://127.0.0.1:9880/repo/trunk ?
          Yes I can (replacing 'repo' with my repository name)

          Still need to find root cause of error...
          Last edited by arjaydavis; 10-17-2011, 11:31 AM.

          Comment


          • #6
            Originally posted by mbooth View Post
            Here is a screenshot that shows you how to find out what URL you need to use to access your repositories:

            http://mbooth.fedorapeople.org/screenshot-uber-repo.png
            Yep, fine...

            Still need to find root cause of error

            Comment


            • #7
              Have you tried these commands with the correct url's becuase the ones you have quoted will not work becasue you are accessing via the wrong port.

              Comment


              • #8
                Please post the error you are getting now you are using the correct URL...

                Comment


                • #9
                  Originally posted by mbooth View Post
                  Please post the error you are getting now you are using the correct URL...
                  OK (thank you @mbooth, but yes still no solved),
                  1) Changed the port to be the correct port, 9880 in the call to svn_load_dirs.pl from the command line (see output below) and
                  2) setup the correct path for the subversion config (see code snippet below)


                  code snippet:

                  Code:
                  #elsif ( -f "$ENV{HOME}/.subversion/config" )
                  elsif ( -f "C:/Users/rdavis/AppData/Roaming/Subversion" )
                    {
                      #open my $conf, "$ENV{HOME}/.subversion/config";
                  	open my $conf, "C:/Users/rdavis/AppData/Roaming/Subversion";

                  # commented out lines were before my change, lines following are modified following your advice.




                  (Attempt to run the script again (my repo is 'nsr', I'll leave this unchanged in the snippets I quote and the snapshot folders, rather than make them something generic, as I have to manually go through and change them and I could make a mistake and leave one instance unchanged, leading to confusion).)

                  dump of command line:

                  Code:
                  C:\>svn_load_dirs.pl -t 20090604_goldstar_backup http://127.0.0.1:9880/ubersvn/nsr/trunk/ nsr "Y:\My Documents\assignments\nsr\code\20090604_goldstar_backup"
                  Directory Y:\My Documents\assignments\nsr\code\20090604_goldstar_backup will be tagged as 20090604_goldstar_backup
                  Please examine identified tags.  Are they acceptable? (Y/n) Y
                  
                  Checking that the base URL is a Subversion repository.
                  Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880/ubersvn/nsr/trunk
                  svn: OPTIONS of 'http://127.0.0.1:9880/ubersvn/nsr/trunk': 200 OK (http://127.0.0.1:9880)
                  C:\svn_load_dirs.pl: C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe log -r HEAD --non-interactive http://127.0.0.1:9880/ubersvn/nsr/trunk failed with this output:
                  
                  Press return to quit and clean up svn working directory:

                  Still failing unfortunately.
                  Last edited by arjaydavis; 10-17-2011, 12:46 PM.

                  Comment


                  • #10
                    Are you absolutely sure that the URL is correct?

                    This is what you are using:

                    http://127.0.0.1:9880/ubersvn/nsr/trunk/

                    Are you sure it shouldn't be this:

                    http://127.0.0.1:9880/nsr/trunk/

                    I'd appreciate it if you at least try these URLs in your browser to make sure you can see the repository.

                    Comment


                    • #11
                      Originally posted by mbooth View Post
                      Are you absolutely sure that the URL is correct?

                      This is what you are using:

                      http://127.0.0.1:9880/ubersvn/nsr/trunk/

                      Are you sure it shouldn't be this:

                      http://127.0.0.1:9880/nsr/trunk/

                      I'd appreciate it if you at least try these URLs in your browser to make sure you can see the repository.
                      Yes, sorry, doing this takes me further along the process but the resulting repo nsr is still empty (new errors below):

                      Code:
                      C:\>svn_load_dirs.pl -t 20090604_goldstar_backup http://127.0.0.1:9880/nsr/trunk/ nsr "Y:\My Documents\assignments\nsr\code\20090604_goldstar_backup"
                      Directory Y:\My Documents\assignments\nsr\code\20090604_goldstar_backup will be tagged as 20090604_goldstar_backup
                      Please examine identified tags.  Are they acceptable? (Y/n) Y
                      
                      Checking that the base URL is a Subversion repository.
                      Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880/nsr/trunk
                      
                      Finding the root URL of the Subversion repository.
                      Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880
                      svn: OPTIONS of 'http://127.0.0.1:9880': 200 OK (http://127.0.0.1:9880)
                      Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880/nsr
                      Determined that the svn root URL is http://127.0.0.1:9880/nsr.
                      
                      Native EOL on this system is \015\012.
                      
                      Finding if any directories need to be created in repository.
                      Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880/nsr/trunk/nsr
                      No directories need to be created to prepare repository.
                      Checking out http://127.0.0.1:9880/nsr/trunk/nsr into C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_ATrGGCJoWv/my_import_wc
                      Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" checkout --non-interactive http://127.0.0.1:9880/nsr/trunk/nsr my_import_wc
                      
                      Loading Y:\My Documents\assignments\nsr\code\20090604_goldstar_backup and will save in tag 20090604_goldstar_backup.
                      [snip]

                      Code:
                      A   nsr/legacy
                      A   nsr/legacy/readme.txt
                      etc. etc.

                      [/snip]

                      and then...

                      Code:
                      svn: Can't move source to dest
                      svn: Can't move
                      (can't give the names of the source snapshot folder paths right now, due to commercial sensitivity)

                      Any idea what that cause is likely to be?

                      Also saw:

                      Code:
                      cannot remove path when cwd is C:/Users/rdavis/AppData/Local/Temp/svn_load_dirs_ATrGGCJoWv/my_import_wc for C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_ATrGGCJoWv:  at C:\svn_load_dirs.pl line 20
                      60

                      Comment


                      • #12
                        Originally posted by arjaydavis View Post
                        Code:
                        svn: Can't move source to dest
                        svn: Can't move
                        (can't give the names of the source snapshot folder paths right now, due to commercial sensitivity)
                        Maybe the source snapshot is too long, it is a long path, I will try a shorter path...

                        Comment


                        • #13
                          Originally posted by arjaydavis View Post
                          Maybe the source snapshot is too long, it is a long path, I will try a shorter path...
                          Yes I think that is one of the last few problems I have now. I created a test folder with just a file in it, i.e. no deep subfolder paths. The code is in the repo but although the code appears in the repo, it appears in the trunk as 20111017testcode (I would want the contents to appear in the repo and for subsequent imports to overlay onto this), but the tags folder is empty.

                          Code:
                          C:\>svn_load_dirs.pl -t 20111017testcode http://127.0.0.1:9880/nsr/trunk/ nsr "Y:\My Documents\assignments\nsr\code\20111017testcode"
                          Directory Y:\My Documents\assignments\nsr\code\20111017testcode will be tagged as 20111017testcode
                          Please examine identified tags.  Are they acceptable? (Y/n) Y
                          
                          Checking that the base URL is a Subversion repository.
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880/nsr/trunk
                          
                          Finding the root URL of the Subversion repository.
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880
                          svn: OPTIONS of 'http://127.0.0.1:9880': 200 OK (http://127.0.0.1:9880)
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880/nsr
                          Determined that the svn root URL is http://127.0.0.1:9880/nsr.
                          
                          Native EOL on this system is \015\012.
                          
                          Finding if any directories need to be created in repository.
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" log -r HEAD --non-interactive http://127.0.0.1:9880/nsr/trunk/nsr
                          No directories need to be created to prepare repository.
                          Checking out http://127.0.0.1:9880/nsr/trunk/nsr into C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD/my_import_wc
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" checkout --non-interactive http://127.0.0.1:9880/nsr/trunk/nsr my_import_wc
                          
                          Loading Y:\My Documents\assignments\nsr\code\20111017testcode and will save in tag 20111017testcode.
                          A   nsr
                          A   nsr/nsr.txt
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" add -N --targets C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD/targets.00001
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" commit --non-interactive --file C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD\XLW1IBjTng
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" update --non-interactive
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" cp --non-interactive --file C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD\U5eGq5TXFm http://127.0.0.1:9880/nsr/trunk/nsr htt
                          p://127.0.0.1:9880/nsr/trunk/20111017testcode
                          Checking out http://127.0.0.1:9880/nsr/trunk/20111017testcode into C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD/my_tag_wc_named_20111017testcode
                          Running "C:\Program Files (x86)\WANdisco\uberSVN\bin\svn.exe" checkout --non-interactive http://127.0.0.1:9880/nsr/trunk/20111017testcode my_tag_wc_named_20111017testcode
                          Running diff -u -x .svn -r "Y:\My Documents\assignments\nsr\code\20111017testcode" C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD/my_tag_wc_named_20111017testcode
                          C:\svn_load_dirs.pl: diff -u -x .svn -r Y:\My Documents\assignments\nsr\code\20111017testcode C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD/my_tag_wc_named_20111017testcode failed with t
                          his output:
                          Usage: diff <file1> <file2>
                          Press return to quit and clean up svn working directory:
                          Cleaning up C:\Users\rdavis\AppData\Local\Temp\svn_load_dirs_jlXMeLQreD
                          C:\>
                          Last few things to iron out:

                          1) The diff fails, not sure why at the moment

                          2) What should I expect regarding tags (my command includes this) as I want to tag the snapshots. Although the code appears in the repo, it appears in the trunk as 20111017testcode, but the tags folder is empty.

                          Comment


                          • #14
                            Code goes in the &quot;right&quot; place now

                            Previously I had this:

                            svn_load_dirs.pl -t 20111017testcode http://127.0.0.1:9880/nsr/trunk/ nsr "Y:\My Documents\assignments\nsr\code\20111017testcode"

                            And the imported code was placed in the "wrong" place - i.e. the imported snapshot appeared as a folder in the trunk folder.

                            The correct command I should use is:

                            svn_load_dirs.pl -t tags/20111017testcode http://127.0.0.1:9880/nsr/ trunk "Y:\My Documents\assignments\nsr\code\20111017testcode"

                            This does 2 things:
                            1) This specifies the tags folder as tags/20111017testcode which ensures that the imported folder goes in the tags folder
                            2) the trunk argument ensures that the code is also imported to the trunk.

                            The outcome being as required:
                            - The trunk (main line) is up to date with the imports
                            - Each distinct import is accessible via its tag based on its original folder name
                            - SVN convention is followed whereby trunk is used for the trunk and tags folder is used for the distinct snapshots in time (i.e. the distinct imports)

                            See also similar problem described (and solved) in: http://www.svnforum.org/threads/4049...l=1#post119081
                            Last edited by arjaydavis; 04-23-2012, 03:29 PM.

                            Comment


                            • #15
                              One more thing, svn_load_dirs.pl calls a diff program to perform a consistency check to see if it successfully imported the files.

                              A diff utility program is therefore required to satisfy this external command call. The following appears to be recommended for the Windows platform
                              http://gnuwin32.sourceforge.net/packages/diffutils.htm

                              (It's a free opensource tool, there is a .dll package that needs downloading)

                              More information on usage is here:
                              http://davestechshop.net/running-svn...irs-on-windows

                              Comment

                              Working...
                              X