[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: Hal Vaughan <hal_at_thresholddigital.com>
Date: 2005-12-26 23:55:22 CET

On Monday 26 December 2005 02:03 pm, Bruce DeVisser wrote:
> 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:

So the basic intent here is to move all the .svn directories in the WC Agent
dir (/thresh/threshNet/work/Agent) into the live version
(/thresh/threshNet/Agent) -- am I following you on this?

> 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.

I'm really just editing them (deleting some files, adding some others at
times). I do all this in /thresh/threshNet/Agent, then sync so it is
mirrored in /thresh/threshNet/work/Agent.

> > 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.

I just wanted to be sure I could commit over and over and over -- ad
infinitum.

> > 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?

My thought was that if Subversion did NOT distinguish between the directories,
when it did the checkout to a directory, then finds a link there instead,
that I could just use the link without moving anything. While I can move the
Agent directory and it won't be missed for a while, there are other parts
that need to stay in place. From what you say, though, I figure I can check
out a working copy of the entire thing into a dummy directory, then copy over
all the .svn files from the entire tree into the live version, and that
should work. If it does, then I can edit and commit on the live version as
much as I want with no trouble. When I need an older version, I just check
it out somewhere in the /thresh/threshNet/work tree, and copy only the files
out of there that I need.

Does that make sense? For some reason, I'm having a hard time getting used to
the entire setup.

> 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.

That helps a lot in understanding it. So I can check out to a directory, move
it anywhere, and as long as the correct .svn files are there, it'll commit
properly -- is that right?

> Hope this helps.
>
> Bruce

Thanks, Bruce!

Hal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Dec 26 23:57:39 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.