是否有可能使perforce表现得像颠覆?

时间:2022-06-01 18:28:11

Can perforce be adjusted so I don't need to "open files for edit"? Someone told me that this was a "feature", and that s/he guessed it could be turned off.

可以调整perforce,所以我不需要“打开文件进行编辑”吗?有人告诉我,这是一个“功能”,并且他/她猜测它可以被关闭。

5 个解决方案

#1


1  

See http://www.perforce.com/perforce/doc.081/manuals/p4guide/02_config.html (section Configuring workspace options). You can set the allwrite option, but even then you would have to do the offline synchronization or something like checking out all files and doing p4 revert -a (revert unchanged files) to find out which files you changed.

请参阅http://www.perforce.com/perforce/doc.081/manuals/p4guide/02_config.html(配置工作区选项部分)。您可以设置allwrite选项,但即使这样,您也必须执行脱机同步或类似检查所有文件并执行p4 revert -a(还原未更改的文件)以找出您更改的文件。

#2


1  

Although that's not a direct answer to your request, I though I could share a little trick.

虽然这不是你的请求的直接答案,但我可以分享一个小技巧。

In my editor (SciTE), I can define keyboard shortcuts, with a macro expanding to the path of the currently edited file, running an application. If your favorite editor can do that, you can adapt this trick.

在我的编辑器(SciTE)中,我可以定义键盘快捷键,宏可以扩展到当前编辑文件的路径,运行应用程序。如果您最喜欢的编辑器可以做到这一点,您可以调整这个技巧。

command.name.0.*=P4 edit
command.0.*=p4 edit -c default $(FileNameExt)
command.save.before.0.*=2

You can change the "default" to your current changelist number, too.

您也可以将“默认”更改为当前的更改列表编号。

Of course, if your editor/IDE has Perforce support, so much the better...

当然,如果您的编辑器/ IDE具有Perforce支持,那么更好......

#3


0  

One approach you can use is edit the readonly files on your synch'd branch. When you're ready to submit use the 'check consistency' File | More option to create a changelist on the basis of the modified files. There's probably a command-line way of doing this but I don't know what it is.

您可以使用的一种方法是编辑同步分支上的只读文件。当您准备提交时,请使用“检查一致性”文件|更多选项,以根据修改的文件创建更改列表。这可能是一种命令行方式,但我不知道它是什么。

#4


0  

According to the Wikipedia page on Perforce, they expect you to "open files for edit" so the server can maintain a list of files that are expected to get changed. If you want to edit files without doing this, you have to manually change your local copy from read-only to read-write.

根据Perforce上的*页面,他们希望您“打开文件进行编辑”,以便服务器可以维护预期会发生变化的文件列表。如果要在不执行此操作的情况下编辑文件,则必须手动将本地副本从只读更改为读写。

#5


0  

I will resist trying to reason with you as to why you wish to do this. Probably teh simples way to do this is the following.

我会拒绝向你推断你为什么要这样做。可能这样做的简单方法如下。

Check out the entire directory tree you are interested in eg

查看您感兴趣的整个目录树,例如

//depot/Projects/MyProj/...

All you files are now writeable and in editing (or checked out) mode. When you choose to submit your changes, simply do one of two things. Either right click the pending changelist and select Revert unchanged files to get rid of unchanged files before submitting or when submitting select the 'Dont Submit Unchanged Files' options under On Submit. This has the effect of only submitting the files you have changed.

您的所有文件现在都可以写入并处于编辑(或签出)模式。当您选择提交更改时,只需执行以下两项操作之一即可。要么右键单击待处理的更改列表,请选择还原未更改的文件以在提交之前删除未更改的文件,或者在提交时选择“提交时”下的“不提交未更改的文件”选项。这具有仅提交您已更改的文件的效果。

If you also check the box beside 'Check out submitted files after Submit' it will even reopen those files so that you can continue working until the next time you wish to submit.

