[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: How to convert a regular file to a sym link?

From: Saulius Grazulis <grazulis_at_ibt.lt>
Date: 2005-12-02 09:24:06 CET

On Thursday 01 December 2005 18:55, Matt England wrote:

> >I would try something like this (careful, commands untested! Dont run them
> > as root, check before!):
> >
> >*nix> for i in `svn st | awk '/^~/{print $2}'`; do ( set -x; mv $i $i-old;
> > svn del $i; svn ci -m "Deleting $i" $i; mv $i-old $i; svn add $i; sv ci
> > "Committing new $i"; ) done
> Ok, so this looks like an automated means to do execute the manual process
> describe above, and that's a good thing.


> However, I was hoping there was an alternative way to do this via
> subversion, at least on a per-file basis, other then the svn del-then-add
> process, chiefly because said process loses the file history properties (I
> think).

I am not aware the Subversion command that would do this.

> Any further thoughts?

Are situation when file<->symlink conversion happens often in your case? If
so, what about writing svn-file-to-symlink script that accepts filenames as
arguments and runs the above procedure? Could be a generally usefull tool...

Since this problem can be (relatively easyly) solved by external means, and
the problem is, generally, rare, it would probably be an overkill to include
this functionality into Subversion directly, what you think?

> In any case, thanks for the above automation code.

Don't mention :)

NB: I have spotted the bug there, the las command should read: "... sv ci
"Committing new $i" $i; ) done" (note the $i addition, so that only that one
file gets checked in, not the whole tree).

Dr. Saulius Grazulis
Institute of Biotechnology
Graiciuno 8
LT-02241 Vilnius
Lietuva (Lithuania)
fax:          (+370-5)-2602116
tel.: office: (+370-5)-2602556
      mobile: (+370-684)-49802, (+370-614)-36366
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 2 09:07:54 2005

This is an archived mail posted to the Subversion Users mailing list.