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

Re: svn commit: rev 6716 - in branches/fs-schema-changes/subversion: include libsvn_fs libsvn_repos svnadmin tests/libsvn_fs tests/libsvn_repos

From: <cmpilato_at_collab.net>
Date: 2003-08-13 00:15:51 CEST

kfogel@collab.net writes:

Am fixing other items in this review. Thanks for it.

> > +/* Derive the oldest of a set of copies which took place in filesystem
> > + FS -- bounded by the transactions START_TXN_ID and END_TXN_ID, and
> > + by the copy ids START_COPY_ID and END_COPY_ID -- which resulted in
> > + the creation of END_PATH. Return the previous location of the
> > + END_PATH as *SRC_REV/SRC_PATH, and the revision in which the copy
> > + occured as *DST_REV. Do all of this as part of TRAIL.
> >
> > +find_youngest_copy (svn_revnum_t *src_rev, /* return */
> > + const char **src_path, /* return */
> > + svn_revnum_t *dst_rev, /* return */
> > + const char *dst_path,
> > + svn_fs_t *fs,
> > + svn_revnum_t start_rev,
> > + const char *start_copy_id,
> > + svn_revnum_t end_rev,
> > + const char *end_copy_id, /* may be NULL */
> > + trail_t *trail)
> > +{
>
> How are 'dst_path', 'start_rev' and 'end_rev' used?

"Return the previous location of the END_PATH as *SRC_REV/SRC_PATH,
and the revision in which the copy occured as *DST_REV."

> > if (! (txn->copies && txn->copies->nelts))
> > - continue;
> > + goto loop_inc;
>
> Sure you don't want to call that 'loop_decr', since it's a decrement
> at the label?

Heh. Yep.

> > + /* Allocate our return array. */
> > + *revs = apr_array_make (pool, 4, sizeof (history_rev));
> > +
> > + /* Get a revision root for END, and an initial HISTORY baton. */
> > + SVN_ERR (svn_fs_revision_root (&root, fs, end, pool));
> > + SVN_ERR (svn_fs_node_history (&history, root, path, subpool1));
> > + oldpool = subpool1;
> > + newpool = subpool2;
>
> I got baffled by the 'subpool1, subpool2' vs 'oldpool, newpool'
> distinction. Why are there two pairs of variables, instead of just
> two variables? I saw 'tmppool' and the comment later about "crazy
> pool work", but wow -- is there some simpler way to do this? I
> haven't considered the problem deeply, just a hunch. Or did you start
> out thinking that too, and then learn better? :-)

The problem is that I have a loop which is generating a "current
thing" from a "previous thing", meaning I can't clear the subpool of
the previous thing until I have used it to get the "current thing".
The easiest way I could think of to do this was to have two subpools,
and just toggle back and forth between them.

But yeah, I think I can drop the subpool1 and subpool2 and just have
the old and new.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 13 00:20:07 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.