开发者

How to bring in multiple files into the same folder using svn:externals

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 li开发者_高级运维braries 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