hgkw/updatekw.py
branchupdatehook
changeset 5 85d1f5bf7cfc
child 19 d1f478aa61c5
equal deleted inserted replaced
3:b9f2c0853da3 5:85d1f5bf7cfc
       
     1 # $Hg: updatekw.py,v$
       
     2 
       
     3 from hgkw import kwexpander
       
     4 
       
     5 def updatekw(ui=None, repo=None, hooktype='', **args):
       
     6     '''Important: returns False on success, True on failure.'''
       
     7 
       
     8     if not ui or not repo or hooktype != 'update':
       
     9         # bail out with error
       
    10         return True
       
    11 
       
    12     parent1 = repo.dirstate.parents()[0]
       
    13     node = repo.changectx(parent1)
       
    14 
       
    15     (modified, added, removed, deleted,
       
    16             unknown, ignored, clean) = repo.status(node1=parent1)
       
    17 
       
    18     candidates = modified + added + clean
       
    19 
       
    20     return kwexpander.expandkw(ui, repo, parent1, node, candidates)