diff hgsubversion/editor.py @ 1099:c6f7a8cfeca9

pull: correctly handle replacing the root of a branch with a non-copied directory Prior to this diff, we would either crash, or continue past the replacement without actually recording the change. This could lead to later failing varify if the state before and after weren't identical.
author David Schleimer <dschleimer@fb.com>
date Sat, 16 Nov 2013 16:16:59 -0800
parents 3df6ed4e7561
children ba8485b9fee0
line wrap: on
line diff
--- a/hgsubversion/editor.py
+++ b/hgsubversion/editor.py
@@ -401,6 +401,10 @@ class HgEditor(svnwrap.Editor):
         br_path, branch = self.meta.split_branch_path(path)[:2]
         if br_path is not None:
             if not copyfrom_path and not br_path:
+                # This handles the case where a branch root is
+                # replaced without copy info.  It will show up as a
+                # deletion and then an add.
+                self.meta.closebranches.discard(branch)
                 self.current.emptybranches[branch] = True
             else:
                 self.current.emptybranches[branch] = False