Thursday, October 1, 2009

Using Mercurial with TFS – Read Only files

After having used mercurial on a project, going back to TFS was slightly depressing. However I did stumble upon this post which shows how you can use mercurial to fill in some of the TFS gaps around working offline.

If you working on a particularly large piece and don’t want to go through the pain of a TFS branch, being able to commit to a local repository frequently and take advantage of mercurials merge algorithms when committing to older revisions is incredibly useful – anyway I digress.

The post outlined above seems to have omitted the way TFS tracks changes against files using the read-only file system flag. So when you attempt to update you ‘tracking’ workspace with a bunch of new changes mercurial will be unable to update the read-only files.

If you attempt to make all the project files writable, TFS will pick up changes against files even when they have no differences with the workspace version.

Luckily there is a handy mercurial extension called MakeWritableExtension which will make read-only files writable if it tries to make changes to them.

http://mercurial.selenic.com/wiki/MakewritableExtension

If like me your using TortoiseHg, either update the Mercurial.ini in the TortoiseHg folder or in your local user folder. I added the following lines to C:\Program Files\TortoiseHg\Mercurial.ini

[extensions]
makewritable = C:/makewritable.py

And then copied the python file in the link above in my C drive (because I’m lazy). Whenever mercurial tries to update a read-only file you will get:

image 

Now it will automatically set the edited files to writable thus doing a TFS checkout and making life a *lot* easier.

3 comments:

  1. nym nym nym nym nym nym nym nym nym nym nym nym nym nym nym nym ................... so this is what you've been doing with yourself.....hehehe

    ReplyDelete
  2. Woori Casino | Welcome Bonus - Choices Casino
    Welcome Bonus · 1xbet Enjoy the Welcome Package of 200% 메리트 카지노 쿠폰 up to €500 · Great Casino Rewards · Bonus of 30% Bonus Up to €500 · 우리카지노 Play the Games of Woori at

    ReplyDelete
  3. Casino & Gaming | Michigan Casinos - Mapyro
    Play a wide 정읍 출장안마 variety of slots and live casino games at the best MI Casinos in 2021. All the best games for players 오산 출장샵 with a 목포 출장마사지 passion for 거제 출장샵 slots. 상주 출장안마

    ReplyDelete