Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revset.py @ 47081:a407fe56d6e8
core: don't hard-code hex node lengths
Differential Revision: https://phab.mercurial-scm.org/D10535
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Fri, 30 Apr 2021 03:09:16 +0200 |
parents | 1e2f2c782928 |
children | ba673c821b9d |
comparison
equal
deleted
inserted
replaced
47080:54589bb9604d | 47081:a407fe56d6e8 |
---|---|
1722 | 1722 |
1723 | 1723 |
1724 def _node(repo, n): | 1724 def _node(repo, n): |
1725 """process a node input""" | 1725 """process a node input""" |
1726 rn = None | 1726 rn = None |
1727 if len(n) == 40: | 1727 if len(n) == 2 * repo.nodeconstants.nodelen: |
1728 try: | 1728 try: |
1729 rn = repo.changelog.rev(bin(n)) | 1729 rn = repo.changelog.rev(bin(n)) |
1730 except error.WdirUnsupported: | 1730 except error.WdirUnsupported: |
1731 rn = wdirrev | 1731 rn = wdirrev |
1732 except (LookupError, TypeError): | 1732 except (LookupError, TypeError): |