2014-06-24 2 views
3

편집 된 파일을 처리하는 스크립트를 작성하고 싶습니다. p4 opened은 좋은 목록을 제공하지만 저장소 구문을 사용하고 있습니다. 결과를 내 스크립트에 전달할 수 있도록 출력을 로컬 구문으로 가져 오는 방법이 있습니까?퍼 포스 열린 파일의 로컬 위치 얻기

Linux에서 Perforce를 실행 중입니다.

답변

3

p4 where은 저장소 파일이 로컬에있는 위치를 알려줍니다.

각 출력 경로를 로컬 경로로 변환하려면 p4 opened의 출력을 사용하고 p4 where을 사용해야합니다.

This answer 일부 힌트를 제공 할 수 있습니다.

편집 : p4 -ztag opened이 사용자 요구에 맞는 지 확인하십시오. -ztag은보다 장황하지만 스크립트 친화적 인 출력을 자주 생성합니다.

+0

내가 필요한 것 같습니다 ... –

+0

@StephenRasku'-ztag'에 대한 제 편집을 참조하십시오. 스크립트에서'p4 opened '를 사용한다면'-ztag'가 도움이 될 것입니다. –

0

당신은 바로 그런 다음 예제 중 하나의 파일 명령을 '-Ztag 열 P4'당신이 을 사용할 수 있습니다에 대한 클라이언트 구문을 원하는 경우 :

$ p4 -Ztag opened | grep clientFile 
... clientFile //admin14streams/depot/www/dev/Jam.html 
... clientFile //admin14streams/depot/www/dev/Jambase.html 
... clientFile //admin14streams/depot/www/dev/Jamfile.html 
... clientFile //admin14streams/depot/www/dev/Jamlang.html 
... clientFile //admin14streams/depot/www/dev/images/jamgraph-jam.gif 
... clientFile //admin14streams/depot/www/dev/index.html 


$ p4 -Ztag opened | grep clientFile | cut -d ' ' -f3 
//admin14streams/depot/www/dev/Jam.html 
//admin14streams/depot/www/dev/Jambase.html 
//admin14streams/depot/www/dev/Jamfile.html 
//admin14streams/depot/www/dev/Jamlang.html 
//admin14streams/depot/www/dev/images/jamgraph-jam.gif 
//admin14streams/depot/www/dev/index.html 

'P4하는 곳'명령을 당신에게 줄 것이다 그러나 로컬 파일 시스템 위치라면 원하는 것입니다.

$ p4 where //depot/www/dev/Jam.html 
//depot/www/dev/Jam.html //admin14streams/depot/www/dev/Jam.html /home/bruno/myspaces/admin14streams/depot/www/dev/Jam.html 


$ p4 -Ztag where //depot/www/dev/Jam.html 
... depotFile //depot/www/dev/Jam.html 
... clientFile //admin14streams/depot/www/dev/Jam.html 
... path /home/bruno/myspaces/admin14streams/depot/www/dev/Jam.html 

희망이 있습니다.

관련 문제