取消搁置文件时,如何指示 Perforce 进行合并而不是覆盖或还原? [英] How can I instruct Perforce to merge instead of overwrite or revert when unshelving a file?

查看:54
本文介绍了取消搁置文件时,如何指示 Perforce 进行合并而不是覆盖或还原?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何指示 Perforce 在取消搁置搁置的文件时将更改合并到工作区中现有的、打开的和修改的文件中仓库?Perforce 似乎为用户提供的唯一选项是覆盖或恢复工作区中的现有文件,但这不允许,例如,从多个更改列表中取消搁置和集成对同一文件的更改.有没有办法绕过这个限制?

How can I instruct Perforce to merge changes into an existing, open, and modified file in the workspace when unshelving a file shelved in the depot? The only options that Perforce appears to offer the user is to overwrite or revert the existing file in the workspace, but this does not allow, for example, to unshelve and integrate changes to the same file from multiple change lists. Is there a way around this limitation?

推荐答案

我通常做的是右键单击搁置的文件并选择Diff Against Workspace File".当您打开 Diff 工具时,您可以在工具栏中选择一个按钮来在右窗格中编辑文件".这实质上开始了双向合并.对于每个差异,您可以从搁置文件中选择所需的更改(默认情况下从工作区文件中选择差异).

What I typically do is right-click on the shelved file and select "Diff Against Workspace File". When you open up the Diff tool, you can select a button in the toolbar to "Edit file in right pane". This essentially starts a two-way merge. With each difference you can select the changes you want from the shelved file (differences are selected from the workspace file by default).

但是,如果 Perforce 添加一种合并功能来更自动地执行此操作,那就太好了.

However, it would be nice if Perforce added a type of merge feature to do this more automatically.

编辑添加:Perforce 现在有一个内置功能,可以在取消搁置时合并文件.如果用户取消搁置也已签出的文件,并且未选中取消搁置前还原签出的文件",Perforce 将标记该文件以进行解析.我查看了发行说明,但无法找到添加此功能的版本,但基于此 link(参见 p4 unshelve 描述的近底部),它是在 2012.1 之前添加的.

Edit to add: Perforce now has a built-in capability to merge files when unshelving. If the user unshelves a file that is also checked out, and "Revert checked out files before unshelving" is unchecked, Perforce will mark that file for resolve. I looked through the release notes and was not able to find in which version this capability was added, but based on this link (see near bottom of p4 unshelve description), it was added no later than 2012.1.

再次编辑添加:该功能是在服务器的 2011.1 版中添加的.这是发行说明:

Edited again to add: That feature was added in release 2011.1 of the server. Here's the release note:

#299614 (Bug #38221, #39099) **
    Unshelving a file opened for edit over a file already opened
    for edit in the workspace is now allowed. A resolve record is
    created when unshelving, and the user must then run 'p4 resolve'
    to resolve the workspace files with the shelved files.

这篇关于取消搁置文件时,如何指示 Perforce 进行合并而不是覆盖或还原?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