diff hgext/convert/hg.py @ 5279:2dbd750b3ddd

convert: clear the dirstate before a conversion, invalidate it afterwards Clearing it before the conversion protects us from whatever data were there (file copies in particular). Invalidating it after the conversion avoids writing a possibly inconsistent dirstate to disk.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 01 Sep 2007 02:49:18 -0300
parents 70e9a527cc61
children 11e1e574da02
line wrap: on
line diff
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -32,8 +32,10 @@ class mercurial_sink(converter_sink):
     def before(self):
         self.wlock = self.repo.wlock()
         self.lock = self.repo.lock()
+        self.repo.dirstate.clear()
 
     def after(self):
+        self.repo.dirstate.invalidate()
         self.lock = None
         self.wlock = None