정리

Version Control with Subversion (for Subversion 1.7)

저장소/잡다한거

Version Control with Subversion

for Subversion 1.7


http://svnbook.red-bean.com/en/1.7/svn-book.html

VCS의 branch, tag, trunk

저장소/잡다한거

여태 본 것 중에 가장 알아듣게 설명됨. 왕 친절! 

프로젝트 단위로 구성하는게 맘 편한듯... 왕 후회중 ㅠㅠ



원문 출처 : http://freedert.tistory.com/100


Subversion/SVN 설정시 branches, tags, trunk 에 대한 개념


Subversion/SVN 설정시 branches, tags, trunk 에 대한 개념

trunk
- 기본적으로 개발을 시작할 때 사용하는 디렉토리(소스의 주 개발 작업을 진행하는 폴더)
- 모든 프로그램 개발 작업은 trunk 디렉토리에서 부터 시작
- main, mainline, production의 의미로 사용됨

brankches
- trunk 에서 뻗어져 나온 나뭇가지(소스의 실험적인 작업을 진행하는 폴더, 소스의 현재 버전을 유지보수 하고, 현재 버전을 기반으로 차기 버전을 개발할 경우 이 폴더 이용)
- trunk 디렉토리에서 프로그램을 개발하다보면 큰 프로젝트에서 또 다른 작은 분류로 빼서 개발하는 경우.
- 프로젝트 안의 작은 프로젝트
- release 버전과 유지보수 버전을 분리하고 싶을 때 사용
- customizing이나 hot fix 목적으로 분리하여 수정함
- 수정이 계속해서 발생하다가 궁극적으로는 trunk에 merge 되는 것이 일반적임

tags
- 꼬리표의 개념.
- 현재 릴리즈된 소스를 관리하기 쉽게 따로 보관하는데 사용. 즉, 개발을 위한 것이 아니라 보관을 위한 것이기 때문에 export만 해야 한다. 체크아웃하여 커밋 할 경우 경고 메시지가 출력된다.
- 프로그램을 개발하면서 정기적으로 릴리즈 할 때 0.1, 0.2, 1.0 식의 버전의 소스를 따로 저장하는 공간
- 한번 만들면 수정하지 않음
- releases, snapshots, baselines의 의미로 사용됨


버전 관리 시스템 : SVN에서 Git으로.. 왜?

저장소/잡다한거

요즈음 버전 관리 시스템의 추세는 중앙 집중식 버전 관리 시스템(CVS, SVN)에서 분산형 버전 관리 시스템(Git 외 다수)으로 바뀌고 있다고 한다.

대충 봤는데 와~!! 이건 꼭 써야해! 할 정도로 공감되지는 않더라. SVN 쓰는데 불편함이 없어서 말이지.


암튼 자세한 설명은 링크를 따라간다. 귀찮다.

내용 정리가 잘 되어있당.


Git에 대한 친절한 설명. 굿!

http://dogfeet.github.io/progit/progit.ko.html



Pro Git

http://dogfeet.github.io/articles/2012/progit.html


progit





'저장소 > 잡다한거' 카테고리의 다른 글

VCS의 branch, tag, trunk  (0) 2013.04.17
2012년 분야별 최고의 오픈소스 소프트웨어 124선  (0) 2013.04.16
정규표현식(Regular Expressions) 문법  (0) 2013.04.02
TortoiseSVN Commands  (0) 2013.03.19
Stack Overflow 사례  (0) 2013.02.20

TortoiseSVN Commands

저장소/잡다한거

나는 한다 복사를, TortoiseSVN 도움말에서.


TortoiseSVN Commands


Since all commands for TortoiseSVN are controlled through command line parameters, you can automate it with batch scripts or start specific commands and dialogs from other programs (e.g. your favourite text editor).


Important

Remember that TortoiseSVN is a GUI client, and this automation guide shows you how to make the TortoiseSVN dialogs appear to collect user input. If you want to write a script which requires no input, you should use the official Subversion command line client instead.

D.1. TortoiseSVN Commands

The TortoiseSVN GUI program is called TortoiseProc.exe. All commands are specified with the parameter /command:abcd where abcd is the required command name. Most of these commands need at least one path argument, which is given with /path:"some\path". In the following table the command refers to the /command:abcd parameter and the path refers to the /path:"some\path" parameter.

