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

Re: #3334: schedule a WC item for re-add when tree-conflicted - help please!

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 14 Jan 2009 12:27:57 +0000

Julian Foad wrote:
> Julian Foad wrote:
> The first things I'll do next are: write a dedicated test for this, and
> compare the results of the two scenarios below to see empirically what
> I'm missing in terms of WC state.

It doesn't matter that I'm replying to myself: the conversation is still
helpful.

OK, my little test is revealing exactly what I needed to know, using the
directory tree 'A' in the 'greek tree' as the subject.

Differences between 'New scenario' (tree conflict) and 'Existing
scenario' (manual copy):

In A/.svn/entries:

  THIS_DIR:
    revision = 2 (New) 1 (Existing)

  B:
  C:
  D:
    copied = false (New) true (Existing)

  mu:
    revision = 1 (New) None (meaning THIS_DIR's, i.e. 1) (Existing)

In A/B/.svn/entries:

  E:
  F:
    copied = false (New) true (Existing)

OK, so I'm supposed to set 'copied' on all entries, not only (for dirs)
on the 'this_dir' entry. My bad.

As for A's 'revision' ... that's unexpected, to me. A's parent is at r2,
in which 'A' does not exist, and in that entries file the entry for 'A'
has no revision, meaning r2.

I don't understand the inconsistency, and suspect that it "just works",
so I'll try replicating it.

I re-named and re-numbered my test scenario like this:

Directory A/ exists in r1 and is deleted in r2.
A/ should end up exactly the same in these two scenarios:

New scenario:
[[[
  svn checkout -r1 # in which A/ exists
  modify_dir('A') # make local mods in A/
  svn update -r2 # tries to delete A/
  svn resolve --accept=mine # keep the local, re-added version
]]]

Existing scenario:
[[[
  svn checkout -r4 # in which A/ does not exist
  svn copy -r1 A_url 'A' # make a pristine copy of A_at_1
  modify_dir('A') # make local mods in A/
]]]

where modify_dir('A') makes property changes to A itself and/or
adds/deletes/modifies any of A's children.

And here's my little 'test' (it doesn't actually test the results yet,
just runs the two scenarios so I can do a manual diff of the results
afterwards).

[[[
Index: subversion/tests/cmdline/update_tests.py
===================================================================
--- subversion/tests/cmdline/update_tests.py (revision 35228)
+++ subversion/tests/cmdline/update_tests.py (working copy)
@@ -4260,6 +4260,77 @@
                                         None, None, None, None, None,
                                         True)

+# Issue #3334: a delete-onto-modified tree conflict should leave the node
+# scheduled for re-addition.
+def tree_conflict_uc2_schedule_re_add(sbox):
+ "tree conflicts on update UC2, schedule re-add"
+ sbox.build()
+ os.chdir(sbox.wc_dir)
+
+ from svntest.actions import run_and_verify_svn, run_and_verify_resolve
+ from svntest.actions import run_and_verify_update
+ from svntest.verify import AnyOutput
+
+ """A directory tree 'A' should end up exactly the same in these two
+ scenarios:
+
+ New scenario:
+ [[[
+ svn checkout -r1 # in which A exists
+ modify_dir('A') # make local mods in A
+ svn update -r2 # tries to delete A
+ svn resolve --accept=mine # keep the local, re-added version
+ ]]]
+
+ Existing scenario:
+ [[[
+ svn checkout -r2 # in which A does not exist
+ svn copy -r1 A . # make a pristine copy of A_at_1
+ modify_dir('A') # make local mods in A
+ ]]]
+
+ where modify_dir('A') makes property changes to A itself and/or
+ adds/deletes/modifies any of A's children.
+ """
+
+ dir = 'A' # an existing tree in the WC and repos
+ dir_url = sbox.repo_url + '/' + dir
+
+ def modify_dir(dir):
+ """Make some set of local modifications to an existing tree.
+ Suggestions: prop change, add a child, delete a child, change a child."""
+ run_and_verify_svn(None, AnyOutput, [],
+ 'propset', 'p', 'v', dir)
+
+ # Prepare the repos so that a later 'update' has an incoming deletion:
+ # Delete the dir in the repos, making r2
      * + run_and_verify_svn(None, AnyOutput, [],
+ '-m', '', 'delete', dir_url)
+
+ # New scenario
+ # (The dir is already checked out.)
+
+ modify_dir(dir)
+
+ expected_output = None
+ expected_disk = None
+ expected_status = None
+ run_and_verify_update('A', expected_output, expected_disk, expected_status)
+
+ run_and_verify_resolve([dir], '--recursive', '--accept=mine-full', dir)
+
+ # Existing scenario
+
+ wc2 = 'wc2'
+ dir2 = os.path.join(wc2, dir)
+
+ run_and_verify_svn(None, AnyOutput, [],
+ 'checkout', '-r2', sbox.repo_url, wc2)
+ run_and_verify_svn(None, AnyOutput, [],
+ 'copy', dir_url + '@1', dir2)
+ modify_dir(dir2)
+
]]]

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1024070
Received on 2009-01-14 13:28:23 CET

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.