TFS:移动文件夹后删除剩余的自定义映射
我有一个工作区,我希望将存储库根映射到特定文件夹(例如,$/
映射到D:\Home
)。然后,这将选取存储库中默认的“自然”文件夹结构,而无需手动映射内容。
我在默认 TFS 结构下有两个子项目,最近被移动到另一个文件夹下。 TFS 有助于记住那些指向我硬盘驱动器上的特定位置,但我需要的是让它们丢失(现在)自定义映射,然后简单地返回到基于默认映射位置的位置他们的父文件夹指向的位置。
我可以看到一个重新映射文件夹的选项,但没有简单地删除自定义映射的选项。 IIRC Visual Source Safe 有一种方法可以做到这一点——停止以自定义方式映射文件夹,并将其恢复为基于其父文件夹的默认映射。但我不知道TFS是否也能做到这一点...
如果有什么区别的话,这是从VS2010使用的TFS2005。
编辑
这是一个使这一点更清楚的示例。假设 $/ 最初映射到 D:\Home。因此 $/Foo 会“自然地”映射到 D:\Home\Foo。 $/Foo/Widget 也自然映射到 D:\Home\Foo\Widget。然后 Widget 从 $/Foo 下移动到 $/Bar 下,但 TFS 仍然告诉我映射到 D:\Home\Foo\Widget,而我希望它是 D:\Home\Bar\Widget。我想删除自定义映射,并让 Widget 映射到其父文件夹下的“自然”位置,而不是指向旧位置。
I have a workspace where I want the repository root mapped to a particular folder (e.g., $/
mapped to D:\Home
). This then picks up the default "natural" folder structure in the repository without having to map stuff manually.
There's a pair of subprojects that I had under the default TFS structure and were recently moved around under another folder. TFS helpfully remembers that those were pointed to a particular location on my hard drive, but what I need is for them to lose the (now) custom mapping and simply go back to picking up the default mapping location based on where their parent folder points to.
I can see an option to remap the folders, but no option to simply drop the custom mapping. IIRC Visual Source Safe had a way to do this -- to just stop mapping a folder in a custom way and return it to being mapped by default based on its parent folder. But I can't figure out if TFS can do that as well...
If it makes any difference, this is TFS2005 being used from VS2010.
EDIT
Here's an example to make this clearer. Say $/ was mapped originally to D:\Home. So $/Foo would map 'naturally' to D:\Home\Foo. $/Foo/Widget was also mapped naturally to D:\Home\Foo\Widget. Then Widget was moved from under $/Foo to $/Bar, but TFS is still telling me that the mapping is to D:\Home\Foo\Widget, when I want it to be D:\Home\Bar\Widget. I want to remove the custom mapping and let Widget be mapped to the 'natural' location under its parent folder, not point to the older location.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想我明白你想做什么。
你是如何移动那个小部件的?您是否使用过 TeamExplore ->源代码管理资源管理器要动吗?如果没有...
打开源代码控制资源管理器 ->转到您的小部件并右键单击 ->移动(选项直接位于支撑和合并下方)
您将看到一个带有“从”和“到”框的对话框。浏览到硬盘上的新位置并移动小部件。
这样,TFS 将正确拾取新位置,并且自然会再次映射。任何时候您想要将 Widget(其中 widget = 项目或文件夹等)从 $/something 移动到另一个 $/something 时,请使用移动工具。签入零钱后就可以出发了。
I think I understand what you are trying to do.
How did you move that widget? Did you use TeamExplore -> Source Control Explorer to move it? If not...
Open Source Control Explorer -> Go to your widget and right-click -> Move (Option is directly under Brancing and Merging)
You will see a dialog with a From and To box. Browse to the new location on your HDD and move the widget.
In this way, TFS will pickup the new location correctly and it will be naturally mapped again. Anytime you want to move Widget (where widget = project or folder etc) from $/something to another $/something use the Move tool. Checkin in the change and you should be good to go.
在 Team Foundation Server 中创建工作文件夹时,您可以指定要映射的服务器路径、计算机上的本地路径以及递归级别。对于这些路径下的文件夹,服务器根据这些映射(和递归级别)确定本地路径,但它实际上不会创建任何新映射或任何长期状态,本地路径将被重新计算。 (换句话说,重命名后无需清理任何内容。)
如果在服务器上签入了文件夹重命名,要在本地工作区上更新它,您只需对父文件夹执行 get 操作即可。例如,如果 $/Foo 重命名为 $/Bar,您应该对 $/ 执行 get 操作,以便在本地获取该重命名。
When you create a Working Folder within Team Foundation Server, you specify the server path you want to map, the local path on your computer, and the recursion level. For folders beneath those paths, the server determines the local paths based on those mappings (and recursion level) but it does not actually create any new mappings or any long-term state, the local paths will be recalculated. (In other words, there's nothing to clean up after a rename.)
If a folder rename is checked in on the server, to update this on your local workspace, you simply need to do a get on the parent folder. For example, if $/Foo is renamed to $/Bar, you should do a get on $/ in order to get that rename locally.
又好又容易。每次通过将文件检入 TFS 来关联文件时,TFS 都会通过在映射到工作区的列表文件夹中创建对它的引用来记住源路径。
要清理此问题,请打开 Visual Studio,连接到 TFS。转到“文件”菜单,选择“工作区”。您将看到 Visual Studio 已设法为您创建的所有映射。请随意记录或删除您不感兴趣的内容。 http://msdn .microsoft.com/en-us/library/ms181386.aspx
HTH。
干杯,塔伦
Nice and easy. Everytime you associate a file by checking it into TFS, TFS remembers the source path by creating a reference to it in the list folders mapped to your workspaces.
To clean this up, open Visual Studio, Connect to TFS. Go to File menu, chose Workspaces. You will see all the mappings that visual studio has managed to create for you. Feel free to clock or delete the ones you are not interested in. http://msdn.microsoft.com/en-us/library/ms181386.aspx
HTH.
Cheers, Tarun