changeset 314:3402cb9a4c06

More tweaking to rawcommit for repo conversion -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 More tweaking to rawcommit for repo conversion manifest hash: 912e7d61fc15845fd24baada9f553c2d38b26f06 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCrGdBywK+sNU5EO8RApbrAKCPVvxnSgkzAWpwc6uRDCCYAsqO7QCeMonn tZS4URbMI2aDQYw15wDEZHg= =C2Vn -----END PGP SIGNATURE-----
author mpm@selenic.com
date Sun, 12 Jun 2005 08:48:01 -0800
parents e75ea4662d81
children 5f0231b29f42
files mercurial/hg.py
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Sun Jun 12 08:23:29 2005 -0800
+++ b/mercurial/hg.py	Sun Jun 12 08:48:01 2005 -0800
@@ -439,6 +439,7 @@
         mm = m1.copy()
         mfm = mf1.copy()
         linkrev = self.changelog.count()
+        self.dirstate.setparents(p1, p2)
         for f in files:
             try:
                 t = self.wfile(f).read()
@@ -447,16 +448,19 @@
                 mfm[f] = tm
                 mm[f] = r.add(t, tr, linkrev,
                               m1.get(f, nullid), m2.get(f, nullid))
+                self.dirstate.update([f], "n")
             except IOError:
-                del mm[f]
-                del mfm[f]
+                try:
+                    del mm[f]
+                    del mfm[f]
+                    self.dirstate.forget([f])
+                except:
+                    # deleted from p2?
+                    pass
 
         mnode = self.manifest.add(mm, mfm, tr, linkrev, c1[0], c2[0])
         n = self.changelog.add(mnode, files, text, tr, p1, p2, user, date)
         tr.close()
-        self.dirstate.setparents(p1, p2)
-        self.dirstate.clear()
-        self.dirstate.update(files, "n")
 
     def commit(self, files = None, text = ""):
         commit = []