Making Delphi 7 play nice with source control? [closed]

假如想象 提交于 2019-12-24 00:41:06

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/7390670/making-delphi-7-play-nice-with-source-control

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