Mercurial > hg
comparison mercurial/phases.py @ 43538:9970412d2ce3
index: use `index.has_node` in `analyzeremotephases`
Differential Revision: https://phab.mercurial-scm.org/D7330
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 08 Nov 2019 14:16:24 +0100 |
parents | d783f945a701 |
children | 44f54b8f9f10 |
comparison
equal
deleted
inserted
replaced
43537:7f489b9a79a1 | 43538:9970412d2ce3 |
---|---|
670 Accept unknown element input | 670 Accept unknown element input |
671 """ | 671 """ |
672 repo = repo.unfiltered() | 672 repo = repo.unfiltered() |
673 # build list from dictionary | 673 # build list from dictionary |
674 draftroots = [] | 674 draftroots = [] |
675 nodemap = repo.changelog.nodemap # to filter unknown nodes | 675 has_node = repo.changelog.index.has_node # to filter unknown nodes |
676 for nhex, phase in pycompat.iteritems(roots): | 676 for nhex, phase in pycompat.iteritems(roots): |
677 if nhex == b'publishing': # ignore data related to publish option | 677 if nhex == b'publishing': # ignore data related to publish option |
678 continue | 678 continue |
679 node = bin(nhex) | 679 node = bin(nhex) |
680 phase = int(phase) | 680 phase = int(phase) |
686 b' from remote: %s\n' | 686 b' from remote: %s\n' |
687 ) | 687 ) |
688 % nhex | 688 % nhex |
689 ) | 689 ) |
690 elif phase == draft: | 690 elif phase == draft: |
691 if node in nodemap: | 691 if has_node(node): |
692 draftroots.append(node) | 692 draftroots.append(node) |
693 else: | 693 else: |
694 repo.ui.warn( | 694 repo.ui.warn( |
695 _(b'ignoring unexpected root from remote: %i %s\n') | 695 _(b'ignoring unexpected root from remote: %i %s\n') |
696 % (phase, nhex) | 696 % (phase, nhex) |