changeset 1466:16242cec256f

svncommands: unlink revmap file before rebuildmeta Rebuildmeta should success regardless of what the content of revmap is. The recent refactor makes it possible that a corrupted revmap file can prevent "rebuildmeta" from running successfully. This patch fixes the issue by deleting the revmap file before doing actual rebuildmeta so that the revmap object can be created successfully.
author Jun Wu <quark@fb.com>
date Tue, 07 Jun 2016 02:56:55 +0100
parents 32166f557518
children 53e306a6086b
files hgsubversion/svncommands.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
@@ -65,6 +65,10 @@ def _buildmeta(ui, repo, args, partial=F
     youngest = 0
     startrev = 0
     branchinfo = {}
+
+    if not partial:
+        hgutil.unlinkpath(meta.revmap_file, ignoremissing=True)
+
     revmap = meta.revmap
     if partial:
         try: