tags:

views:

84

answers:

1

I have a couple of Subversion repositories that look like:

/Core
  /trunk
    /External
      /LibraryA
        - LibraryA.dll
        - LibraryA.pdb
      /LibraryB
        - LibraryB.dll
        - LibraryB.pdb

/Website
  /trunk
    /Website
      ...
      /Bin
      ...

I would like to bring in the files contained in /Core/trunk/External/LibraryA and /Core/trunk/External/LibraryB into the folder /Website/trunk/Website/Bin using svn:externals using the following lines:

  • /svn/Core/trunk/External/LibraryA@HEAD Bin
  • /svn/Core/trunk/External/LibraryB@HEAD Bin

When I add the above lines to the svn:externals property of the /Website/trunk/Website folder, the files brought in from the latter line overwrite the files brought in from the former line, so I end up with:

/Website
  /trunk
    /Website
      ...
      /Bin
        - LibraryB.dll
        - LibraryB.pdb
      ...

Can someone suggest the right way of doing it? I would like to end up with:

/Website
  /trunk
    /Website
      ...
      /Bin
        - LibraryA.dll
        - LibraryA.pdb
        - LibraryB.dll
        - LibraryB.pdb
      ...

If I could convert the Website into an ASP.NET Web Application project, I could have dealt with it differently. As things stand, this project has to remain an ASP.NET Web Site project, so that's a constraint I am working with.

Update:

To achieve what I wanted to achieve, I have pulled in the two libraries into their own folders under a Libraries folder such that I end up with the following structure:

/Website
  /trunk
    /Website
      ...
      /Bin
          - LibraryA.dll *
          - LibraryA.pdb *
          - LibraryA.dll.refresh +
          - LibraryB.dll *
          - LibraryB.pdb *
          - LibraryB.dll.refresh +
      /Libraries
        /LibraryA
          - LibraryA.dll +
          - LibraryA.pdb +
        /LibraryB
          - LibraryB.dll +
          - LibraryB.pdb +
      ...

I have then added the two libraries to the website as references, which pulls in all of the libraries as needed. When one adds libraries as references to a ASP.NET Web Site project, the system creates .refresh files (as shown above). Only those .refresh files should be checked in from the /Bin folder. All other files and folders should be added to the Subversion ignore list via svn:ignore.

To be clear: the files in the above listing marked with an asterisk should be added to svn:ignore, whereas the files marked with a + should be added to Subversion.

A: 

I doubt this is possible simply using externals. An external is basically just saying "automatically check this out here and update it when I update the rest of the repository". If you could do this, you would need to be able to store information about two repositories in the same directory, and SVN doesn't allow that.

What you could consider doing is to create NTFS symlinks to those files, checked out somewhere else (which could be done using externals). You can use the mklink for that on Windows Vista and later. On 2000/XP/2003, you can use the CreateHardLink to create a hard link instead - there's probably a tool to do that, but I'm not aware of any specific one.

Of course, you can also use hard links on Vista and later, if you prefer - mklink allows that as well. Note, however, that hard links can only point to files on the same volume, which symbolic links do not require.

Michael Madsen
Thanks for pointing out why svn:externals would not work. While symlinks would work on my local machine, they wouldn't work on other machines. I think what I am going to have to do is to cause the continuous integration process governing the /Core repository to commit the libraries to the /Website/trunk/Website/Bin folder. I would have liked svn:externals to have worked, but I suppose that's not going to happen.
Umar Farooq Khawaja
Well, if you're only dealing with a limited set of machines, it might be feasible to just create the symlinks on each of them. It depends on your situation, though.
Michael Madsen