diff hgext/convert/subversion.py @ 13052:5fb924ee44d5 stable

convert/svn: fix changed files list upon directory replacements When branch2/dir was replacing branch1/dir, we only marked branch2/dir files a changed. Add branch1/dir files as they may not exist in branch2.
author Patrick Mezard <pmezard@gmail.com>
date Mon, 29 Nov 2010 20:13:11 +0100
parents 614f0d8724ab
children 5314cbb775f6
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Fri Nov 26 20:05:16 2010 -0600
+++ b/hgext/convert/subversion.py	Mon Nov 29 20:13:11 2010 +0100
@@ -656,13 +656,20 @@
                     # If the directory just had a prop change,
                     # then we shouldn't need to look for its children.
                     continue
-                elif ent.action == 'R' and parents:
+                if ent.action == 'R' and parents:
                     # If a directory is replacing a file, mark the previous
                     # file as deleted
                     pmodule, prevnum = self.revsplit(parents[0])[1:]
                     pkind = self._checkpath(entrypath, prevnum, pmodule)
                     if pkind == svn.core.svn_node_file:
                         removed.add(self.recode(entrypath))
+                    elif pkind == svn.core.svn_node_dir:
+                        # We do not know what files were kept or removed,
+                        # mark them all as changed.
+                        for childpath in self._iterfiles(pmodule, prevnum):
+                            childpath = self.getrelpath("/" + childpath)
+                            if childpath:
+                                changed.add(self.recode(childpath))
 
                 for childpath in self._iterfiles(path, revnum):
                     childpath = self.getrelpath("/" + childpath)