如果您还选中“提交后检出提交的文件”旁边的框,它甚至会重新打开这些文件,以便您可以继续工作,直到您下次要提交。

This is essentially what you are looking for.

这基本上就是你要找的东西。

#1


1  

See http://www.perforce.com/perforce/doc.081/manuals/p4guide/02_config.html (section Configuring workspace options). You can set the allwrite option, but even then you would have to do the offline synchronization or something like checking out all files and doing p4 revert -a (revert unchanged files) to find out which files you changed.

请参阅http://www.perforce.com/perforce/doc.081/manuals/p4guide/02_config.html(配置工作区选项部分)。您可以设置allwrite选项,但即使这样,您也必须执行脱机同步或类似检查所有文件并执行p4 revert -a(还原未更改的文件)以找出您更改的文件。

#2


1  

Although that's not a direct answer to your request, I though I could share a little trick.

虽然这不是你的请求的直接答案,但我可以分享一个小技巧。

In my editor (SciTE), I can define keyboard shortcuts, with a macro expanding to the path of the currently edited file, running an application. If your favorite editor can do that, you can adapt this trick.

在我的编辑器(SciTE)中,我可以定义键盘快捷键,宏可以扩展到当前编辑文件的路径,运行应用程序。如果您最喜欢的编辑器可以做到这一点,您可以调整这个技巧。

command.name.0.*=P4 edit
command.0.*=p4 edit -c default $(FileNameExt)
command.save.before.0.*=2

You can change the "default" to your current changelist number, too.

您也可以将“默认”更改为当前的更改列表编号。

Of course, if your editor/IDE has Perforce support, so much the better...

当然,如果您的编辑器/ IDE具有Perforce支持,那么更好......

#3


0  

One approach you can use is edit the readonly files on your synch'd branch. When you're ready to submit use the 'check consistency' File | More option to create a changelist on the basis of the modified files. There's probably a command-line way of doing this but I don't know what it is.

您可以使用的一种方法是编辑同步分支上的只读文件。当您准备提交时,请使用“检查一致性”文件|更多选项,以根据修改的文件创建更改列表。这可能是一种命令行方式,但我不知道它是什么。

#4


0  

According to the Wikipedia page on Perforce, they expect you to "open files for edit" so the server can maintain a list of files that are expected to get changed. If you want to edit files without doing this, you have to manually change your local copy from read-only to read-write.

根据Perforce上的*页面,他们希望您“打开文件进行编辑”,以便服务器可以维护预期会发生变化的文件列表。如果要在不执行此操作的情况下编辑文件,则必须手动将本地副本从只读更改为读写。

#5


0  

I will resist trying to reason with you as to why you wish to do this. Probably teh simples way to do this is the following.

我会拒绝向你推断你为什么要这样做。可能这样做的简单方法如下。

Check out the entire directory tree you are interested in eg

查看您感兴趣的整个目录树,例如

//depot/Projects/MyProj/...

All you files are now writeable and in editing (or checked out) mode. When you choose to submit your changes, simply do one of two things. Either right click the pending changelist and select Revert unchanged files to get rid of unchanged files before submitting or when submitting select the 'Dont Submit Unchanged Files' options under On Submit. This has the effect of only submitting the files you have changed.

您的所有文件现在都可以写入并处于编辑(或签出)模式。当您选择提交更改时,只需执行以下两项操作之一即可。要么右键单击待处理的更改列表,请选择还原未更改的文件以在提交之前删除未更改的文件,或者在提交时选择“提交时”下的“不提交未更改的文件”选项。这具有仅提交您已更改的文件的效果。

If you also check the box beside 'Check out submitted files after Submit' it will even reopen those files so that you can continue working until the next time you wish to submit.

如果您还选中“提交后检出提交的文件”旁边的框,它甚至会重新打开这些文件,以便您可以继续工作,直到您下次要提交。

This is essentially what you are looking for.

这基本上就是你要找的东西。