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

Re: Using Links For WC -- Will This Work?

From: Bruce DeVisser <bmdmail_at_sympatico.ca>
Date: 2005-12-26 20:03:41 CET

Hal,

On Mon, Dec 26, 2005 at 12:09:27PM -0500, Hal Vaughan wrote:
> When I set up Subversion on my system, I imported the entire system into
> Subversion, then found I could not check a single file or directory the way I
> needed to and could not commit changes from the original directories -- I had
> to check out files into a working copy, then commit the changes. I have what
> may be a round-about solution, which is a bit odd, but which seems like it'll
> work. I wanted to make sure I wasn't doing something that has effects I'm
> unaware of on Subversion and the repository.
>
> My project is in /thresh/threshNet -- a full directory tree. There was one
> section, /thresh/threshNet/Agent, that I was working on. So I
> created /thresh/threshNet/work, checked out the Agent directory into an Agent
> directory in work. That gave me a working copy which, at the time, was
> identical to the imported /thresh/threshNet/Agent I had imported. Then I did
> all I needed to do in the files in /thresh/threshNet/Agent, then did this:
>

> rsync -avz /thresh/threshNet/Agent/ /thresh/threshNet/work/Agent

It sounds as though you are not using your working copy except as
a means to check into your repository. If your live system can
tolerate the existence of new .svn directories (in terms of disk
space and in terms of performance), go ahead and turn your live
system into a working copy. I don't think the in-place import can
help you right now, since you have already imported. Here are two
basic approaches, either one of which should accomplish this
relatively painlessly. Before either one, ensure that
/thresh/threshNet/Agent and /thresh/threshNet/work/Agent (or
whichever pair of live vs working copy trees you are interested
in) are sync'd to your satisfaction.

1. Move the live copy out of the way and move the working copy
into its place:
  mv /thresh/threshNet/Agent /thresh/threshNet/old-Agent && \
  mv /thresh/threshNet/work/Agent /thresh/threshNet/Agent

If all works well after the moves, you can remove old-Agent to
clean up. Presumably it's okay for the Agent directory to
disappear for the split second required for those moves to
execute. It also assumes that the working copy version properly
reflects the live data directory, which may not be the case if
databases are present and updated on the fly. If either of those
is a problem, try #2, which is definitely safer because it will
only add files to your live directory and not replace them:

2. Copy the .svn directories from the
/thresh/threshNet/work/Agent tree into /thresh/threshNet/Agent.
For example,
  cp -a /thresh/threshNet/work/Agent/.svn /thresh/threshNet/Agent
You should do the same for any relevant subdirectories below
Agent as well. That is really all that is required to turn your
live copy into a working copy. Once satisfied that this is done
and working well, you can delete work/Agent.

At a minimum, run 'svn status' and understand its output before
assuming that all is well enough to delete the duplicate
directory.

To answer your questions:

> 1) Is this going to have any effects on Subversion or the
> repository that I won't see until later?

Does it do anything different from editing the files manually? If
not, then the answer is no.

> 2) Is there any problem with committing the same WC over and
> over and over?

This is the whole idea of a WC: you work on it, and punctuate
your work with commits whenever you feel like it.

> 3) If I do this:
> - Checkout to /thresh/threshNet/work/Agent
> - Delete /thresh/threshNet/work/Agent
> - Create a soft link from /thresh/threshNet/Agent
> to /thresh/threshNet/work/Agent

Does the 'Delete' line contain a typo (did you intend to delete
Agent instead of work/Agent)? This is basically the same as #1
above, but less direct. Why use a symlink when you can just move
the directory?

Note that the working copy doesn't keep any information to say
where it is; it only keeps track of where in the repository it
came from.

Hope this helps.

Bruce

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Dec 26 20:06:03 2005

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.