让 Delphi 7 与源代码管理配合得很好?

发布于 2024-12-03 22:42:19 字数 409 浏览 0 评论 0原文

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

例如,这个 diff 是通过打开项目并查看文件和表单来制作的(注意,我没有更改表单本身的任何内容)

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

是否有强制 Delphi 7 不更新这些无意义的设计时信息的方法?我希望它在 SVN 中运行良好,这样我就不必在提交之前不断恢复文件

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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

围归者 2024-12-10 22:42:20

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

答案是改变你的观点。您不必在提交之前恢复 dfms!我以前也这么做过。这只是一个你可以改变的习惯。

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

您需要熟悉您的工作副本可能是脏的,只要您不将脏东西签入(并且如果您恢复这些 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).

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.

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.

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文