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

Re: [PATCH] Tree conflicts - revert and resolve per victim

From: Neels J. Hofmeyr <neels_at_elego.de>
Date: Thu, 06 Nov 2008 07:03:22 +0100

Julian Foad wrote:
> [[[
> CMD: svn resolved -R branch2/dP [...]
> Resolved conflicted state of 'branch2/dP'
> ### Deleted: resolve_f_e_cb('branch2/dP/D')
> svn: warning: Directory 'branch2/dP/D' is missing
> ]]]
>
> I haven't investigated what causes this output yet. I'm just posting
> this so you can look if you're working while I'm asleep (Neels!).

I've found this:

./subversion/libsvn_wc/lock.c:1029:
    _("Directory '%s' is missing"),

being the only match on a <<grep "s' is missing">> (besides translations).

That comes from svn_wc_adm_retrieve(). So some code somewhere along is
probably still not checking whether the node is *supposed* to be missing and
tries to get an adm on the missing dir branch2/dP/D.

I managed to reproduce the error with attached walk2.sh.txt script, and this
is the backtrace:

#0 svn_wc_adm_retrieve (adm_access=0xbfb1635c, associated=0x81f5978,
    path=0x81ed880 "bar/modified_dir", pool=0x81ed848)
    at subversion/libsvn_wc/lock.c:1030
#1 0x080ad058 in walker_helper (dirpath=0x81eafb0 "bar",
    adm_access=0x81f5978, walk_callbacks=0x819f188, walk_baton=0xbfb16418,
    depth=svn_depth_infinity, show_hidden=1,
    cancel_func=0x8055fd1 <svn_cl__check_cancel>, cancel_baton=0x0,
    pool=0x81f5858) at subversion/libsvn_wc/entries.c:3199
#2 0x080ad294 in svn_wc_walk_entries3 (path=0x81eafb0 "bar",
    adm_access=0x81f5978, walk_callbacks=0x819f188, walk_baton=0xbfb16418,
    depth=svn_depth_infinity, show_hidden=1,
    cancel_func=0x8055fd1 <svn_cl__check_cancel>, cancel_baton=0x0,
    pool=0x81f5858) at subversion/libsvn_wc/entries.c:3257
#3 0x080ad657 in svn_wc__walk_entries_and_tc (path=0x81eafb0 "bar",
    adm_access=0x81f5978, walk_callbacks=0x819e658, walk_baton=0x81f5dc0,
    depth=svn_depth_infinity, cancel_func=0x8055fd1 <svn_cl__check_cancel>,
    cancel_baton=0x0, pool=0x81f5858) at subversion/libsvn_wc/entries.c:3404
#4 0x080a0d42 in svn_wc_resolved_conflict4 (path=0x81eafb0 "bar",
    adm_access=0x81f5978, resolve_text=1, resolve_props=1, resolve_tree=1,
    depth=svn_depth_infinity, conflict_choice=svn_wc_conflict_choose_merged,
    notify_func=0x8059bb8 <notify>, notify_baton=0x81eafb8,
    cancel_func=0x8055fd1 <svn_cl__check_cancel>, cancel_baton=0x0,
    pool=0x81f5858) at subversion/libsvn_wc/adm_ops.c:2955

So it's the adm_retrieve in:
subversion/libsvn_wc/entries.c:3199
          SVN_ERR(walk_callbacks->handle_error
                  (entrypath,
                   svn_wc_adm_retrieve(&entry_access, adm_access, entrypath,
                   ^^^^^^^^^^^^^^^^^^^ subpool),
                   walk_baton, pool));

I also found another one of those error messages when trying to reproduce
yours, in walk.sh.txt.

This one is here:

#0 svn_wc_adm_retrieve (adm_access=0xbff25e9c, associated=0x81f58e0,
    path=0x81eb038 "bar/modified_dir", pool=0x81f5858)
    at subversion/libsvn_wc/lock.c:1030
