changeset 263:e8eb427c6d71

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-----
author mpm@selenic.com
date Sun, 05 Jun 2005 10:50:03 -0800
parents 3db700146536
children 4c1d7072d5cd
files mercurial/hg.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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"),