Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/tagmerge.py @ 46114: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 | d55b71393907 |
comparison
equal
deleted
inserted
replaced
46113:d6afa9c149c3 | 46114:59fa3890d40a |
---|---|
73 | 73 |
74 from __future__ import absolute_import | 74 from __future__ import absolute_import |
75 | 75 |
76 from .i18n import _ | 76 from .i18n import _ |
77 from .node import ( | 77 from .node import ( |
78 hex, | 78 nullhex, |
79 nullid, | |
80 ) | 79 ) |
81 from . import ( | 80 from . import ( |
82 tags as tagsmod, | 81 tags as tagsmod, |
83 util, | 82 util, |
84 ) | 83 ) |
85 | |
86 hexnullid = hex(nullid) | |
87 | 84 |
88 | 85 |
89 def readtagsformerge(ui, repo, lines, fn=b'', keeplinenums=False): | 86 def readtagsformerge(ui, repo, lines, fn=b'', keeplinenums=False): |
90 """read the .hgtags file into a structure that is suitable for merging | 87 """read the .hgtags file into a structure that is suitable for merging |
91 | 88 |
244 for n, pntags in enumerate((p1tags, p2tags)): | 241 for n, pntags in enumerate((p1tags, p2tags)): |
245 pntagset = set(pntags) | 242 pntagset = set(pntags) |
246 pnlosttagset = basetagset - pntagset | 243 pnlosttagset = basetagset - pntagset |
247 for t in pnlosttagset: | 244 for t in pnlosttagset: |
248 pntags[t] = basetags[t] | 245 pntags[t] = basetags[t] |
249 if pntags[t][-1][0] != hexnullid: | 246 if pntags[t][-1][0] != nullhex: |
250 pntags[t].append([hexnullid, None]) | 247 pntags[t].append([nullhex, None]) |
251 | 248 |
252 conflictedtags = [] # for reporting purposes | 249 conflictedtags = [] # for reporting purposes |
253 mergedtags = util.sortdict(p1tags) | 250 mergedtags = util.sortdict(p1tags) |
254 # sortdict does not implement iteritems() | 251 # sortdict does not implement iteritems() |
255 for tname, p2nodes in p2tags.items(): | 252 for tname, p2nodes in p2tags.items(): |