Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Switch working copy directory without updating

Scenario: Repository structure changed from /trunk/ to /projectName/trunk/ and the local copy is outdated and has a lot of modifications.

Question: How can I update the working copy directory path without updating the files.

Normally the solution to directory changes within the same repository would be to use the svn switch command. The problem is that it performs an update upon execution, the working copy is outdated and has a lot of local modifications that would conflict with the current revision.

What I'm looking for is the same behavior of the --relocate switch, which updates the path but doesn't update the files. This way I can regain the ability check the statuses and differences for each file separately while maintaining the local copy functional (this is my main concern).

The switch --help provides a few arguments to deal with conflicts but I could find nothing that would stop the update altogether.

Any ideas? Thanks a lot.

like image 528
Lando Avatar asked Jan 05 '12 20:01

Lando


People also ask

How do I change the working directory in svn?

If the working copy needs to reflect a new directory within the repository, use just svn switch. If the working copy still reflects the same repository directory, but the location of the repository itself has changed, use svn switch with the --relocate option.

How does svn switch work?

A switch moves your working copy through time and space. Because svn switch is essentially a variant of svn update, it shares the same behaviors; any local modifications in your working copy are preserved when new data arrives from the repository.

What is the local working copy?

A working copy is a directory that contains a collection of files which you can use as your private work area, as well as some extra files, created and maintained by Subversion. For example, each directory in your working copy contains an administrative directory named .


1 Answers

The solution for this particular case was simpler than I thought.

svn switch performs an update to the latest revision in the repository by default, specifying the BASE revision (last revision obtained from the repository) of the working copy left most of the files untouched.

I got the BASE revision of my working copy (294) by issuing the svn info command.

Then just issuing the switch command with the BASE revision updated the repository path leaving most of the files untouched.

svn switch -r 294 /projectName/trunk/

like image 153
Lando Avatar answered Sep 20 '22 21:09

Lando