hgkw/keyword.py
branch0.9.2compat
changeset 613 cae62580bea3
parent 610 5b87f3ea105a
child 615 36de1c074e13
equal deleted inserted replaced
610:5b87f3ea105a 613:cae62580bea3
   686                         commithooks[name] = cmd
   686                         commithooks[name] = cmd
   687                         ui.setconfig('hooks', name, '')
   687                         ui.setconfig('hooks', name, '')
   688                 if commithooks:
   688                 if commithooks:
   689                     # store parents for commit hook environment
   689                     # store parents for commit hook environment
   690                     if p1 is None:
   690                     if p1 is None:
   691                         _p1, _p2 = repo.dirstate.parents()
   691                         _p1, _p2 = self.dirstate.parents()
   692                     else:
   692                     else:
   693                         _p1, _p2 = p1, p2 or nullid
   693                         _p1, _p2 = p1, p2 or nullid
   694                     _p1 = hex(_p1)
   694                     _p1 = hex(_p1)
   695                     if _p2 == nullid:
   695                     if _p2 == nullid:
   696                         _p2 = ''
   696                         _p2 = ''
   703                 # restore commit hooks
   703                 # restore commit hooks
   704                 for name, cmd in commithooks.iteritems():
   704                 for name, cmd in commithooks.iteritems():
   705                     ui.setconfig('hooks', name, cmd)
   705                     ui.setconfig('hooks', name, cmd)
   706                 if n is not None:
   706                 if n is not None:
   707                     kwt.overwrite(n, True, None)
   707                     kwt.overwrite(n, True, None)
   708                     repo.hook('commit', node=n, parent1=_p1, parent2=_p2)
   708                     self.hook('commit', node=n, parent1=_p1, parent2=_p2)
   709                 return n
   709                 return n
   710             finally:
   710             finally:
   711                 del _wlock, _lock
   711                 del _wlock, _lock
   712 
   712 
   713     repo.__class__ = kwrepo
   713     repo.__class__ = kwrepo