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

[PATCH] Fix svn_repos_replay2 for txn root

From: Chia-liang Kao <clkao_at_clkao.org>
Date: 2006-12-08 05:48:44 CET

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)
+ {
+ 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);
+ }
+ 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;
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 8 05:50:11 2006

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