#1 0x080a0c00 in resolve_found_entry_callback (
    path=0x81eb038 "bar/modified_dir", entry=0x81e2000, walk_baton=0x81f5920,
    pool=0x81f5858) at subversion/libsvn_wc/adm_ops.c:2907
#2 0x080ad355 in visit_tc_too_found_entry (path=0x81eb038 "bar/modified_dir",
    entry=0x81e2000, walk_baton=0xbff26018, pool=0x81f5858)
    at subversion/libsvn_wc/entries.c:3294
#3 0x080acebc in walker_helper (dirpath=0x81eb038 "bar/modified_dir",
    adm_access=0x81f58e0, walk_callbacks=0x819f188, walk_baton=0xbff26018,
    depth=svn_depth_infinity, show_hidden=1,
    cancel_func=0x8055fd1 <svn_cl__check_cancel>, cancel_baton=0x0,
    pool=0x81f5858) at subversion/libsvn_wc/entries.c:3150
#4 0x080ad294 in svn_wc_walk_entries3 (path=0x81eb038 "bar/modified_dir",
    adm_access=0x81f58e0, walk_callbacks=0x819f188, walk_baton=0xbff26018,
    depth=svn_depth_infinity, show_hidden=1,
    cancel_func=0x8055fd1 <svn_cl__check_cancel>, cancel_baton=0x0,
    pool=0x81f5858) at subversion/libsvn_wc/entries.c:3257
#5 0x080ad657 in svn_wc__walk_entries_and_tc (
    path=0x81eb038 "bar/modified_dir", adm_access=0x81f58e0,
    walk_callbacks=0x819e658, walk_baton=0x81f5920, depth=svn_depth_infinity,
    cancel_func=0x8055fd1 <svn_cl__check_cancel>, cancel_baton=0x0,

So it's this one:
subversion/libsvn_wc/adm_ops.c:2907
   /* Figger out the directory in which the conflict resides. */
  if (entry->kind == svn_node_dir)
    conflict_dir = path;
  else
    svn_path_split(path, &conflict_dir, &base_name, pool);
  SVN_ERR(svn_wc_adm_retrieve(&adm_access, baton->adm_access, conflict_dir,
                              pool));
          ^^^^^^^^^^^^^^^^^^^

I'm not sure whether this second case is omitting a message it should print.
Now it's also bedtime for me. So I'll leave all else to you :)

~Neels

#!/bin/sh

# The next line is the only line you should need to adjust.
SVNDIR=/arch/elego/svn/trunk

## GENERIC PREPARATIONS

SVN=${SVNDIR}/subversion/svn/svn
SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin

# use my local way if my script is there (neels).
if [ -f /usr/local/bin/superpower ]; then
  echo "##### REMEMBER TO SETUP YOUR ENVIRONMENT #####"
  SVN=svn
  SVNSERVE=svnserve
  SVNADMIN=svnadmin
fi

${SVN} --version

# Select an access method. If svn://, the svnserve setup is
# handled automagically by this script; but if http://, then
# you'll have to configure it yourself first.
#
# URL=http://localhost/neels/repos
# URL=svn://localhost/repos
URL=file:///`pwd`/repos

rm -rf repos wc

${SVNADMIN} create repos

# These are for svnserve only.
echo "[general]" > repos/conf/svnserve.conf
echo "anon-access = write" >> repos/conf/svnserve.conf
echo "auth-access = write" >> repos/conf/svnserve.conf

