changeset 3109:62044d161470

merge: simplify hook code
author Matt Mackall <mpm@selenic.com>
date Sun, 17 Sep 2006 17:07:44 -0500
parents 67874ebbb7dd
children 40e777bda455
files mercurial/merge.py
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Sun Sep 17 16:50:17 2006 -0500
+++ b/mercurial/merge.py	Sun Sep 17 17:07:44 2006 -0500
@@ -264,12 +264,10 @@
         # we don't need to do any magic, just jump to the new rev
         p1, p2 = p2, nullid
 
-    xp1 = hex(p1)
-    xp2 = hex(p2)
-    if p2 == nullid: xxp2 = ''
-    else: xxp2 = xp2
+    xp1, xp2 = hex(p1), hex(p2)
+    if p2 == nullid: xp2 = ''
 
-    repo.hook('preupdate', throw=True, parent1=xp1, parent2=xxp2)
+    repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
 
     # update files
     updated, merged, removed, unresolved = 0, 0, 0, 0
@@ -361,6 +359,6 @@
             repo.ui.status(_("There are unresolved merges with"
                              " locally modified files.\n"))
 
-    repo.hook('update', parent1=xp1, parent2=xxp2, error=unresolved)
+    repo.hook('update', parent1=xp1, parent2=xp2, error=unresolved)
     return unresolved