changeset 1459:b95fa72c74ae

svnwrap: allow committing directory copies We've never needed to record a directory copy, since Mercurial doesn't track directories, and thus can't represent copying them. However, in order to push a tag, we need to store the source as the copy source.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Fri, 09 Aug 2013 16:01:12 +0200
parents dcf9eff9b5b7
children e31c288e5059
files hgsubversion/svnwrap/subvertpy_wrapper.py hgsubversion/svnwrap/svn_swig_wrapper.py
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py
@@ -465,7 +465,11 @@ class SubversionRepo(object):
                 else:
                     # visiting a directory
                     if path in addeddirs:
-                        direditor = editor.add_directory(path)
+                        frompath, fromrev = copies.get(path, (None, -1))
+                        if frompath:
+                            frompath = self.path2url(frompath)
+                        direditor = editor.add_directory(path, frompath, fromrev)
+
                     elif path in deleteddirs:
                         direditor = editor.delete_entry(path, base_revision)
                         continue
--- a/hgsubversion/svnwrap/svn_swig_wrapper.py
+++ b/hgsubversion/svnwrap/svn_swig_wrapper.py
@@ -420,7 +420,10 @@ class SubversionRepo(object):
                 return bat
             if path not in file_data:
                 if path in addeddirs:
-                    bat = editor.add_directory(path, parent, None, -1, pool)
+                    frompath, fromrev = copies.get(path, (None, -1))
+                    if frompath:
+                        frompath = self.path2url(frompath)
+                    bat = editor.add_directory(path, parent, frompath, fromrev, pool)
                 else:
                     bat = editor.open_directory(path, parent, base_revision, pool)
                 batons.append(bat)