You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "D.J. Heap" <dj...@shadyvale.net> on 2003/07/12 07:34:00 UTC

[PATCH] Non-recursive update fix

This seems like an obvious fix -- it fixes the problem and passes all 
ra_local tests on Linux.  Would someone take a quick look to verify?

In svn_wc__do_update_cleanup for a directory, the non-recursive code does:

SVN_ERR (svn_wc_entries_read (&entries, dir_access, TRUE, pool));
SVN_ERR (svn_wc__tweak_entry (entries, SVN_WC_ENTRY_THIS_DIR,
                              base_url, new_revision,
                              svn_wc_adm_access_pool (dir_access)));
SVN_ERR (svn_wc__entries_write (entries, adm_access, pool));

Notice how it reads entries for dir_access and then writes them out to 
adm_access...That overwrites the entries file of the parent folder with 
the child's.

To repro:

[dj@mercury svn]$ svn ls file:///tmp/test
child/
parentfile
[dj@mercury svn]$ svn ls file:///tmp/test/child
childfile
[dj@mercury svn]$ svn co file:///tmp/test test
A  test/child
A  test/child/childfile
A  test/parentfile
Checked out revision 3.
[dj@mercury svn]$ svn co file:///tmp/test test2
A  test2/child
A  test2/child/childfile
A  test2/parentfile
Checked out revision 3.
[dj@mercury svn]$ vi test/child/childfile
[dj@mercury svn]$ svn commit test -m "blah"
Sending        test/child/childfile
Transmitting file data .
Committed revision 4.
[dj@mercury svn]$ svn up -N test2/child
U  test2/child/childfile
Updated to revision 4.
[dj@mercury svn]$ svn st test2
?      test2/child
!      test2/childfile
?      test2/parentfile
[dj@mercury svn]$ cat test2/.svn/entries
<?xml version="1.0" encoding="utf-8"?>
<wc-entries
    xmlns="svn:">
<entry
    committed-rev="4"
    name="svn:this_dir"
    committed-date="2003-07-12T07:23:55.882677Z"
    url="file:///tmp/test/child"
    last-author="dj"
    kind="dir"
    uuid="2fb20def-3cc2-0310-816b-b97a72d250e5"
    revision="4"/>
<entry
    committed-rev="4"
    name="childfile"
    text-time="2003-07-12T07:26:07.000000Z"
    committed-date="2003-07-12T07:23:55.882677Z"
    checksum="3c9ee95b6d33ff40859c1b43641996fb"
    last-author="dj"
    kind="file"
    prop-time="2003-07-12T07:26:07.000000Z"/>
</wc-entries>

Log:

Prevent non-recursive updates of child directories from harming their 
parents.

* subversion/libsvn_wc/adm_ops.c
   (svn_wc__do_update_cleanup): For non-recursive directory updates,
   save entries to the right place.

Re: [PATCH] Non-recursive update fix

Posted by Philip Martin <ph...@codematters.co.uk>.
"D.J. Heap" <dj...@shadyvale.net> writes:

> * subversion/libsvn_wc/adm_ops.c
>    (svn_wc__do_update_cleanup): For non-recursive directory updates,
>    save entries to the right place.

Yes, please commit.

-- 
Philip Martin

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