Mercurial > public > mercurial-scm > hg
comparison mercurial/phases.py @ 28174:f16b84b1e40e
phases: use constants for phase values
Magic numbers hinder readability.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 15 Feb 2016 16:49:52 -0800 |
parents | 4ff0e2347ae6 |
children | 3a2357c31d2a |
comparison
equal
deleted
inserted
replaced
28173:1ff28873830e | 28174:f16b84b1e40e |
---|---|
433 for nhex, phase in roots.iteritems(): | 433 for nhex, phase in roots.iteritems(): |
434 if nhex == 'publishing': # ignore data related to publish option | 434 if nhex == 'publishing': # ignore data related to publish option |
435 continue | 435 continue |
436 node = bin(nhex) | 436 node = bin(nhex) |
437 phase = int(phase) | 437 phase = int(phase) |
438 if phase == 0: | 438 if phase == public: |
439 if node != nullid: | 439 if node != nullid: |
440 repo.ui.warn(_('ignoring inconsistent public root' | 440 repo.ui.warn(_('ignoring inconsistent public root' |
441 ' from remote: %s\n') % nhex) | 441 ' from remote: %s\n') % nhex) |
442 elif phase == 1: | 442 elif phase == draft: |
443 if node in nodemap: | 443 if node in nodemap: |
444 draftroots.append(node) | 444 draftroots.append(node) |
445 else: | 445 else: |
446 repo.ui.warn(_('ignoring unexpected root from remote: %i %s\n') | 446 repo.ui.warn(_('ignoring unexpected root from remote: %i %s\n') |
447 % (phase, nhex)) | 447 % (phase, nhex)) |