hgkw/updatekw.py
branchupdatehook
changeset 28 c7f5821f3513
parent 19 d1f478aa61c5
child 32 b70b38b15fa4
equal deleted inserted replaced
27:d00d45c7ddaf 28:c7f5821f3513
     7 
     7 
     8     if hooktype != 'update':
     8     if hooktype != 'update':
     9         # bail out with error
     9         # bail out with error
    10         return True
    10         return True
    11 
    11 
    12     p1, p2 = args['parent1'], args['parent2']
    12     n1, n2 = args['parent1'], args['parent2']
    13     node1 = repo.changelog.lookup(p1)
    13     r1 = repo.changelog.lookup(n1)
    14     if p2:
    14     if n2:
    15         node2 = repo.changelog.lookup(p2)
    15         r2 = repo.changelog.lookup(n2)
    16         # next line for debugging only (check merges)
    16         # next line for debugging only (check merges)
    17         ui.warn('parent2: %s\n' % p2)
    17         ui.warn('parent2: %s\n' % n2)
    18     else:
    18     else:
    19         node2 = None
    19         r2 = None
    20 
    20 
    21     (modified, added, removed, deleted,
    21     (modified, added, removed, deleted,
    22             unknown, ignored, clean) = repo.status(node1=node1, node2=node2)
    22             unknown, ignored, clean) = repo.status(node1=r1, node2=r2)
    23     candidates = modified + added + clean
    23     candidates = modified + added + clean
    24 
    24 
    25     return kwexpander.expandkw(ui, repo,
    25     if  candidates:
    26             node1, p1, candidates, update=True)
    26         return kwexpander.expandkw(ui, repo, r1, n1, candidates, update=True)