Fix empty repository transaction bug
authormpm@selenic.com
Sun, 05 Jun 2005 10:50:03 -0800
changeset 263 e8eb427c6d71
parent 262 3db700146536
child 264 4c1d7072d5cd
Fix empty repository transaction bug -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Fix empty repository transaction bug manifest hash: df334795ea545f2401d08f734b8b6933af053d7b -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCo0lbywK+sNU5EO8RAr0TAJ9g9703187KXlpBOffNUGcYKGTLzwCgrqdq jYjtTvZZ3nRCt8biaTcad3c= =+riB -----END PGP SIGNATURE-----
mercurial/hg.py
--- a/mercurial/hg.py	Sun Jun 05 10:48:39 2005 -0800
+++ b/mercurial/hg.py	Sun Jun 05 10:50:03 2005 -0800
@@ -354,7 +354,10 @@
 
     def transaction(self):
         # save dirstate for undo
-        ds = self.opener("dirstate").read()
+        try:
+            ds = self.opener("dirstate").read()
+        except IOError:
+            ds = ""
         self.opener("undo.dirstate", "w").write(ds)
         
         return transaction.transaction(self.opener, self.join("journal"),