Omer Zak wrote:
> I am now reading about Subversion.
> 
> Turns out that in order to get Subversion to properly manage and keep
> track of history of files even when they are copied or renamed, one
> should use 'svn copy' instead of 'cp' and 'svn move' instead of 'mv'.
> 
> I wonder whether shells (such as bash) have a facility to do
> directory-dependent aliasing.  For example, when your pwd is a directory
> checked out from a svn repository (could be identified as having .svn
> subdirectory or declared as such in .bash_profile), then your 'cp'
> becomes alias to a script which processes cp's arguments and issues the
> appropriate 'svn copy' command/s.
> 
>                                          --- Omer

I don't think you can really do that with a simple alias.

What you can do is create a shell function called mv that will check if
the file is in a subversion directory and do svn move on it. The
function will override the call to mv and you'll need to call the real
mv with /bin/mv.

This will require some work since you need to have 'mv a b' and 'svn
x/y/z/a b' and also handle the case when some files are in a subversion
controlled directory but are not version controlled (just temp files of
generated files).

This seems like quite a bit more work than just learning to do svn move IMO.

Baruch

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to