phases: use constants for phase values
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 15 Feb 2016 16:49:52 -0800
changeset 28174 f16b84b1e40e
parent 28173 1ff28873830e
child 28175 c25e3fd38ff1
phases: use constants for phase values Magic numbers hinder readability.
mercurial/phases.py
--- a/mercurial/phases.py	Wed Jan 20 22:10:17 2016 -0500
+++ b/mercurial/phases.py	Mon Feb 15 16:49:52 2016 -0800
@@ -435,11 +435,11 @@
             continue
         node = bin(nhex)
         phase = int(phase)
-        if phase == 0:
+        if phase == public:
             if node != nullid:
                 repo.ui.warn(_('ignoring inconsistent public root'
                                ' from remote: %s\n') % nhex)
-        elif phase == 1:
+        elif phase == draft:
             if node in nodemap:
                 draftroots.append(node)
         else: