本文介绍了使Delphi 7在源代码管理中发挥出色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

您好,我最近一直在Delphi 7项目中工作,而不断困扰我的一件事是* .dfm文件。每当我什至打开一个表单时,它都会更改.dfm文件。

Hello I've been having to work in a Delphi 7 project recently and one thing that constantly bugs me is the *.dfm files. Anytime I even open up a form, it will change the .dfm file.

例如,此差异仅通过打开项目并查看文件和表单来完成(注意,我没有对表单本身进行任何更改)

For example, this diff was made just by opening the project and viewing a file and form(note, I didn't change anything on the form itself)

@@ -1,6 +1,6 @@
 object FormPartnerInfo: TFormPartnerInfo
-  Left = 85
-  Top = 454
+  Left = 554
+  Top = 322
   BorderIcons = [biSystemMenu]
   BorderStyle = bsToolWindow

是否仍然有必要强迫Delphi 7不更新这些毫无意义的设计时信息?我希望它在SVN中发挥良好的作用,因此我不必在提交前继续还原文件

Is there anyway to force Delphi 7 to not update this pointless design-time information? I'd prefer to have it play nice in SVN so I don't have to keep reverting files before doing a commit

推荐答案

并不是Delphi会给您带来麻烦,提交对话框会默认加载每个更改的文件(而不是要求您显式检查要提交的文件)。这就是Tortoise中的设计缺陷,使您养成了恢复dfms的习惯(因为您可能只是想保持工作副本尽可能干净-像其他所有人一样)。

It's not Delphi that inconveniences you with a commit dialogue that loads with every changed file checked by default (rather than requiring you to explicitly check the files you want to commit). That's the design flaw in Tortoise that leads you to the habit of reverting dfms (because you probably just want to keep your working copy clean as possible - like everybody else).

答案是改变观点。提交前,您不必还原dfms!我也曾经这样做过。

The answer is to change your perspective. You don't have to revert the dfms before you commit! I used to do that too. That's just a habit you can change.

规则是不要无意中检查任何东西。如果您未打算更改表单,请在提交对话框中取消选中dfm。更好的是,取消选中所有内容,然后仅故意检查要提交的文件(也许在检查了差异之后)。或者,您可以通过右键单击文件本身上的提交(而不是右键单击文件夹上的提交)来提交单个文件。在右键单击提交之前,您甚至可以在资源管理器中选择多个文件(使用Shift或Ctrl)。

The rule is don't checkin anything unintentionally. If you didn't set out to change the form, then uncheck the dfm in the commit dialogue. Even better, uncheck everything then only intentionally check the files you want to commit (maybe after you've checked the diffs). Or you can commit individual files by right-click commit on the file itself (rather than right-click commit on the folder). You can even go so far as to multi-select (use Shift or Ctrl) the files in Explorer before you right-click commit.

您需要对知道您的工作副本可能很脏,只要您不要将这些脏东西检入即可(并且如果还原了这些dfms,则无论如何下次您打开该表格时,它们可能会再次更改)。

You need to become comfortable in the knowledge that your working copy can be dirty, as long as you keep the dirty stuff from being checked in (and if you revert those dfms, they'll probably get changed again next time you open that form anyway).

这篇关于使Delphi 7在源代码管理中发挥出色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 15:13