teach rawcommit about dirstate.parents()
authormpm@selenic.com
Fri, 03 Jun 2005 12:54:14 -0800
changeset 228 2502aa663484
parent 227 f57519cddd3d
child 229 1b11da6ee69e
teach rawcommit about dirstate.parents() -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 teach rawcommit about dirstate.parents() manifest hash: 776f28b896f8de8c39c9edb0956faca78c1a827a -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCoMN2ywK+sNU5EO8RAnJpAKCh5MVSMNlk1GRYPm7IOavhurYPLgCfYc9w k4bTiV62lgoyItdmkynS1Jg= =gVyk -----END PGP SIGNATURE-----
mercurial/hg.py
--- a/mercurial/hg.py	Fri Jun 03 12:46:38 2005 -0800
+++ b/mercurial/hg.py	Fri Jun 03 12:54:14 2005 -0800
@@ -388,7 +388,8 @@
             raise inst
 
     def rawcommit(self, files, text, user, date, p1=None, p2=None):
-        p1 = p1 or self.current or nullid
+        p1 = p1 or self.dirstate.parents()[0] or nullid
+        p2 = p2 or self.dirstate.parents()[1] or nullid
         pchange = self.changelog.read(p1)
         pmmap = self.manifest.read(pchange[0])
         tr = self.transaction()
@@ -401,13 +402,14 @@
                 self.ui.warn("Read file %s error, skipped\n" % f)
                 continue
             r = self.file(f)
+            # FIXME - need to find both parents properly
             prev = pmmap.get(f, nullid)
             mmap[f] = r.add(t, tr, linkrev, prev)
 
         mnode = self.manifest.add(mmap, tr, linkrev, pchange[0])
         n = self.changelog.add(mnode, files, text, tr, p1, p2, user ,date, )
         tr.close()
-        self.setcurrent(n)
+        self.dirstate.setparents(p1, p2)
         self.dirstate.clear()
         self.dirstate.update(mmap.keys(), "n")