# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1279619707 -7200 # Node ID 2060e0ca8dd5af757383408a1303f348562ae77f # Parent 8fb38602e3edb2b76bba660d1fd0c540fa3923d2 svnwrap: add get_revision(); a thing wrapper around ra.do_update() This function allows us to fetch the entire contents of a revision in a reasonably efficient manner. diff --git a/hgsubversion/svnwrap/svn_swig_wrapper.py b/hgsubversion/svnwrap/svn_swig_wrapper.py --- a/hgsubversion/svnwrap/svn_swig_wrapper.py +++ b/hgsubversion/svnwrap/svn_swig_wrapper.py @@ -549,6 +549,17 @@ class SubversionRepo(object): else: raise + def get_revision(self, revision, editor): + ''' feed the contents of the given revision to the given editor ''' + + e_ptr, e_baton = delta.make_editor(editor) + + reporter, reporter_baton = ra.do_update(self.ra, revision, "", True, + e_ptr, e_baton) + + reporter.set_path(reporter_baton, "", revision, True, None) + reporter.finish_report(reporter_baton) + def get_unified_diff(self, path, revision, other_path=None, other_rev=None, deleted=True, ignore_type=False): """Gets a unidiff of path at revision against revision-1.