Configurable target directories (was: Error when I ran vss2svn)

Toby Johnson toby at etjohnson.us
Fri Jan 26 16:12:49 CST 2007


Dirk wrote:
> Hi,
>
> in the last vss2svn version I did a small modification to import to a 
> different base directory (actually the /trunk directory) during the 
> import. This modification was done in order to separate the trunk and 
> the labels folder. But this could be easily extended to create any 
> other directory structure, e.g
>
> VSS Root Project to /project/trunk
> Labels to /labels/project/
>
> or whatever. All missing directories are created on the fly. The only 
> modification necessary is to make these directories configurable. Or 
> you make the modification yourself. Have a look at the following lines:
>
> * changing trunk: use the command line switch --trunkdir="/project/trunk"
> * changing the labels directory: 
> http://www.pumacode.org/projects/vss2svn/browser/trunk/script/vss2svn.pl#L1618 
>

I was thinking about this as well, and was trying to visualize what 
problems we might run into if we not only made the trunk and label 
target directories configurable, but any arbitrary directories as well. 
For example we could accept a "directory map" input file such as:

${ROOT} = /trunk
${LABELS} = /labels
${ORPHANS} = /orphan
/projects/Website1 = /trunk/web/site1
/projects/Website2 = /trunk/web/site2

The only problem I can see with this approach is if someone wanted to 
map "on top of" an existing directory (for example if /trunk/web already 
existed in VSS, you can't "map" a directory there) or if two maps 
pointed to the same or overlapping locations (for example you can't map 
one project to /trunk/web and another to /trunk/web/site1).

This mapping would have to occur at the point where the dumpfile is 
actually written, so that vss2svn always uses the "real" paths for all 
internal operations and state tracking, and the actual mapping is just a 
superficial layer at the very end. That way copy operations, etc. would 
still function correctly because we would have translated the path when 
it was first added as well as when it was copied or moved.

I'd have to take a closer look at the effort required to do this and if 
there are other technical limitations but at first glance it sounds 
plausible. Any thoughts?

toby



More information about the vss2svn-users mailing list