Patchwork D7651: nodetree: simplify a conditionnal in shortesthexnodeidprefix

login
register
mail settings
Submitter phabricator
Date Dec. 17, 2019, 12:56 p.m.
Message ID <d2761f094797f24ca38afce9300b5bf6@localhost.localdomain>
Download mbox | patch
Permalink /patch/43918/
State Not Applicable
Headers show

Comments

phabricator - Dec. 17, 2019, 12:56 p.m.
Closed by commit rHGf2de8dc9c52f: nodetree: simplify a conditionnal in shortesthexnodeidprefix (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7651?vs=18697&id=18806

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7651/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7651

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: marmoute, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -545,12 +545,10 @@ 
             if cache is not None:
                 nodetree = cache.get(b'disambiguationnodetree')
             if not nodetree:
-                try:
+                if util.safehasattr(parsers, 'nodetree'):
+                    # The CExt is the only implementation to provide a nodetree
+                    # class so far.
                     nodetree = parsers.nodetree(cl.index, len(revs))
-                except AttributeError:
-                    # no native nodetree
-                    pass
-                else:
                     for r in revs:
                         nodetree.insert(r)
                     if cache is not None: