Reapplying changelist in perforce

北战南征 提交于 2019-12-12 09:37:23

问题


I'm rather new to perforce, but have quite a bit of other VCS experience...

Imagine this:

  • You submit changes (changelist 1)
  • A colleague submits changes on the same branch, accidentally overwriting your changes. (changelist 2)

I tried integrating (which P4V refuses to do since it's already integrated) and looked around for a way to just generate a patch that I could apply, but couldn't find anything.
For now, I will check out the versions in question and use an external merge tool, but it would be great to know if perforce supports this somehow.

Is there a way using the perforce tools (preferably in P4V) to reapply changelist 1?


回答1:


You can't reapply changelist 1, but you can reapply changelist 2.

  • Sync to changelist 1.
  • Check out the file(s). P4V will warn you that, "You do not have the latest revision of the file.", and ask you if you want to get the latest. Ignore the warning by clicking the "Don't Get Latest" button.
  • Now sync to the head revision (I'm assuming changelist 2 corresponds to the head revision). The file(s) will now need to be resolved, which you (or your colleague) can do, properly this time, without clobbering the changes you made in changelist 1.



回答2:


Probably the easiest way is to retrieve the changes from changelist 1 (//depot/...@1,@1) and then going through the normal resolve/merge+submit song and dance.



来源:https://stackoverflow.com/questions/3015062/reapplying-changelist-in-perforce

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!