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

Re: [PATCH] Fix svn_repos_replay2 for txn root

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2006-12-08 16:11:22 CET

Chia-liang Kao wrote:
> Is there a way to get the txn base revision from txn root without reopening
> the txn?
>
> [[[
>
> * subversion/libsvn_repos/replay.c:
> (svn_repos_replay2) When used with txn_root, set compare_root in baton
> to the base of the txn.
>
> ]]]
>
> === subversion/libsvn_repos/replay.c
> ==================================================================
> --- subversion/libsvn_repos/replay.c (revision 22155)
> +++ subversion/libsvn_repos/replay.c (local)
> @@ -710,10 +710,25 @@
> cb_baton.low_water_mark = low_water_mark;
>
> if (send_deltas)
> - SVN_ERR(svn_fs_revision_root(&cb_baton.compare_root,
> - svn_fs_root_fs(root),
> - svn_fs_revision_root_revision(root) - 1,
> - pool));
> + {
> + svn_revnum_t revision = svn_fs_revision_root_revision(root);
> + svn_revnum_t compare_root_revision;
> + if (revision == -1)

if (!SVN_IS_VALID_REVNUM(revision))

> + {
> + svn_fs_txn_t *txn;
> + const char *txn_name = svn_fs_txn_root_name(root, pool);
> + SVN_ERR(svn_fs_open_txn(&txn, svn_fs_root_fs(root),
> + txn_name, pool));
> + compare_root_revision = svn_fs_txn_base_revision(txn);

There's a bunch of code that does this exact stuff. We outta just have
svn_fs_txn_root_base_revision(). I'll see what I can put together.

> + }
> + else
> + compare_root_revision = revision - 1;
> +
> + SVN_ERR(svn_fs_revision_root(&cb_baton.compare_root,
> + svn_fs_root_fs(root),
> + compare_root_revision,
> + pool));
> + }
> else
> cb_baton.compare_root = NULL;

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on Fri Dec 8 16:11:43 2006

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