mercurial/localrepo.py
changeset 1721 801756d0ca84
parent 1719 98072468ffde
child 1726 56fb048b102c
child 1730 0f1d2c75db5e
--- a/mercurial/localrepo.py	Tue Feb 14 15:47:25 2006 -0800
+++ b/mercurial/localrepo.py	Tue Feb 14 17:13:18 2006 -0800
@@ -376,7 +376,11 @@
             self.ui.status(_("nothing changed\n"))
             return None
 
-        self.hook("precommit", throw=True)
+        xp1 = hex(p1)
+        if p2 == nullid: xp2 = ''
+        else: xp2 = hex(p2)
+
+        self.hook("precommit", throw=True, p1=xp1, p2=xp2)
 
         if not wlock:
             wlock = self.wlock()
@@ -462,13 +466,14 @@
 
         user = user or self.ui.username()
         n = self.changelog.add(mn, changed + remove, text, tr, p1, p2, user, date)
+        self.hook('pretxncommit', throw=True, node=hex(n), p1=xp1, p2=xp2)
         tr.close()
 
         self.dirstate.setparents(n)
         self.dirstate.update(new, "n")
         self.dirstate.forget(remove)
 
-        self.hook("commit", node=hex(n))
+        self.hook("commit", node=hex(n), p1=xp1, p2=xp2)
         return n
 
     def walk(self, node=None, files=[], match=util.always):