program tip

tfs 2008에서 다른 지점으로 보류를 해제 할 수 있습니까?

radiobox 2020. 8. 12. 08:06
반응형

tfs 2008에서 다른 지점으로 보류를 해제 할 수 있습니까?


우리 팀의 일부 개발자가 분기 A에서 수행 한 변경 사항을 보류했다고 가정하겠습니다. 그리고 저는 분기 B에서 작업하고 있습니다. 그의 변경 사항을 분기 B로 보류 취소 할 수 있습니까? (GUI 또는 명령 프롬프트 사용)


비주얼 스튜디오 전동 공구는 이 작업을 수행 할 수 있도록해야한다.

C:\src\2\Merlin\Main>tfpt unshelve /?
tfpt unshelve - Unshelve into workspace with pending changes

Allows a shelveset to be unshelved into a workspace with pending changes.
Merges content between local and shelved changes. Allows migration of shelved
changes from one branch into another by rewriting server paths.

Usage: tfpt unshelve [shelvesetname[;username]] [/nobackup]
                     [/migrate /source:serverpath /target:serverpath]

 shelvesetname          The name of the shelveset to unshelve
 /nobackup              Skip the creation of a backup shelveset
 /migrate               Rewrite the server paths of the shelved items
                        (for example to unshelve into another branch)
 /source:serverpath     Source location for path rewrite (supply with /migrate)
 /target:serverpath     Target location for path rewrite (supply with /migrate)
 /nobackup              Skip the creation of a backup shelveset

예를 들어 Branch1에서 생성 된 "Shelve Set Name"이라는 shelve 세트를 Branch2에 병합하려면 다음을 사용합니다.

>tfpt unshelve "Shelve Set Name";domain\userName /migrate /source:"$/Project/Branch1/" /target:"$/Project/Branch2/"

각 파일을 수동으로 병합 할 필요가없는 tfpt의 대체 솔루션

tfs 전동 도구의 ​​문제 는 '근거없는 병합'을 수행하고 있으므로 모든 파일을 확인해야한다는 것 입니다. 800 개가 넘는 파일로 구성된 쉘프 셋을 가지고 있었고 '자동 병합'버튼을 믿지 않았고 각 파일을 차례로 살펴보고 싶지 않았기 때문에 다른 방법을 찾아야했습니다!

  • TFS Shelveset Sidekick을 다운로드하여 설치합니다 .
  • 도구는 VS2010의 '도구'아래에 나타납니다.
  • 'Shelveset Sidekick'도구를 실행하고 검색을 클릭하여 선반 세트를 표시합니다.
  • 선반 세트를 마우스 오른쪽 버튼으로 클릭하고 'Shelveset 내보내기'를 선택하십시오.
  • 다음과 같은 빈 위치에 저장 C:\temp\shelveset-name
  • 이제 새 파일 만 포함하는 완전한 디렉토리 구조가 있습니다.

(참고 : 내보낼 때 진행률 표시 줄이 없습니다. 따라서 내보내는 데 시간이 오래 걸리는 큰 선반 세트가있는 경우 Windows 탐색기 (파일> 속성> 크기)에서 파일이 여전히 다운되고 있는지 확인해야합니다. 얼 었다고 생각하십시오).

이제 Windows 탐색기를 사용하여 새 분기로 복사하기 만하면됩니다.

이것은 나를 위해 일했습니다.

  • 먼저 전체 솔루션 확인 (새 브랜치에서)
  • 해당 솔루션 닫기
  • VS 내에서 TFS를 오프라인으로 전환 ( 이 작업을 수행하는 도구 )- 이것이 중요한 이유는 아래 참조 ...
  • Windows 탐색기에서 파일을 복사합니다. 의 디렉터리 구조 c:\temp\shelveset-name는 새 분기에 해당하도록 이름을 변경해야합니다. 팁 : 올바른 위치에 복사하십시오 !!!
  • VS를 온라인 상태로 만들기
  • 모든 변경 사항을 찾고 새 파일을 추가해야합니다.
  • 소스 제어를 바인딩하도록 요청하는 경우 새 분기에 대한 경로가 올바른지 확인하십시오.
  • 테스트-새 파일 체크인

Important: I've found that if you don't first take TFS offline then you'll end up with any new files (from your unshelves changeset) showing without a little red check mark and you'll have to exclude and include them again to get them to add. If anyone has an alternative solution to this problem I'd love to know - refreshing doesn't seem to work.


The shelf information includes the specific path it goes to. Unfortunately I don't know of any automatic way to unshelve to any location other than the one it was shelved to. The times I've wanted to do this I had to check out the equivalent files in the new branch, unshelve from the old branch, then manually copy the files over.

EDIT: Well, I guess I was doing it the hard way. I'll have to try out Curt's solution. :)


I spent good amount of time to get this done and I had few issues to overcome. It is possible but here few issues and few rules to follow to avois these issues

Error:

unable to determine the workspace

This particular issue was solved by running the command from source branch root folder. This is contrary to some answers on SO where they say to use "target" branch - no, use "source":

cd [your !!source!! branch root]
tfpt unshelve /migrate /source:"$/MyCollection/Development/Maint1.1" /target:"$/MyCollection/Development/Maint1.2" "myShelveset;UserName"

Second issue appeared after this. Seem that it couldn't connect to TFS server. What I realized, I have multiple VS installed and connected to different TFS servers. I was using VS12 and I had workspace and server connection. But I didn't realize that same connection needs to be replicated in VS13 for TFPT2013 to work. It connects to same server and workspace.

I also tried doing it using TFPT2015 but I installed it and it didn't install TFPT.exe hence it was useless. So I tried from TFPT2013 to TFS2015 and it worked for this particular command. I wonder, why not, if VS12/13 works fine against TFS2015?

To summarize

  • Use CMD or DevCMD - doesn't matter
  • run command from source branch root folder
  • verify Team Explorer Server connection for specific VS
  • TF Power Tools 2013 work against TFS v15, at least migrate option works

The following steps can be used for small size shelvesets (~20 files or less).

  1. On the shelveset and target branches, start by having all pending updates checked in or rolled back.
  2. On the shelveset branch, unshelve the files from the applicable shelveset.
  3. On the target branch, checkout any of the existing files that were in the unshelved shelveset.
  4. Compare the unshelved files on the shelveset branch with those on the target branch to identify those files that require merge updates (if any).
  5. If needed, manually make merge updates to the applicable files of the prior step and save these files in the target branch workspace.
  6. Copy the other shelveset files from the shelveset branch workspace to the target branch workspace.
  7. Compare the new updated files in the target branch workspace with the checked in files. Make any corrections as needed.
  8. Check in the new updated files on the target branch.
  9. Rollback the unhelved files on the shelveset branch.

참고URL : https://stackoverflow.com/questions/117337/can-i-unshelve-to-a-different-branch-in-tfs-2008

반응형