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

Re: Unusable working copy after add/rm/add/merge

From: Ivan Zhakov <chemodax_at_gmail.com>
Date: 2006-03-16 15:19:28 CET

On 3/16/06, Erik Huelsmann <e.huelsmann@gmx.net> wrote:
> > --- Urspr√ľngliche Nachricht ---
> > Von: "Garrett Rooney" <rooneg@electricjellyfish.net>
> > An: "Simon Large" <simon@skirridsystems.co.uk>, "Subversion Dev List"
> > <dev@subversion.tigris.org>
> > Betreff: Re: Unusable working copy after add/rm/add/merge
> > Datum: Tue, 14 Mar 2006 15:05:29 -0800
> >
> > On 3/14/06, Simon Large <simon@skirridsystems.co.uk> wrote:
> > > Garrett Rooney wrote:
> > > > On 3/10/06, Simon Large <simon@skirridsystems.co.uk> wrote:
> > > >> Hi folks,
> > > >>
> > > >> This was reported on the TSVN list today.
> > > >> Add file and commit
> > > >> Delete file and commit
> > > >> Add same filename again and commit.
> > > >> Merge -r3:1 to revert to original file.
> > > >> WC is terminally broken.
> > > >>
> > > >> It's a bit contrived, but it shouldn't break the WC.
> > > >
> > > > Interestingly, if you insert an 'svn up' after the final 'svn ci' and
> > > > before the 'svn merge' it works fine. Must be something screwy in the
> > > > working copy code I guess.
> > >
> > > Any further comment on this? Should I file an issue?
> >
> > Yes, please do. I'm hoping to get a chance to look into it more
> > closely, but I don't know when I'll find the time.
>
> Were you using recent trunk?
>
> Exactly this should have been fixed by the wc-replacements update last
> autumn.
>
I found problem's source. Subversion lost revision number when
replacing file. This code in svn_wc_add_repos_file2():
subversion/libsvn_wc/update_editor.c:2932
  /* Set the new revision number and URL in the entry and clean up some other
     fields. */
  SVN_ERR(tweak_entry(log_accum, adm_access, base_name,
                      ent->revision,
                      new_URL, pool));

ent is parent dir entry. Patch like this should fix all problems.
Index: subversion/libsvn_wc/update_editor.c
===================================================================
--- subversion/libsvn_wc/update_editor.c (revision 18897)
+++ subversion/libsvn_wc/update_editor.c (working copy)
@@ -2932,7 +2932,8 @@
   /* Set the new revision number and URL in the entry and clean up some other
      fields. */
   SVN_ERR(tweak_entry(log_accum, adm_access, base_name,
- ent->revision, new_URL, pool));
+ dst_entry ? dst_entry->revision : ent->revision,
+ new_URL, pool));

   SVN_ERR(install_added_props(log_accum, adm_access, dst_path,
                               new_base_props, new_props, pool));

I'm ready to commit it, but before I should write test. I really hate
python test writing :)

--
Ivan Zhakov
Received on Thu Mar 16 16:16:04 2006

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