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

[PATCH] Non-recursive update fix

From: D.J. Heap <dj_at_shadyvale.net>
Date: 2003-07-12 09:34:00 CEST

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_at_mercury svn]$ svn ls file:///tmp/test
child/
parentfile
[dj_at_mercury svn]$ svn ls file:///tmp/test/child
childfile
[dj_at_mercury svn]$ svn co file:///tmp/test test
A test/child
A test/child/childfile
A test/parentfile
Checked out revision 3.
[dj_at_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.

Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c (revision 6455)
+++ subversion/libsvn_wc/adm_ops.c (working copy)
@@ -193,7 +193,7 @@
           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));
+ SVN_ERR (svn_wc__entries_write (entries, dir_access, pool));
         }
       else
         SVN_ERR (recursively_tweak_entries (dir_access, base_url,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jul 12 09:35:02 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.