开发者

How do I create a branch from a specific changeset if the folder hierarchy has changed?

开发者 https://www.devze.com 2023-01-16 12:43 出处:网络
I was recently tasked with creating a branching plan for our project, and part of that involved creating a few feature branches and release branches.I also had to clean up the source control tree so t

I was recently tasked with creating a branching plan for our project, and part of that involved creating a few feature branches and release branches. I also had to clean up the source control tree so that the branches could be self contained. I basically started with this:

/
  ./src
  ./model
  ./processtemplates
  ./data
  ./otherfolders

I changed the structure to this:

/
  ./trunk
    ./src
    ./model
    ./data
  ./branches
    ./v1
      ./release1
        ./src
        ./model
        ./data
      ./release2

The problem is, I need to create a branch from a specific previous version, but the folder structure has changed, so I can't get that changeset for the /trunk folder to create a branch from. The exact error message I get is: "No matching items found in $/ at the specified version."

What's the best way to do this? I have though of creating a branch from the latest changeset and reverting all of the changes back to the older changeset. I was hoping there was an easie开发者_StackOverflow社区r way.


Renames and deletes are dangerous territory in TFS 2008. You'll probably have to go to the command-line to do this. Take a look at your history to figure out the changeset from which you want to branch, then do the following at the command line:

mkdir c:\BranchFolder
cd c:\BranchFolder
tf.exe workspace /new /s:http://tfs:8080 BranchWorkspace
tf.exe workfold /map:"$/","C:\BranchFolder"
tf.exe branch "$/" "$/branches/v999" /version:Cxxxxxx /noget /noprompt

Validate and check in.

tf.exe workspace /delete BranchWorkspace

replace v999 with whatever folder you want to branch into, and change xxxxxx to the appropriate changeset number.

As always-- when you are working in these kinds of areas where you aren't quite sure what the results are going to be, check your work before checking in.

0

精彩评论

暂无评论...
验证码 换一张
取 消