Mercurial > evolve
changeset 5052:b9a7fb0a0a49
evolve: use obsutil._getobsfate() directly
It's been there since 4.5 (265cd9e19d26), we can safely rely on it.
It's necessary though to use the correct spelling of superseded.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 28 Nov 2019 11:37:56 +0700 |
parents | 9346f0e934be |
children | 196ed65594dc |
files | hgext3rd/evolve/__init__.py hgext3rd/evolve/obshistory.py |
diffstat | 2 files changed, 6 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py Sat Dec 28 23:20:05 2019 +0530 +++ b/hgext3rd/evolve/__init__.py Thu Nov 28 11:37:56 2019 +0700 @@ -703,10 +703,10 @@ debugcommand = b"hg evolve --list --content-divergent" basemsg = _(b"%s has diverged, use '%s' to resolve the issue") solvemsg = basemsg % (shortnode, debugcommand) - elif reason == b'superseed': + elif reason == b'superseded': msg = _(b"use 'hg evolve' to update to its successor: %s") solvemsg = msg % successors[0] - elif reason == b'superseed_split': + elif reason == b'superseded_split': msg = _(b"use 'hg evolve' to update to its tipmost successor: %s") if len(successors) <= 2: @@ -734,10 +734,10 @@ rev = repo[scmutil.revsingle(unfilteredrepo, changeid)] reason, successors = obshistory._getobsfateandsuccs(unfilteredrepo, rev.node()) - # Be more precise in case the revision is superseed - if reason == b'superseed': + # Be more precise in case the revision is superseded + if reason == b'superseded': reason = _(b"successor: %s") % successors[0] - elif reason == b'superseed_split': + elif reason == b'superseded_split': if len(successors) <= 2: reason = _(b"successors: %s") % b", ".join(successors) else:
--- a/hgext3rd/evolve/obshistory.py Sat Dec 28 23:20:05 2019 +0530 +++ b/hgext3rd/evolve/obshistory.py Thu Nov 28 11:37:56 2019 +0700 @@ -834,30 +834,6 @@ return None return _prepare_hunk(lines) -def _getobsfate(successorssets): - """ Compute a changeset obsolescence fate based on his successorssets. - Successors can be the tipmost ones or the immediate ones. - Returns one fate in the following list: - - pruned - - diverged - - superseed - - superseed_split - """ - - if len(successorssets) == 0: - # The commit has been pruned - return b'pruned' - elif len(successorssets) > 1: - return b'diverged' - else: - # No divergence, only one set of successors - successors = successorssets[0] - - if len(successors) == 1: - return b'superseed' - else: - return b'superseed_split' - def _getobsfateandsuccs(repo, revnode, successorssets=None): """ Return a tuple containing: - the reason a revision is obsolete (diverged, pruned or superseed) @@ -867,7 +843,7 @@ if successorssets is None: successorssets = obsutil.successorssets(repo, revnode) - fate = _getobsfate(successorssets) + fate = obsutil._getobsfate(successorssets) # Apply node.short if we have no divergence if len(successorssets) == 1: