D10289: setdiscovery: simplify by using tiprev directly

joerg.sonnenberger (Joerg Sonnenberger) phabricator at mercurial-scm.org
Tue Mar 30 00:16:13 UTC 2021


joerg.sonnenberger created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  tip() uses tiprev() and reads the node from it, so drop a layer of
  indirection.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -390,7 +390,7 @@
         if audit is not None:
             audit[b'total-roundtrips'] = 1
 
-        if cl.tip() == nullid:
+        if cl.tiprev() == nullrev:
             if srvheadhashes != [nullid]:
                 return [nullid], True, srvheadhashes
             return [nullid], False, []



To: joerg.sonnenberger, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list