checkheads: use 'nodemap.get' to convert nodes to revs
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 05 Jun 2017 15:20:20 +0100
changeset 32810 d4b5468719da
parent 32809 443e8543a125
child 32811 1cb14923dee9
checkheads: use 'nodemap.get' to convert nodes to revs We are about to call 'torev' on node that might be locally missing. In this case, 'nodemap.revs' will return None (something valid in our usecase) while 'changelog.rev' would raise an exception. We make this change in a distinct changeset to show it does not impact the tests.
mercurial/discovery.py
--- a/mercurial/discovery.py	Mon Jun 05 15:17:47 2017 +0100
+++ b/mercurial/discovery.py	Mon Jun 05 15:20:20 2017 +0100
@@ -439,7 +439,7 @@
     repo = pushop.repo
     unfi = repo.unfiltered()
     tonode = unfi.changelog.node
-    torev = unfi.changelog.rev
+    torev = unfi.changelog.nodemap.get
     public = phases.public
     getphase = unfi._phasecache.phase
     ispublic = (lambda r: getphase(unfi, r) == public)