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

Re: Creating sparse working copy retroactively from existing disjoint working copies

From: Robert Whitaker <capnwhit_at_yahoo.com>
Date: Thu, 16 Aug 2012 09:32:39 -0700 (PDT)

> From: Johan Corveleyn <jcorvel_at_gmail.com>
> Sent: Thursday, August 16, 2012 2:38 AM
>
> [ snip ]
>
> Can you try:
>
> $ svn update --depth immediates /svn-test/mom/daughter
>
> That might connect granddaughter1 to daughter, with an E notification.
> It might also pull in other siblings of granddaughter1 of course, but
> only the directories themselves, not the entire subtrees.
>

Hello Johan,

Thanks for the reply... I tried using "immediates" but it did not work...
I tried using both "--depth" and "--set-depth" with different results but
neither worked. I have two copy-and-pasted sessions below. The first one
tries using "immediates", and the second is another "hack" which fools svn
into checking out the directory.

==========
SESSION #1: (using immediates)
==========
The following is a copy-and-pasted svn session which tries to solve
our problem using the "immediates" option:

---o---
$ # Confirm "svn status" does not recognize "granddaughter1"

$ svn status /svn-test-2/mom/
?       /svn-test-2/mom/daughter/granddaughter1

$ # Try Johan's suggestion

$ svn update --depth immediates /svn-test-2/mom/daughter
At revision 85801.

$ svn status /svn-test-2/mom/
?       /svn-test-2/mom/daughter/granddaughter1

$ # Ooops... the "svn status" command still fails as shown above

$ # Now try --set-depth

$ svn update --set-depth immediates /svn-test-2/mom/daughter
svn: Failed to add directory '/svn-test-2/mom/daughter/granddaughter1':
a versioned directory of the same name already exists

$ # Now try --set-depth with --force flag

$ svn update --set-depth immediates --force /svn-test-2/mom/daughter
svn: Failed to add directory '/svn-test-2/mom/daughter/granddaughter1':
a versioned directory of the same name already exists

$ # NOTE 1: svn recognizes "granddaughter1" is versioned

$ # NOTE 2: svn still fails to connect to "daughter"

$ # NOTE 3: We still have a problem!
---o---

==========
SESSION #2: (using hack to fool svn)
==========
The following is a copy-and-pasted svn session which solves
our problem using a "hack" to fool svn... it would be nice to
have an "official" way of fixing this problem:

---o---
$ # Made some local changes to "granddaughter1" as a test

$ svn status /svn-test-3/mom/daughter/granddaughter1
?       /svn-test-3/mom/daughter/granddaughter1/bunny3.txt
M       /svn-test-3/mom/daughter/granddaughter1/bunny2.txt

$ # Confirm "daughter" still not linked to "granddaughter1"

$ svn status /svn-test-3/mom/daughter
?       /svn-test-3/mom/daughter/granddaughter1

$ # Move "granddaughter1" directory to fool svn

$ mv /svn-test-3/mom/daughter/granddaughter1 /svn-test-3/

$ svn status /svn-test-3/mom/daughter

$ # The "daughter" directory is now OK as shown by "svn status" above

$ # The "daughter" directory is empty because we moved "granddaughter1"

$ ls -al /svn-test-3/mom/daughter/
total 4
drwxr-xr-x+ 1 capnwhit Domain Users 0 Aug 16 10:59 .
drwxr-xr-x+ 1 capnwhit Domain Users 0 Aug 16 10:17 ..
drwxr-xr-x+ 1 capnwhit Domain Users 0 Aug 16 10:22 .svn

$ # Now repeat STEP 10 in original email with "--depth infinity"

$ svn update --depth infinity /svn-test-3/mom/daughter/granddaughter1
A    /svn-test-3/mom/daughter/granddaughter1
A    /svn-test-3/mom/daughter/granddaughter1/bunny1.txt
A    /svn-test-3/mom/daughter/granddaughter1/bunny2.txt
Updated to revision 85801.

$ # It works as expected

$ # The "daughter" and "granddaughter1" are now connected

$ svn status /svn-test-3/mom/daughter

$ # Now we remove the recently added "granddaughter1"

$ rm -rf /svn-test-3/mom/daughter/granddaughter1/

$ # Verify that svn recognizes missing directory

$ svn status /svn-test-3/mom
!       /svn-test-3/mom/daughter/granddaughter1

$ # Now we move back the safe "granddaughter1"

$ mv /svn-test-3/granddaughter1/ /svn-test-3/mom/daughter/

$ # Now svn recognizes the original "granddaughter1"

$ svn status /svn-test-3/mom
?       /svn-test-3/mom/daughter/granddaughter1/bunny3.txt
M       /svn-test-3/mom/daughter/granddaughter1/bunny2.txt

$ # NOTE 1: We can "hack" svn into connecting "granddaughter1"

$ # NOTE 2: It would be nice to have an official way to do this
---o---
Received on 2012-08-16 18:33:16 CEST

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.