subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Whitaker <capnw...@yahoo.com>
Subject Re: Creating sparse working copy retroactively from existing disjoint working copies
Date Thu, 16 Aug 2012 16:32:39 GMT
> From: Johan Corveleyn <jcorvel@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---

Mime
View raw message