Mercurial > public > mercurial-scm > hg
comparison mercurial/obsutil.py @ 46113:59fa3890d40a
node: import symbols explicitly
There is no point in lazy importing mercurial.node, it is used all over
the place anyway. So consistently import the used symbols directly.
Fix one file using symbols indirectly via mercurial.revlog.
Differential Revision: https://phab.mercurial-scm.org/D9480
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Tue, 01 Dec 2020 21:54:46 +0100 |
parents | 89a2afe31e82 |
children | d35063ebd761 |
comparison
equal
deleted
inserted
replaced
46112:d6afa9c149c3 | 46113:59fa3890d40a |
---|---|
8 from __future__ import absolute_import | 8 from __future__ import absolute_import |
9 | 9 |
10 import re | 10 import re |
11 | 11 |
12 from .i18n import _ | 12 from .i18n import _ |
13 from .node import ( | |
14 hex, | |
15 short, | |
16 ) | |
13 from . import ( | 17 from . import ( |
14 diffutil, | 18 diffutil, |
15 encoding, | 19 encoding, |
16 error, | 20 error, |
17 node as nodemod, | |
18 phases, | 21 phases, |
19 pycompat, | 22 pycompat, |
20 util, | 23 util, |
21 ) | 24 ) |
22 from .utils import dateutil | 25 from .utils import dateutil |
955 if fate == b'pruned': | 958 if fate == b'pruned': |
956 return filteredmsgtable[b'pruned'] % changeid | 959 return filteredmsgtable[b'pruned'] % changeid |
957 elif fate == b'diverged': | 960 elif fate == b'diverged': |
958 return filteredmsgtable[b'diverged'] % changeid | 961 return filteredmsgtable[b'diverged'] % changeid |
959 elif fate == b'superseded': | 962 elif fate == b'superseded': |
960 single_successor = nodemod.short(successors[0][0]) | 963 single_successor = short(successors[0][0]) |
961 return filteredmsgtable[b'superseded'] % (changeid, single_successor) | 964 return filteredmsgtable[b'superseded'] % (changeid, single_successor) |
962 elif fate == b'superseded_split': | 965 elif fate == b'superseded_split': |
963 | 966 |
964 succs = [] | 967 succs = [] |
965 for node_id in successors[0]: | 968 for node_id in successors[0]: |
966 succs.append(nodemod.short(node_id)) | 969 succs.append(short(node_id)) |
967 | 970 |
968 if len(succs) <= 2: | 971 if len(succs) <= 2: |
969 fmtsuccs = b', '.join(succs) | 972 fmtsuccs = b', '.join(succs) |
970 return filteredmsgtable[b'superseded_split'] % (changeid, fmtsuccs) | 973 return filteredmsgtable[b'superseded_split'] % (changeid, fmtsuccs) |
971 else: | 974 else: |
1038 result.append( | 1041 result.append( |
1039 { | 1042 { |
1040 b'instability': b'content-divergent', | 1043 b'instability': b'content-divergent', |
1041 b'divergentnodes': divnodes, | 1044 b'divergentnodes': divnodes, |
1042 b'reason': b'predecessor', | 1045 b'reason': b'predecessor', |
1043 b'node': nodemod.hex(dset[b'commonpredecessor']), | 1046 b'node': hex(dset[b'commonpredecessor']), |
1044 } | 1047 } |
1045 ) | 1048 ) |
1046 return result | 1049 return result |