Since some of the commands can take a list of target paths (e.g. committing several specific files) the /path parameter can take several paths, separated by a * character.

You can also specify a file which contains a list of paths, separated by newlines. The file must be in UTF-16 format, without a BOM. If you pass such a file, use /pathfile instead of /path. To have TortoiseProc delete that file after the command is finished, you can pass the parameter /deletepathfile.

The progress dialog which is used for commits, updates and many more commands usually stays open after the command has finished until the user presses the OK button. This can be changed by checking the corresponding option in the settings dialog. But using that setting will close the progress dialog, no matter if you start the command from your batch file or from the TortoiseSVN context menu.

To specify a different location of the configuration file, use the parameter /configdir:"path\to\config\directory". This will override the default path, including any registry setting.

To close the progress dialog at the end of a command automatically without using the permanent setting you can pass the /closeonend parameter.  음.. Log Dialog는 안 된다;; 당연한가.. Progress Dialog만 된다. 이건 잘 된다.

  • /closeonend:0 don't close the dialog automatically

  • /closeonend:1 auto close if no errors

  • /closeonend:2 auto close if no errors and conflicts

  • /closeonend:3 auto close if no errors, conflicts and merges


    ex) C:\Users\Administrator>TortoiseProc /command:update /path:"d:\MyRepo" /closeonend:1

To close the progress dialog for local operations if there were no errors or conflicts, pass the /closeforlocal parameter.

The table below lists all the commands which can be accessed using the TortoiseProc.exe command line. As described above, these should be used in the form /command:abcd. In the table, the /command prefix is omitted to save space.

Table D.1. List of available commands and options

Command Description
:about Shows the about dialog. This is also shown if no command is given.
:log Opens the log dialog. The /path specifies the file or folder for which the log should be shown. Additional options can be set: /startrev:xxx, /endrev:xxx, /strict enables the 'stop-on-copy' checkbox, /merge enables the 'include merged revisions' checkbox, /findstring:"filterstring" fills in the filter text, /findtext forces the filter to use text, not regex, or /findregex forces the filter to use regex, not simple text search, and /findtype:X with X being a number between 0 and 511. The numbers are the sum of the following options:
  • /findtype:0 filter by everything

  • /findtype:1 filter by messages

  • /findtype:2 filter by path

  • /findtype:4 filter by authors

  • /findtype:8 filter by revisions

  • /findtype:16 not used

  • /findtype:32 filter by bug ID

  • /findtype:64 not used

  • /findtype:128 filter by date

  • /findtype:256 filter by date range

