comparison mercurial/merge.py @ 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
comparison
equal deleted inserted replaced
3108:67874ebbb7dd 3109:62044d161470
262 262
263 if linear or overwrite: 263 if linear or overwrite:
264 # we don't need to do any magic, just jump to the new rev 264 # we don't need to do any magic, just jump to the new rev
265 p1, p2 = p2, nullid 265 p1, p2 = p2, nullid
266 266
267 xp1 = hex(p1) 267 xp1, xp2 = hex(p1), hex(p2)
268 xp2 = hex(p2) 268 if p2 == nullid: xp2 = ''
269 if p2 == nullid: xxp2 = '' 269
270 else: xxp2 = xp2 270 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
271
272 repo.hook('preupdate', throw=True, parent1=xp1, parent2=xxp2)
273 271
274 # update files 272 # update files
275 updated, merged, removed, unresolved = 0, 0, 0, 0 273 updated, merged, removed, unresolved = 0, 0, 0, 0
276 action.sort() 274 action.sort()
277 for a in action: 275 for a in action:
359 repo.ui.status(_("(branch merge, don't forget to commit)\n")) 357 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
360 elif unresolved: 358 elif unresolved:
361 repo.ui.status(_("There are unresolved merges with" 359 repo.ui.status(_("There are unresolved merges with"
362 " locally modified files.\n")) 360 " locally modified files.\n"))
363 361
364 repo.hook('update', parent1=xp1, parent2=xxp2, error=unresolved) 362 repo.hook('update', parent1=xp1, parent2=xp2, error=unresolved)
365 return unresolved 363 return unresolved
366 364