Perforce

From 탱이의 잡동사니
Revision as of 10:55, 26 October 2015 by Pchero (talk | contribs) (→‎Commands)
Jump to navigation Jump to search

Overview

형상 관리 툴 Peforce(p4) 사용법 정리.

Commands

공통

perforce command 사용시 공통적으로 적용되는 사항 정리.

디렉토리

perforce 에서는 빈 디렉토리는 생성/변경/삭제가 불가능하다. 만약 디렉토리 내에, 파일이 하나도 없다면 해당 디렉토리는 자동으로 사라지게 된다.

...

만약 디렉토리내의 모든 파일을 선택해야 한다면, '...' 을 사용하면 된다.

help

도움말 내용을 보여준다. simple 입력시 자주 사용되는 명령어의 간단한 쓰임새를 보여준다. 자세한 명령어의 도움말을 보고자 한다면 p4 help <command> 를 입력하면 된다. 사용 가능한 모든 명령어를 보고자 할 때는, "p4 help commands" 를 입력하면 된다.

$ p4 help simple

    Most common Perforce client commands:

	client     Create or edit a client workspace specification and view

	add        Open files for adding to the depot
	edit       Open existing files for editing
	delete     Open existing files for removal from the depot
	opened     List open files 

	update     Update files in the current client workspace 
	resolve    Resolve updates to open workspace files

	submit     Submit open files to the depot
	revert     Revert open files and restore originals to workspace

branch

branch -- Create, modify, or delete a branch view specification 브랜치를 생성하고, 수정 및 삭제한다. 하지만 편의상 populate 옵션을 더 많이 사용한다.

$ p4 branch [-f] name
$ p4 branch -d [-f] name
$ p4 branch [ -S stream ] [ -P parent ] -o name
$ p4 branch -i [-f]

populate

populate -- Branch a set of files as a one-step operation 여러개의 파일들을 한번에 Branching 한다.

$ p4 populate [options] fromFile[rev] toFile
$ p4 populate [options] -b branch [-r] [toFile[rev] ...]
$ p4 populate [options] -b branch -s fromFile[rev] [toFile ...]
$ p4 populate [options] -S stream [-P parent] [-r] [toFile[rev] ...]
$ p4 populate -o <source>/... <destination>/...

$ p4 populate -o //depot/devel/sample/DEVELOP/... //depot/devel/sample/FEATURE_sample_test/...

integrate

integrate -- Integrate one set of files into another

$ p4 integrate [options] fromFile[revRange] toFile
$ p4 integrate [options] -b branch [-r] [toFile[revRange] ...]
$ p4 integrate [options] -b branch -s fromFile[revRange] [toFile ...]
$ p4 integrate [options] -S stream [-r] [-P parent] [file[revRange] ...]

delete

지정된 파일을 삭제한다. 사실, perforce 에서는 파일 삭제가 없다. 단지 앞으로의 버전 컨트롤에서 제외될 뿐이다.

$ p4 delete [-c changelist#] [-n -v -k] file ...

-n 파일 삭제시 나타나게 될 결과를 표시한다. 실제로 파일을 삭제하지는 않는다.

-k client 에 설치된 파일의 변경없이 server에 있는 파일만을 삭제한다. 만약 서버와 클라이언트 간의 파일 불일치가 발견되면 경고를 표시한다.

-v 아직 sync 되지 않은 파일도 같이 삭제할 수 있도록 한다.

client

client 설정을 확인/수정 한다.

View 항목에 명시되어 있지 않은 디렉토리는 동기화되지 않는다. 만약 perforce 설정 이후, 특정 디텍토리가 동기화되지 않는다면, View 항목을 먼저 확인하자.

Client: stk_pbxdevelopment

Update: 2015/10/13 14:14:25

Access: 2015/10/13 14:12:39

Owner:  stk

Host:   test.pchero21.com

Description:
        Created by stk.

Root:   /home/stk

Options:        noallwrite noclobber compress unlocked nomodtime rmdir

SubmitOptions:  submitunchanged

LineEnd:        local

View:
        //depot/devel/helloworld/... //stk_pbxdevelopment/depot/devel/helloworld/...

changes, changelists

현재 위치한 디렉토리에서의 변경 내역을 보여준다. change 와 changeslists 는 모두 같은 옵션이다.

-m

단순히 p4 changes 를 입력하면 모든 변경 이력을 보여준다. -m 옵션 사용시 가장 최근에서부터 -m <count> 개 까지의 변경이력만을 보여준다.

$ p4 changes -m 1
Change 1692 on 2015/10/23 by pchero@pchero_dev 'Changed tmp file name path.'

-l, -L

변경이력의 상세 내용을 표시한다. 기본적으로 changes 옵션 사용시, 변경 이력의 제일 윗줄만을 표시한다. -l 옵션 사용시, 변경 이력의 상세 내용을 모두 확인할 수 있다. -L 옵션은 -l 옵션 내용과 같으나, 최대 250자 까지의 내용만을 표시한다.

References

<references />