# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1376056872 -7200 # Node ID b95fa72c74aea83fafe956fd72e60b0f10b064a6 # Parent dcf9eff9b5b791870b020a6639bb733a0be9c9f8 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. diff --git a/hgsubversion/svnwrap/subvertpy_wrapper.py b/hgsubversion/svnwrap/subvertpy_wrapper.py --- 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 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 @@ -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)