서버를 계속 살리지 못하고 있는 상황에서 가장 곤란한점은 작업한 내용의 공유가 힘들어졌다는 것이다. 무엇보다도 CVS로 가지고 있던 것을 옮겨야 겠는데 기왕 옮기는 김에 SVN으로 옮기면 어떨까 한다. 

찾아보니 외국 사이트에 관련된 내용이 있어 우선 스크랩...

[출처] http://sam.zoy.org/writings/programming/svn2cvs.html

HOWTO: smooth CVS to SVN migration (and back again)

This page explains how I migrated the VideoLAN CVS repositories to Subversion while still allowing anonymous CVS access for users who did not want to move to Subversion. If you are a CVS user and have not yet fallen in love with Subversion, I suggest you have a look at this excellent project. In fact, I recommend to be familiar with Subversion before reading this document, because I may have missed important things.

The idea is to migrate the CVS repository to a Subversion repository using cvs2svn, disable CVS accounts (except read-only accounts such as anonymous) and set up post-commit hooks to replicate SVN commits back to the CVS repository.

First step: cvs2svn

Here are the preparatory steps to migrate a CVS module wooyay from the CVS root /cvs/stuff to a new SVN repository/svn/wooyay:

svnadmin create /svn/wooyay
cvs2svn -s /svn/wooyay /cvs/stuff/wooyay
svn ls file:///svn/wooyay
branches/
tags/
trunk/
$

That’s all! Your SVN repository is created. The default layout is a bit special but quite handy: tags are in tags/, branches are inbranches/, and HEAD is trunk.

Don’t forget to backup your old CVS tree! It might be useful if something ever gets wrong.

Repository cleaning

Now that your repository is created, you can use Subversion’s magical powers to do whatever you want to the repository, such as removing and renaming branches or tags. These steps are not mandatory but you might find them convenient.

CVS branch names cannot start with a digit or contain periods, and you end up with branches called v1_2_3 instead of 1.2.3. And I don’t like that. Here is an example of what I would do:

svn ls file:///svn/wooyay/branches
test/
v1_0/
v2_0/
svn rm file:///svn/wooyay/branches/test -m "removed branch"
svn mv file:///svn/wooyay/branches/v1_0 file:///svn/wooyay/branches/1.0 -m "renamed branch"
svn mv file:///svn/wooyay/branches/v2_0 file:///svn/wooyay/branches/2.0 -m "renamed branch"
svn ls file:///svn/wooyay/branches
1.0/
2.0/
$

I also like to import .cvsignore files to Subversion properties and set the "Id" keyword properties for files containing the "$Id:" special string. If your repository is big, you might want to do this change only for trunk/ and the still active branches.

svn checkout file:///svn/wooyay/trunk workingdir
cd workingdir/
find -name .cvsignore | while read file; do
    svn propset svn:ignore "`cat "$file"`" "`echo "$file" | sed 's,/[^/]*$,,'`"
  done

find . -type f -a '(' -path '*/.*' -prune -o -print ')' | while read file; do
    if grep -q '\$Id:' "$file" && ! svn propget svn:keywords "$file" | grep -q '^Id$'; then svn propset svn:keywords Id "$file"; fi
  done

svn commit -m "imported svn:ignore and svn:keywords properties"
$

The post-commit hook

This is the important part. My svn_cvsinject script can be used to reinject SVN commits into the old CVS directory. Use option-r to specify the revision to reinject, and -a to do branch aliases. In our example, this would be the contents of the/svn/wooyay/hooks/post-commit file:

#!/bin/sh
REPOS="$1"
REV="$2"
svn_maillog "$REPOS" "$REV" "svn@localhost" "sam@localhost"
svn_cvsinject -r "$REV" "$REPOS" "/cvs/stuff/wooyay" \
    -a "1.0/v1_0" -a "2.0/v2_0" &
exit 0

It is advisable to run svn_cvsinject in the background because it can take a long time to finish. Also, make sure that all users with commit rights (including the user svnserve might run as) have write permissions on the CVS repository.

Here are the current svn_cvsinject features:

  • support for file creation and removal
  • support for directory creation and removal
  • support for simultaneous commits in different branches
  • support for branch aliases

However, it also has the following current limitations:

  • no support for new branches
  • no user mapping when run from svnserve (but the user is mentioned in the commit log)
  • concurrent calls may break things (use locks)
  • poor error handling

Conclusion

It works for me (tm), but I’d be happy to learn of other successful installations. And please tell me of failures as well, so that I can fix bugs!

If your CVS repository ever gets corrupted, you can reinject every SVN commit by restoring your backuped CVS tree and callingsvn_cvsinject again for every revision since you used cvs2svn. 
종종 사용하던 기능인데 몇가지를 제외하고는 몰라서 찾아봤더니 잘 정리해둔 블로그가 있어 퍼왔다.

[출처]  http://vancc.tistory.com/40


This, Too, Shall Pass Away
(이것 또한 곧 지나가리라)
Lanta Wilson Smith
(랜터 윌슨 스미스)

When some great sorrow, like a mighty river,
(큰 슬픔이 당신을 휩쓸고 지나갈 때면,)
Flows through your life with peace-destroying power
(슬픔이 당신 삶 속의 안락함을 앗아가 버릴 때면,)
And dearest things are swept from sight forever,
(그래서 당신에게 소중한 것들이 영영 사라지고 말았을 땐,)
Say to your heart each trying hour:
(당신 가슴에 대고 매순간 이렇게 외쳐라.)
This, too, shall pass away.
(이것 또한 지나가리라.) 

When ceaseless toil has hushed your song of gladness,
(끝이 보이지 않는 고난이 당신을 짓누를 때면)
And you have grown almost too tired to pray,
(그래서 당신이 기도할 힘조차 없을 정도로 지쳐 버렸을 땐,)
Let this truth banish from your heart its sadness,
(이 한 가지 진실만이 당신을 슬픔에서 벗어나게 해주리라.)
And ease the burdens of each trying day:
(지친 일상 속의 당신을 홀가분하게 만들어 주리라.)
This, too, shall pass away.
(이것 또한 지나가리라.)

When fortune smiles, and, full of mirth and pleasure,
(행운이 당신을 향해 미소 지을 때, 즐거움만이 당신과 함께 할 때에도,)
The days are flitting by without a care,
(근심 없이 하루하루를 보내는 나날에도,)
Lest you should rest with only earthly treasure,
(당신이 세속적인 가치에 빠져들지 않도록,)
Let these few words their fullest import! bear:
(이 말을 명심하라.)
This, too, shall pass away.
(이것 또한 지나가리라.)

When earnest labor brings you fame and glory,
(당신이 명예를 얻고 영광된 순간을 맞이할 때도,)
And all earth's noblest ones upon you smile,
(온 세상의 저명한 이가 당신을 칭송할 때에도,)
Remember that life's longest, grandest story
(삶의 진실을 잊지 말라.)
Fills but a moment in earth's little while:
(지금의 충만한 삶은 사실 어느 한 순간에 지나지 않는다는 것을.)
This, too, shall pass away.
(이것 또한 지나가리라.) 

 


+ Recent posts