获取最新版本不起作用
我刚刚在家用计算机上安装了 Perforce,这样我就可以在家工作,而无需拖着工作计算机四处走动。
我使用了与工作中使用的工作区相同的工作区,但是当我尝试获取最新版本时,我没有获取所有文件。尽管按如下方式映射,但某些子文件夹仍然丢失: //depot/some_folder/... //My_Workspace/some_folder/...
some_folder
有一个子文件夹 some_subfolder
但我的工作区由于某种原因没有拉入该文件夹...“View”中的其他行与 some_folder
没有任何关系,所以我认为它们不是的问题。
有人有什么想法吗?
I've just set up Perforce on my home computer so that I can work at home without having to lug my work computer around.
I used the same workspace as the one I use at work, but when I try to get the latest revision, I don't get all of the files. Some subfolders are missing despite being mapped like this: //depot/some_folder/... //My_Workspace/some_folder/...
some_folder
has a subfolder some_subfolder
but my workspace didn't pull that folder in for some reason... None of the other lines in "View" have anything to do with some_folder
so I don't think they are the issue.
Anyone have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Perforce 服务器跟踪您在工作区中提取的文件。这样做是为了速度,因此当您执行“获取最新修订版”时,它只会提取需要更新的文件。由于您使用相同的工作区,Perforce 认为您已经使它们同步。你有两个选择。
使用 p4sync -f //files/... (如果您使用 p4v,右键单击 -> 获取修订版,然后在选项中单击强制复选框)这将告诉 perforce 将所有内容同步到最新修订版。但是,您将必须在工作和家庭中使用此选项,因为 Perforce 现在会认为您已同步所有内容,而实际上只有家里的文件同步。
为家庭和工作使用不同的工作空间。
The Perforce server tracks what files you pull in your workspace. This is done for speed, so when you do a "Get latest revision" it will only pull the files that need to be updated. Since you are using the same workspace, Perforce thinks you have them in sync already. You have 2 options.
Use p4 sync -f //files/... (If your using p4v, right click->Get revision, then in the options click the Force checkbox) This will tell perforce to sync everything to the latest revision. But then you will have to use this option at work and home, since Perforce will now think you have everything in sync, when really only the files at home are in sync.
Use a different workspace for home and work.
在 GUI 中,不要执行“获取最新版本”,而是尝试执行“获取修订版...”的上下文菜单,然后在出现的窗口中选中“强制”复选框并尝试一下。
更新编辑:经过反思,人们仍然看到这篇文章,这可能会受益于一些解释。
发生的情况是,Perforce 存储有关每个工作区的元数据以及它已同步、更改的文件等。假设您有三个文件夹,A、B 和 C。在您的工作计算机上,您同步文件夹 A。服务器更新您的元数据并显示“酷,工作区 foo 有文件夹 A”。当您转到家用计算机并同步 A 和 B 时,服务器会显示“好吧,酷,工作区 foo 已经有文件夹 A,不要同步该文件夹,只同步 B。”这就是为什么您只看到一些文件像这样传过来。
我上面给出的建议,使用“强制”选项,基本上告诉服务器“忽略你认为我拥有的东西,只给我我刚刚要求的一切。”这工作得很好,但是你绕过了服务器上你所拥有的图片。由于多种原因,这很危险。例如,您可以破坏本地的工作,因为当您使用“force”选项时,服务器会很乐意覆盖您拥有的任何内容。
这里更好的答案是创建一个 foo_work 和一个 foo_home 工作区,并保持工作独立。如果您需要在工作区之间转移正在进行的工作,您可以使用搁置选项,和/或创建开发分支并将未完成的工作签入开发分支。
In the GUI, instead of doing the get latest, try doing the context menu for "Get Revision...", and in that window that comes up, check the "Force" checkbox and give that a try.
Update edit: Realized upon reflection and folks still seeing this post, that this might benefit from a little explanation.
What's happening is that Perforce stores metadata about each workspace and what files it has sync'd, changed, etc. So let's say you have three folders, A, B and C. On your work machine, you sync folder A. The server updates your metadata and says "Cool, workspace foo has folder A". When you go to your home machine, and sync A and B, the server's like "Ok cool, workspace foo already has folder A, don't sync that one, only sync B." That's why you're only seeing some files come over like that.
My suggestion I gave above, using the "force" option, basically tells the server "Ignore what you THINK I have, just gimme everything I just asked for." Which works fine, but you're getting around the server's picture of what you have. That's dangerous for a number of reasons. For example you could clobber work you had locally because the server will happily overwrite whatever you have when you use the "force" option.
The more better answer here is to create a foo_work and a foo_home workspace, and keep the work independent. If you need to transfer in-progress work between workspaces, you can use the shelve option, and/or create a development branch and check-in unfinished work to the dev branch.
创建一个不同的工作区以在您的家庭计算机上使用。不要尝试在两台不同的计算机上使用相同的工作区,除非它们指向相同的底层文件系统。
Create a different workspace to use on your home computer. Do not try to use the same workspace on two different computers unless they're pointing at the same underlying filesystem.
就我而言,我必须将最新版本放入不同的文件夹中。我从原始工作区重命名了该文件夹,但如果我执行“获取最新”,它就不起作用。我创建了一个不同的工作区,并且它有效。
In my case, I have to get the latest into a different folder. I renamed the folder from original workspace, but it did not work if I do a get latest. I created a different workspace, and it worked.