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

REVISION SUMMARY
  I was touching this code in a future patch and marmoute warned about usage of
  `is False` here.
  
  Quoting marmoute:
  
    "is False" is going to check if the object you have the very same object in
    memory than the one Python allocated for False (in practice 0)
    This will "mostly work" on cpython because of implementation details, but
    is semantically wrong and can start breaking unexpectedly

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -3870,10 +3870,10 @@
         tagsnode = cache.getfnode(node, computemissing=False)
         if tagsnode:
             tagsnodedisplay = hex(tagsnode)
-        elif tagsnode is False:
+        elif tagsnode is None:
+            tagsnodedisplay = b'missing'
+        else:
             tagsnodedisplay = b'invalid'
-        else:
-            tagsnodedisplay = b'missing'
 
         ui.write(b'%d %s %s\n' % (r, hex(node), tagsnodedisplay))
 



To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to