If /outfile:path\to\file is specified, the selected revisions are written to that file when the log dialog is closed. The revisions are written in the same format as is used to specify revisions in the merge dialog.
:checkout Opens the checkout dialog. The /path specifies the target directory and the /url specifies the URL to checkout from. If you specify the key /blockpathadjustments, the automatic checkout path adjustments are blocked. The /revision:XXX specifies the revision to check out.
:import Opens the import dialog. The /path specifies the directory with the data to import. You can also specify the /logmsg switch to pass a predefined log message to the import dialog. Or, if you don't want to pass the log message on the command line, use /logmsgfile:path, where path points to a file containing the log message.
:update Updates the working copy in /path to HEAD. If the option /rev is given then a dialog is shown to ask the user to which revision the update should go. To avoid the dialog specify a revision number /rev:1234. Other options are /nonrecursive, /ignoreexternals and /includeexternals. The /stickydepth indicates that the specified depth should be sticky, creating a sparse checkout.
:commit Opens the commit dialog. The /path specifies the target directory or the list of files to commit. You can also specify the /logmsg switch to pass a predefined log message to the commit dialog. Or, if you don't want to pass the log message on the command line, use /logmsgfile:path, where path points to a file containing the log message. To pre-fill the bug ID box (in case you've set up integration with bug trackers properly), you can use the /bugid:"the bug id here" to do that.
:add Adds the files in /path to version control.
:revert Reverts local modifications of a working copy. The /path tells which items to revert.
:cleanup Cleans up interrupted or aborted operations and unlocks the working copy in /path. Use /noui to prevent the result dialog from popping up (either telling about the cleanup being finished or showing an error message). /noprogressui also disables the progress dialog. /nodlg disables showing the cleanup dialog where the user can choose what exactly should be done in the cleanup. The available actions can be specified with the options /cleanup for status cleanup, /revert, /delunversioned, /delignored, /refreshshell and /externals.
:resolve Marks a conflicted file specified in /path as resolved. If /noquestion is given, then resolving is done without asking the user first if it really should be done.
:repocreate Creates a repository in /path
:switch Opens the switch dialog. The /path specifies the target directory.
:export Exports the working copy in /path to another directory. If the /path points to an unversioned directory, a dialog will ask for an URL to export to the directory in /path. If you specify the key /blockpathadjustments, the automatic export path adjustments are blocked.
:dropexport Exports the working copy in /path to the directory specified in /droptarget. This exporting does not use the export dialog but executes directly. The option /overwrite specifies that existing files are overwritten without user confirmation, and the option /autorename specifies that if files already exist, the exported files get automatically renamed to avoid overwriting them.
:merge Opens the merge dialog. The /path specifies the target directory. For merging a revision range, the following options are available: /fromurl:URL, /revrange:string. For merging two repository trees, the following options are available: /fromurl:URL, /tourl:URL, /fromrev:xxx and /torev:xxx. For doing a reintegrate merge, use the following options: /fromurl:URL and /reintegrate. These pre-fill the relevant fields in the merge dialog.
:mergeall Opens the merge all dialog. The /path specifies the target directory.
:copy Brings up the branch/tag dialog. The /path is the working copy to branch/tag from. And the /url is the target URL. You can also specify the /logmsg switch to pass a predefined log message to the branch/tag dialog. Or, if you don't want to pass the log message on the command line, use /logmsgfile:path, where path points to a file containing the log message.
:settings Opens the settings dialog.
:remove Removes the file(s) in /path from version control.
:rename Renames the file in /path. The new name for the file is asked with a dialog. To avoid the question about renaming similar files in one step, pass /noquestion.
:diff Starts the external diff program specified in the TortoiseSVN settings. The /path specifies the first file. If the option /path2 is set, then the diff program is started with those two files. If /path2 is omitted, then the diff is done between the file in /path and its BASE. To explicitly set the revision numbers use /startrev:xxx and /endrev:xxx, and for the optional peg revision use /pegrevision:xxx. If /blame is set and /path2 is not set, then the diff is done by first blaming the files with the given revisions. The parameter /line:xxx specifies the line to jump to when the diff is shown.
:showcompare

Depending on the URLs and revisions to compare, this either shows a unified diff (if the option unified is set), a dialog with a list of files that have changed or if the URLs point to files starts the diff viewer for those two files.

The options url1, url2, revision1 and revision2 must be specified. The options pegrevision, ignoreancestry, blame and unified are optional.

:conflicteditor Starts the conflict editor specified in the TortoiseSVN settings with the correct files for the conflicted file in /path.
:relocate Opens the relocate dialog. The /path specifies the working copy path to relocate.
:help Opens the help file.
:repostatus Opens the check-for-modifications dialog. The /path specifies the working copy directory. If /remote is specified, the dialog contacts the repository immediately on startup, as if the user clicked on the Check repository button.
:repobrowser

Starts the repository browser dialog, pointing to the URL of the working copy given in /path or /path points directly to an URL.

An additional option /rev:xxx can be used to specify the revision which the repository browser should show. If the /rev:xxx is omitted, it defaults to HEAD.

If /path points to an URL, the /projectpropertiespath:path/to/wc specifies the path from where to read and use the project properties.

If /outfile:path\to\file is specified, the selected URL and revision are written to that file when the repository browser is closed. The first line in that text file contains the URL, the second line the revision in text format.

:ignore Adds all targets in /path to the ignore list, i.e. adds the svn:ignore property to those files.
:blame

Opens the blame dialog for the file specified in /path.

If the options /startrev and /endrev are set, then the dialog asking for the blame range is not shown but the revision values of those options are used instead.

If the option /line:nnn is set, TortoiseBlame will open with the specified line number showing.

The options /ignoreeol, /ignorespaces and /ignoreallspaces are also supported.

