# HG changeset patch # User mpm@selenic.com # Date 1117832054 28800 # Node ID 2502aa6634845c927190d90dfe98bdb46baa2aee # Parent f57519cddd3dad6875ae96bbeac626b054182242 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----- diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -388,7 +388,8 @@ class localrepository: 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 @@ class localrepository: 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")