0

我在多个文件夹中有相同的文件,但描述不同(一个文件夹用于法语,一个文件夹用于英语)。如果我在一个文件夹中进行了一些更改,我还必须为另一个文件夹签出相同的文件并进行相同的更改。有没有办法检查这些文件中的任何一个,并在相同的操作中检查它的等价物?

4

2 回答 2

0

这是我编写的批处理文件,它从多个文件夹中签出文件,将最新文件复制到这些文件夹并签入最新文件。修改和使用,您认为合适

echo off
rem Batch file to copy latest template files from archive to c:\aia\addapt 3\template
setlocal enableextensions enabledelayedexpansion
rem
echo checking out all instances of common.dll from tfs
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\ADDapt3Library\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\ADDaptObserverComponent\CAddaptObserver\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\ADDaptPrintComponent\CAddaptPrint\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\DriveComponent\CDrive\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\FaultFifoComponent\CFaultFIFO\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\RealTimeComponent\AddaptRealTime\AddaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\SignalAnalyzerComponent\CSignalAnalyzer\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkout C:\rd\ADDaptv3\ADDapt3\ViewModelComponent\CAddaptViewModel\ADDaptLibrary\common.dll
rem
echo Need to define lastest location of common library
set /p CommonLib=Enter directory of common library:
set commonsrc=!CommonLib!\Common.dll
echo on
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\ADDapt3Library\
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\ADDaptObserverComponent\CAddaptObserver\ADDaptLibrary\
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\ADDaptPrintComponent\CAddaptPrint\ADDaptLibrary\
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\DriveComponent\CDrive\ADDaptLibrary\
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\FaultFifoComponent\CFaultFIFO\ADDaptLibrary\
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\RealTimeComponent\AddaptRealTime\AddaptLibrary\
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\SignalAnalyzerComponent\CSignalAnalyzer\ADDaptLibrary\
copy /Y  %commonsrc% C:\rd\ADDaptv3\ADDapt3\ViewModelComponent\CAddaptViewModel\ADDaptLibrary\
echo off
rem
echo checking in all instances of common.dll into tfs
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\ADDapt3Library\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\ADDaptObserverComponent\CAddaptObserver\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\ADDaptPrintComponent\CAddaptPrint\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\DriveComponent\CDrive\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\FaultFifoComponent\CFaultFIFO\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\RealTimeComponent\AddaptRealTime\AddaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\SignalAnalyzerComponent\CSignalAnalyzer\ADDaptLibrary\common.dll
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\tf" checkin /noprompt /comment:"Latest common.dll assembly" C:\rd\ADDaptv3\ADDapt3\ViewModelComponent\CAddaptViewModel\ADDaptLibrary\common.dll
rem
set /p WAITONUSER=Enter return to continue
echo All done!
于 2014-01-13T16:32:06.333 回答
0

不,TFS 提供的开箱即用的功能与此类似。

也就是说,编写一个小的 powershell 脚本或批处理文件并不难,它将您要签出的文件的名称作为参数并tf checkout在英语和法语文件夹中调用该文件。

您还可以将其作为外部工具添加到 Visual Studio,并将项目文件名作为参数传递,以便您可以从 IDE 调用它。

于 2013-07-05T08:25:11.493 回答