You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Chia-liang Kao <cl...@clkao.org> on 2003/06/27 09:42:26 UTC

incremental checkout (#695)

Hi,

for my incremental cvs->svn by vcp to work with large repository,
it requires partial co'ed working copy to be able to checkout 
other parts of the same repository.

So I was looking at #695 and tried to implement a variant of
the 2nd use case described in #695:

# svn co http://server/path/to/dir/subdir 
Add '<entry name="subdir" kind="dir"/>' to .svn/entries in current dir. 

I was thinking about the following:

# svn co http://server/path/to/dir/subdir path/to/wc/subdir

1. if the target directory does not exist,
2. iterate over the parents of the url and path,
3. if the parent of path we are checking is a wc and has the 
   same url as the corresponding parent of url,
4. call svn_wc_putback_dir to put the hierarchy under the
   putback_root, and have client_update to fix everything else.

Is this behaviour reasonable?

I've already had a buggy svn_wc_putback_dir that adds the wc entry
in the parent and this-dir entry in the target. but svn_client_update
doesn't update it, it got cleaned up instead. maybe someone could
also hint me what magic I should spell for the wc_entry?

Cheers,
CLK

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] incremental checkout (#695)

Posted by Chia-liang Kao <cl...@clkao.org>.
Hi,

attached is the patch. this should make Andrew's scenario work
(http://www.contactor.se/~dast/svn/archive-2003-04/0555.shtml)

change message:

* libsvn_wc/adm_ops.c, adm_ops.h
  (svn_wc_putback_dir): new function to putback directories not
    checked out by checkout -N.

* libsvn_client/checkout.c
  (_check_for_putback): new function to check if the checkout
    url and the target are commonly rooted, thus allowed to
    be putback.
  (svn_client__checkout_internal): hook up the putback
    functionality for svn_node_none now.

some notes:
the svn_wc_putback_dir creates directory and adm files except the
leaf dir. the admin files contains only this-dir and the subdir
entries. let update fix the rest.

this only works for target that doesn't exists in the wc, since
it requires the leaf directroy not to exist (see below about the
incomplete flag), and we definitely don't want to rm the wc for that.

also it should be fixed to allow the target to be a existing wc so
the following would work:

# svn co -N http://server/repo mycheckout
# svn co http://server/repo/trunk/projectA mycheckout/trunk/projectA
(later on we want to checkout the parent for some reasons)
# svn co http://server/repo/trunk mycheckout/trunk

I thought the right way is to use the incomplete flag, which doesn't
seem to DWIM. maybe its sematic is not what i guessed. the behaviour of
incomplete this-dir is a bit weird to me. if we have foo/bar:

- if foo and bar are both incomplete: svn up updates bar, but not foo
- if only bar is incomplete: svn up claims updated but nothing is
  really done.
- if foo is incomplete and there's no bar in wc: svn up claims updated
  but nothing is really done; but it updates we do: cd foo; svn up

I know the Right solution should be using --depth as previously
discussed, but it simply involves too much work. I'd suggest using 
this patch to make -N less-broken before we have depth implemented.

Cheers,
CLK

On Fri, Jun 27, 2003 at 05:42:26PM +0800, Chia-liang Kao wrote:
> I was thinking about the following:
> 
> # svn co http://server/path/to/dir/subdir path/to/wc/subdir
> 
> 1. if the target directory does not exist,
> 2. iterate over the parents of the url and path,
> 3. if the parent of path we are checking is a wc and has the 
>    same url as the corresponding parent of url,
> 4. call svn_wc_putback_dir to put the hierarchy under the
>    putback_root, and have client_update to fix everything else.
> 
> Is this behaviour reasonable?