Tfs 使用SoundFoundation服务器实际使用MyMalic?
My shop使用TFS&除了缺少本地存储库提交/恢复之外,一般都对它感到满意。我开始在本地使用Mercurial来帮助管理较小的更改块,然后将它们发布到TFS。我看到Subversion有一个“桥接”组件,如果中央VCS是Subversion,它可以自动启用此功能。我还没有找到一个团队系统。这鼓励了我,其他人已经走上了将DVCS与CVCS系统集成的道路 (1) 有人知道吗?我有点怀疑(快速搜索没有找到任何东西) (2) 有人以这种方式使用Mercurial/TFS吗?如果有,请分享您的经验。我特别想了解在通过Mercurial进行重大活动后,对于TFS的承诺可能会出现哪些不明显的问题Tfs 使用SoundFoundation服务器实际使用MyMalic?,tfs,mercurial,Tfs,Mercurial,My shop使用TFS&除了缺少本地存储库提交/恢复之外,一般都对它感到满意。我开始在本地使用Mercurial来帮助管理较小的更改块,然后将它们发布到TFS。我看到Subversion有一个“桥接”组件,如果中央VCS是Subversion,它可以自动启用此功能。我还没有找到一个团队系统。这鼓励了我,其他人已经走上了将DVCS与CVCS系统集成的道路 (1) 有人知道吗?我有点怀疑(快速搜索没有找到任何东西) (2) 有人以这种方式使用Mercurial/TFS吗?如果有,请分享您的经验。我
到目前为止,只有我使用if几天,这似乎是一个双赢的局面——但我当时知道的足够多,认为这很容易。我知道有些人将hgsubversion与Subversion桥一起使用。我不知道它工作得有多好,而且我从未使用过TFS
据我所知,没有比使用TFS->Subversion bridge->hgsubversion更“本地”的网桥了,但我也听说它工作得相当好。我对TFS的理解非常有限,这表明它的内部模型应该足够类似于Subversion,以便像hgsubversion这样的东西能够很好地工作。不确定这是否是您还不知道的,但我已经在本地使用mercurial有一段时间了,到目前为止,我认为管理这两个源代码控制系统所带来的好处超过了额外的开销。以下是我一直在做的事情: 我让我的TFS签出了一个我认为是我的“大师”的知识库。我从TFS获取更新并将其提交到此repo,因此这包含TFS中项目的最新状态。这里重要的一点是,没有任何独立于TFS更新或Hg合并(这是第2部分)的更改
=====FILE: push.ps1=====
$projName = "TicTacToeCMMI"
$tftp = "C:\Program Files\Microsoft Team Foundation Server 2010 Power Tools\TFPT.exe"
$tf = "C:\Program Files\Microsoft Visual Studio 10.0\Common7\ide\tf.exe"
hg push
cd ..\$projName-tfs
"Syncing -tfs workspace with TFS server"
&$tftp scorch /noprompt /exclude:.hg',_Resharper*',*.user
"Making all files in -tfs writable"
attrib -R /S /D *
"Updating -tfs with latest push from Mercurial"
hg update -C -y
attrib +R /S /D *
attrib -R /S /D .hg\*
"Resyncing Mercurial changes with TFS Server"
&$tftp online /adds /deletes /diff /exclude:'.hgignore,.hg,bin,obj,*.ps1,_Resharper*,*.lnk,*.user,*.suo,*.vspscc'
"Checkin"
&$tf checkin
cd ..\$projName-working
cmd /c pause
====FILE: pull.ps1=====
$projName = "TicTacToeCMMI"
$tf = "C:\Program Files\Microsoft Visual Studio 10.0\Common7\ide\tf.exe"
$username = cmd /c set USERNAME
$username = $username.SubString($username.IndexOf("=")+1)
function pull {
cd ..\$projName-tfs
&$tf get
hg commit -A -m "from tfs" --user $username
cd ..\$projName-working
hg pull --rebase
}
pull
cmd /c pause
TARGET: C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe C:\dev\TicTacToeCMMI-working\push.ps1
START IN: C:\dev\TicTacToeCMMI-working
param([parameter(Position=0, Mandatory=$true)][string] $action)
$HGDirectory = Get-Location
$TfsDirectory = @(hg paths | where-object { $_.StartsWith("default = ") })[0].SubString(10)
# Pull from TFS
function pull
{
# Todo pull changes one by one brining who did it and the comment into HG
# tf history . /recursive /format:brief /noprompt /version:300~1000 /sort:ascending
# tf properties . /recursive
# Add the changes from TFS into the TFS HG repository
Set-Location $TfsDirectory
tf get . /recursive
hg commit -A -m "Update from TFS"
# Pull / merge the changes from TFS's HG repository
Set-Location $HGDirectory
hg pull
hg merge --tool internal:fail
hg commit -m "Merged from TFS"
""
"The you have the following conflicts which need resolving"
hg resolve -l | write-host -foregroundcolor "red"
#thg commit
}
# Push to TFS
function push
{
Set-Location $HGDirectory
hg push
Set-Location $TfsDirectory
$FilesModified = @()
$FilesRenamed = @{} # Key: old file name .... Val: new file name
$FilesRemoved = @()
$FilesAdded = @()
# Work out what changes have taken place
"Calculating the changes which have been made in HG..."
tfpt scorch /exclude:.hg,*.user | out-null
$AllChanges = hg status --rev .:tip -A
for($i = 0; $i -lt $AllChanges.length ; $i++)
{
$type = $AllChanges[$i].SubString(0, 2)
$fileName = $AllChanges[$i].SubString(2)
switch($type)
{
"M " # Modified files
{
$FilesModified += $fileName
}
"A " # New Files
{
$nextType = $null
$nextFileName = $null
if($AllChanges.length -gt ($i+1))
{
$nextType = $AllChanges[$i+1].SubString(0, 2)
$nextFileName = $AllChanges[$i+1].SubString(2)
}
if($nextType -eq " ")
{
# we have a rename
$FilesRenamed[$nextFileName]=$fileName
$i++
}
else
{
# we're adding the file
$FilesAdded += $fileName
}
}
"R " # Removed
{
if($FilesRenamed.ContainsKey($fileName))
{
continue
}
$FilesRemoved += $fileName
}
"C " # Same
{
continue
}
default
{
"Unknown HG status line: "+$AllChanges[$i]
return -1
}
}
}
# perform the TFS operations
"Renaming files in TFS..."
foreach($file in $FilesRenamed.Keys) {
tf checkout $file | out-null
tf rename $file $FilesRenamed[$file] | out-null
}
"Checking out for edit in TFS..."
foreach($file in $FilesModified) { tf checkout $file | out-null }
"Removing files from TFS..."
foreach($file in $FilesRemoved) { tf delete $file | out-null }
# perform the Mercural update
"Pulling changes out of HG...."
hg update --rev .:tip --clean
# perform any POST TFS operations
"Adding new files to TFS..."
foreach($file in $FilesAdded) { tf add $file }
"Cleaning up..."
tfpt uu /noget
tf checkin
}
if ($action -eq "push") { push }
elseif ($action -eq "pull") { pull }
else { "Unknown action ... please supply 'push' or 'pull'" }
# return to our starting point
Set-Location $HGDirectory