:cat Saves a file from an URL or working copy path given in /path to the location given in /savepath:path. The revision is given in /revision:xxx. This can be used to get a file with a specific revision.
:createpatch Creates a patch file for the path given in /path.
:revisiongraph

Shows the revision graph for the path given in /path.

To create an image file of the revision graph for a specific path, but without showing the graph window, pass /output:path with the path to the output file. The output file must have an extension that the revision graph can actually export to. These are: .svg, .wmf, .png, .jpg, .bmp and .gif.

Since the revision graph has many options that affect how it is shown, you can also set the options to use when creating the output image file. Pass these options with /options:XXXX, where XXXX is a decimal value. The best way to find the required options is to start the revision graph the usual way, set all user-interface options and close the graph. Then the options you need to pass on the command line can be read from the registry HKCU\Software\TortoiseSVN\RevisionGraphOptions.

:lock Locks a file or all files in a directory given in /path. The 'lock' dialog is shown so the user can enter a comment for the lock.
:unlock Unlocks a file or all files in a directory given in /path.
:rebuildiconcache Rebuilds the windows icon cache. Only use this in case the windows icons are corrupted. A side effect of this (which can't be avoided) is that the icons on the desktop get rearranged. To suppress the message box, pass /noquestion.
:properties Shows the properties dialog for the path given in /path.


Examples (which should be entered on one line):

TortoiseProc.exe /command:commit
                 /path:"c:\svn_wc\file1.txt*c:\svn_wc\file2.txt"
                 /logmsg:"test log message" /closeonend:0

TortoiseProc.exe /command:update /path:"c:\svn_wc\" /closeonend:0

TortoiseProc.exe /command:log /path:"c:\svn_wc\file1.txt"
                 /startrev:50 /endrev:60 /closeonend:0

TortoiseSVN(Diff, Log, Blame)과 Visual Studio 통합 방법

저장소/VC++

요기서 퍼왔어요~

http://tortoisesvn.net/visualstudio.html


AnkhSVN이나 VisualSVN을 설치해서 써도 좋지만,

TortoiseSVN의 Diff, Log, Blame 기능만 사용해도 충분하다면 다음과 같이 설정한다.



If you're using Visual Studio, you can integrate TortoiseSVN commands to various context menus. Of course, there are Subversion plugins for Visual Studio like AnkhSVN or VisualSVN, with the latter already using TortoiseSVN for many of its UI. Those plugins also have the advantage that when you do refactoring, they automatically record the renames and moves in SVN.

But if you're using one of the free versions of Visual Studio, you can not use those plugins. And sometimes it's still nice to have some of the TortoiseSVN commands available from Visual Studio directly, even if you have such a plugin installed.

The first step is to add the TortoiseSVN commands as external tools, under the menu TOOLS->External Tools....


  한국어 버전 ->  

Add the name of the command, the path to TortoiseProc.exe and then the parameters for the command.

Use the VS variables wherever needed. Since I add my commands to the context menu of the open file tab, here's the parameters I used:

  • /command:blame /path:"$(ItemPath)" /line:$(CurLine)
  • /command:diff /path:"$(ItemPath)"
  • /command:log /path:"$(ItemPath)"

Notice the /line: parameter: this will make TortoiseBlame automatically scroll to the same line the cursor is located in the opened file in Visual Studio.

Now to add those new commands to the file tab context menu, go to TOOLS->Customize..., select the Commands tab, click the radio button Context menu and then select Other Context Menus | Easy MDI Document Window.


 

 한국어 버전 ->  

Then click the Add command... button:


  한국어 버전 ->  

Now you have to select the commands. Problem is that the custom commands are not shown with their title but only as External Command X with X being the number of the external command.

In my case, the commands were number 9-11, you might have to do some trial-and-error here. Just add the commands you think are the ones you added and then check if the right ones show up in the context menu.

음... 외부  도구에서 추가한 기능의 이름이 안 보이고 그냥 '외부 명령 XX' 요렇게 보이는 것에 주의 필요합니다.

대충 제일 아래쪽부터 순서대로 찍으면 될듯... ^^;

And this is how the context menu of the open file tab looks like:


  한국어 버전 ->