แสดงบทความที่มีป้ายกำกับ svn แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ svn แสดงบทความทั้งหมด

วันจันทร์ที่ 3 มีนาคม พ.ศ. 2557

continuing svnsync from svn hotcopy

svnsync can be a time-consuming process if your revision is big. In this case, I will show how to continue the svnsync from hotcopy


1. Backup current by hotcopy
- svnadmin hotcopy /svn/repos/repos1/ /tmp/repos1

2. Copy data(/tmp/repos1) to new svn server directory /svn/repos/ (svn repository root) 

3. (optional) Upgrade SVN version property in case new SVN sever is  newer than old SVN server
- svnadmin upgrade

4. Initial SVN property for start svnysnc 
- svn propset --revprop -r0 svn:sync-last-merged-rev revno svn://hostname/reposname/
- svn propset --revprop -r0 svn:sync-from-uuid uuid svn://hostname/reposname/
- svn propset --revprop -r0 svn:sync-from-url svn://oldhost/reposname/ svn://hostname/reposname/

5. Sync data from old repos to new repos
- svnsync --non-interactive sync svn://hostname/reposname/

svnadmin dump, svnadmin load

svnadmin dump, svnadmin load
This sub-command can be use for back up and restore svn repository


Dump repository from SVN server
1. Dump SVN database from SVN server
- svnadmin dump /svn/repos/repos1/ | gzip -9 > /tmp/repos1.dump.gz

2. Copy file repos1.dump.gz for back up 

Restore from dumped repository
3. get svn server installed

4. Import SVN data from dump file with this command
- zcat repos1.dump.gz | svnadmin load /svn/repos/newrepos/

Mirroring svn


Mirror SVN server (and replace master server)

1. Install Mirror SVN server

2. Allow svnsync command permission 
- echo '#!/bin/sh' > /svn/repos/repos1/hooks/pre-revprop-change
- chmod +x /svn/repos/repos1/hooks/pre-revprop-change

3. Initial svnsync configure
- svnsync init svn://mirror/repos1/ svn://original/repos1/

 4. Start sync svn data
- svnsync --non-interactive sync svn://mirror

5. Setup schedule to resync svn
- crontab -e 
*/30 * * * * svnsync --non-interactive sync svn://mirror > /dev/null

- /etc/init.d/cron reload


In case you need mirror replace the master
- svnadmin setuuid /svn/repos/repos1/ uuid

replace   uuid from  /svn/repos/repos1/db/uuid 

svn/subversion server installation

Here are a short note for setting subversion server.

1. Install SVN server (subversion)
- apt-get install subversion

2. Create svnuser account
- useradd -m -s /bin/bash svnuser 

3. Create subversion working directory
- mkdir -p /svn/repos/
- chown svnuser.svnuser -R /svn/
- cd /svn/repos/

4. Change user access to svnuser
- su svnuser

5. Create svm repository
- svnadmin create repos1

6. Config repository password
- vi /svn/repos/repos1/conf/svnserve.conf

#####
anon-access = none
auth-access = write
password-db = passwd
#####

repository password file
- vi /svn/repos/repos1conf/passwd
#username and password example
user1 = pass1
- chmod 600 /home/ddsvn/wwwsvn/conf/passwd


7. Start SVN service
#login to svnuser account
- su svnuser
- svnserver -d -r /svn/repos/

8. Set svn start up on boot with user svnuser
- vi /etc/rc.local

#####
su svnuser -c "svnserve -d -r /svn/repos“
#####

วันศุกร์ที่ 8 มกราคม พ.ศ. 2553

optimize Tortoise SVN cache

From : http://www.paraesthesia.com/archive/2007/09/26/optimize-tortoise-svn-cache-tsvncache.exe-disk-io.aspx


To optimize the disk usage...

  1. Right-click on your desktop and select "TortoiseSVN -> Settings..."
  2. In the tree view, find the "Look and Feel/Icon Overlays" branch.
  3. In the "Exclude Paths" box, put C:\* to exclude the entire C drive. If you have more drives than that, exclude them all at the top level. Separate the values by newlines.
  4. In the "Include Paths" box, list all of the locations you have working copies, separated by newlines. Again, this is easier if you keep all of your working copies in a specific folder or set of folders. Using my example, this is what I put in the "Include Paths" box:
    C:\dev\*
    C:\Documents and Settings\tillig\My Documents\Visual Studio 2005\*
    C:\Documents and Settings\tillig\My Documents\Visual Studio Projects\*


    And here's a screen shot:
    TortoiseSVN icon overlay options - set the "Exclude paths" and "Include paths" values
  5. Click OK to apply the changes.
  6. Either reboot or open Task Manager and kill "TSVNCache.exe" so it restarts when needed. You have to restart it for these options to take effect.

After I did this, the icon overlays still worked great but the disk I/O went down to nearly nothing. YMMV.