# The server will only be contacted if $URL is svn://foo, of course.
${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
# And put the kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k

${SVN} co -q ${URL} wc

cd wc

## ACTUAL TEST

create_stuff()
{
        if [ -n "$1" -a ! -e "$1" ]
        then
    mkdir $1

    mkdir $1/modified_dir
    echo "file" > $1/modified_dir/file_in_modified_dir
    
    ${SVN} add $1
        else
                echo "create_stuff needs a nonexistent directory argument"
        fi
}

modify_stuff()
{
        if [ -d "$1" ]
        then
    echo "more" >> $1/modified_dir/file_in_modified_dir
        else
                echo "modify_stuff needs a directory argument"
        fi
}

modify_stuff_for_conflict()
{
        if [ -d "$1" ]
        then
    ${SVN} rm $1/modified_dir
        else
                echo "modify_stuff needs a directory argument"
        fi
}

set -x
echo "===== creating rev 1"
create_stuff foo
${SVN} ci -m "rev 1"

echo "===== creating rev 2"
modify_stuff foo
${SVN} ci -m "rev 2"

echo "===== creating rev 3"
create_stuff bar
${SVN} ci -m "rev 3"

echo "===== creating rev 4"
modify_stuff_for_conflict bar
${SVN} ci -m "rev 4"

echo "===== merge, conflicts appear"
cd bar
${SVN} merge ${URL}/foo -c 2
cd ..

echo "===== resolve"
${SVN} resolved -R bar/modified_dir

## ACTUAL TEST ENDS
echo "====="
cd ..

./k

#!/bin/sh

# The next line is the only line you should need to adjust.
SVNDIR=/arch/elego/svn/trunk

## GENERIC PREPARATIONS

SVN=${SVNDIR}/subversion/svn/svn
SVNSERVE=${SVNDIR}/subversion/svnserve/svnserve
SVNADMIN=${SVNDIR}/subversion/svnadmin/svnadmin

# use my local way if my script is there (neels).
if [ -f /usr/local/bin/superpower ]; then
  echo "##### REMEMBER TO SETUP YOUR ENVIRONMENT #####"
  SVN=svn
  SVNSERVE=svnserve
  SVNADMIN=svnadmin
fi

${SVN} --version

# Select an access method. If svn://, the svnserve setup is
# handled automagically by this script; but if http://, then
# you'll have to configure it yourself first.
#
# URL=http://localhost/neels/repos
# URL=svn://localhost/repos
URL=file:///`pwd`/repos

rm -rf repos wc

${SVNADMIN} create repos

# These are for svnserve only.
echo "[general]" > repos/conf/svnserve.conf
echo "anon-access = write" >> repos/conf/svnserve.conf
echo "auth-access = write" >> repos/conf/svnserve.conf

# The server will only be contacted if $URL is svn://foo, of course.
${SVNSERVE} --pid-file svnserve-pid -d -r `pwd`
# And put the kill command in a file, in case need to run it manually.
echo "kill -9 `cat svnserve-pid`" > k
chmod a+rwx k

${SVN} co -q ${URL} wc

cd wc

## ACTUAL TEST

create_stuff()
{
        if [ -n "$1" -a ! -e "$1" ]
        then
    mkdir $1

    mkdir $1/modified_dir
    echo "file" > $1/modified_dir/file_in_modified_dir
    
    ${SVN} add $1
        else
                echo "create_stuff needs a nonexistent directory argument"
        fi
}

modify_stuff()
{
        if [ -d "$1" ]
        then
    echo "more" >> $1/modified_dir/file_in_modified_dir
        else
                echo "modify_stuff needs a directory argument"
        fi
}

modify_stuff_for_conflict()
{
        if [ -d "$1" ]
        then
    ${SVN} rm $1/modified_dir
        else
                echo "modify_stuff needs a directory argument"
        fi
}

set -x
echo "===== creating rev 1"
create_stuff foo
${SVN} ci -m "rev 1"

echo "===== creating rev 2"
modify_stuff foo
${SVN} ci -m "rev 2"

echo "===== creating rev 3"
create_stuff bar
${SVN} ci -m "rev 3"

echo "===== creating rev 4"
modify_stuff_for_conflict bar
${SVN} ci -m "rev 4"

echo "===== merge, conflicts appear"
cd bar
${SVN} merge ${URL}/foo -c 2
cd ..

echo "===== resolve"
${SVN} resolved -R bar

## ACTUAL TEST ENDS
echo "====="
cd ..

./k

Received on 2008-11-06 07:03:48 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.