diff hgsubversion/svnwrap/subvertpy_wrapper.py @ 1054:131cb06dca76

svnwrap & pushmod: return a Revision when committing
author Dan Villiom Podlaski Christiansen <dan@cabo.dk>
date Fri, 09 Aug 2013 19:19:44 +0200
parents e775ffbcb359
children 8087267d0805
line wrap: on
line diff
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py
@@ -380,10 +380,14 @@ class SubversionRepo(object):
     def commit(self, paths, message, file_data, base_revision, addeddirs,
                deleteddirs, props, copies):
         """Commits the appropriate targets from revision in editor's store.
+
+        Return the committed revision as a common.Revision instance.
         """
-        def commitcb(*args):
-            commit_info.append(args)
-        commit_info = []
+        def commitcb(rev, date, author):
+            r = common.Revision(rev, author, message, date)
+            committedrev.append(r)
+
+        committedrev = []
         revprops = { properties.PROP_REVISION_LOG: message }
         # revprops.update(props)
         commiteditor = self.remote.get_commit_editor(revprops, commitcb)
@@ -464,6 +468,8 @@ class SubversionRepo(object):
             raise
         commiteditor.close()
 
+        return committedrev.pop()
+
     def get_replay(self, revision, editor, oldestrev=0):
 
         try: