Mercurial > hg
comparison hgext/rebase.py @ 43566:054846d213ba
index: use `index.get_rev` in `rebase.successorrevs`
The code is slightly updated in the process for simplicity.
Differential Revision: https://phab.mercurial-scm.org/D7349
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 09 Nov 2019 13:23:53 +0100 |
parents | 9f70512ae2cf |
children | 0fea03924990 |
comparison
equal
deleted
inserted
replaced
43565:f212cc5ffceb | 43566:054846d213ba |
---|---|
1641 | 1641 |
1642 | 1642 |
1643 def successorrevs(unfi, rev): | 1643 def successorrevs(unfi, rev): |
1644 """yield revision numbers for successors of rev""" | 1644 """yield revision numbers for successors of rev""" |
1645 assert unfi.filtername is None | 1645 assert unfi.filtername is None |
1646 nodemap = unfi.changelog.nodemap | 1646 get_rev = unfi.changelog.index.get_rev |
1647 for s in obsutil.allsuccessors(unfi.obsstore, [unfi[rev].node()]): | 1647 for s in obsutil.allsuccessors(unfi.obsstore, [unfi[rev].node()]): |
1648 if s in nodemap: | 1648 r = get_rev(s) |
1649 yield nodemap[s] | 1649 if r is not None: |
1650 yield r | |
1650 | 1651 |
1651 | 1652 |
1652 def defineparents(repo, rev, destmap, state, skipped, obsskipped): | 1653 def defineparents(repo, rev, destmap, state, skipped, obsskipped): |
1653 """Return new parents and optionally a merge base for rev being rebased | 1654 """Return new parents and optionally a merge base for rev being rebased |
1654 | 1655 |