views:

39

answers:

1

I have a development project in Mercurial. In the project I have multiple directories scattered about which all should contain the same basic files (CSS, images, etc).

I'd like to have all of the directories point to the same underlying directory, so that if I edit a file in one place, it is updated everywhere else. Basically a UNIX soft link to the directory, but I want this to work within Mercurial (and I'm on Windows).

I've looked at subrepos, but they seem to either point to a existing directory or a remote one. I'd rather not have the network involved. In my case I just what to point the subrepos to a relative location in the same project.

What's the best way to accomplish this (with the least amount of pain)?

A: 

Going back to Windows 2000 (but still on the NT line), you can use directory hardlinks with NTFS. As far as Mercurial is concerned, however, they would be different files that just happen to get updated simultaneously, and the junction points would not be stored in the repo. (I'd create a script to set them up when cloning.)

This would also be incompatible with cloning the repo to a *nix environment. (Or at least I don't see how you could do it without conversion, which changes the repo, which means you can't push/pull between them.)

This is a poor hack, but, barring more details from you, it was all I came up with.

Roger Pate
Thanks Roger, but I was looking for a Mercurial based solution. Although I develop on Windows, my repository also sits on Linux. I could use URLs in the subrepos, but I don't want them tied back to a specific piece of hardware. Some people will checkout on Windows, some on Linux. My preferred option would be to set it up and have it transparent to the coders. A second option would be to have to do just one step to update it. Right now, I am copying the same files over and over again which is annoying.
Paul W Homer
@Paul: I understand, and don't present this as an optimal solution by any means.
Roger Pate
Thanks Roger. What I'll probably do is wire it back to my linux box, if I can't find any better options.
Paul W Homer