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

RE: svn commit: r1548214 - in /subversion/trunk/subversion: libsvn_wc/externals.c libsvn_wc/update_editor.c libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c libsvn_wc/wc_db.h libsvn_wc/wc_db_update_move.c tests/libsvn_wc/op-depth-test.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Fri, 6 Dec 2013 15:18:27 +0100

> -----Original Message-----
> From: Stefan Sperling [mailto:stsp_at_elego.de]
> Sent: vrijdag 6 december 2013 12:25
> To: dev_at_subversion.apache.org
> Subject: Re: svn commit: r1548214 - in /subversion/trunk/subversion:
> libsvn_wc/externals.c libsvn_wc/update_editor.c libsvn_wc/wc-queries.sql
> libsvn_wc/wc_db.c libsvn_wc/wc_db.h libsvn_wc/wc_db_update_move.c
> tests/libsvn_wc/op-depth-test.c
>
> On Thu, Dec 05, 2013 at 05:36:58PM -0000, rhuijben_at_apache.org wrote:
> > Author: rhuijben
> > Date: Thu Dec 5 17:36:57 2013
> > New Revision: 1548214
> >
> > URL: http://svn.apache.org/r1548214
> > Log:
> > Apply some minor preparing and correctness changes for the move logic in
> > libsvn_wc.
> >
> > This patch adds support for telling the wc_db revision bump whether an
> actual
> > update was performed. With this knowledge a lot of move handling logic
> can
> > be simplified for the generic case in future patches.
> >
> > Some parts of this patch are to make sure some move behavior patches I
> have
> > kept local for some time don't have to keep in sync with more files than
> > necessary.
>
> > * subversion/libsvn_wc/wc_db_update_move.c
> > (replace_moved_layer): Properly extend parent delete.
>
> Hi Bert,
>
> Can you please explain why the strlen() check is the right thing
> to do here? The log message doesn't make this clear, and there
> is no code comment either. It looks rather odd.

It is a check if dst_cp_relpath is the root node or any of its descendants.
The root of a move can never be shadowed (as the maximum op_depth of a node
is its own op depth... which is the move)

A string comparision is quite heavy if we really only need this check. (The
db query already assures that there will only be nodes at or below
dst_relpath)

        Bert

>
> > @@ -1643,6 +1644,11 @@ replace_moved_layer(const char *src_relp
> > scratch_pool));
> > if (!err)
> > err = svn_sqlite__step_done(stmt2);
> > +
> > + if (!err && strlen(dst_cp_relpath) > strlen(dst_relpath))
> > + err = svn_wc__db_extend_parent_delete(wcroot, dst_cp_relpath,
> kind,
> > + dst_op_depth,
scratch_pool);
> > +
> > if (err)
> > return svn_error_compose_create(err, svn_sqlite__reset(stmt));
> >
> >
Received on 2013-12-06 15:19:17 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.