mercurial/phases.py
changeset 30634 ad15646dc61c
parent 29303 3a2357c31d2a
child 31016 bf81d3b7b2ba
equal deleted inserted replaced
30633:fd244e047ec0 30634:ad15646dc61c
   101 """
   101 """
   102 
   102 
   103 from __future__ import absolute_import
   103 from __future__ import absolute_import
   104 
   104 
   105 import errno
   105 import errno
   106 import os
       
   107 
   106 
   108 from .i18n import _
   107 from .i18n import _
   109 from .node import (
   108 from .node import (
   110     bin,
   109     bin,
   111     hex,
   110     hex,
   112     nullid,
   111     nullid,
   113     nullrev,
   112     nullrev,
   114     short,
   113     short,
   115 )
   114 )
   116 from . import (
   115 from . import (
       
   116     encoding,
   117     error,
   117     error,
   118 )
   118 )
   119 
   119 
   120 allphases = public, draft, secret = range(3)
   120 allphases = public, draft, secret = range(3)
   121 trackedphases = allphases[1:]
   121 trackedphases = allphases[1:]
   135     repo = repo.unfiltered()
   135     repo = repo.unfiltered()
   136     dirty = False
   136     dirty = False
   137     roots = [set() for i in allphases]
   137     roots = [set() for i in allphases]
   138     try:
   138     try:
   139         f = None
   139         f = None
   140         if 'HG_PENDING' in os.environ:
   140         if 'HG_PENDING' in encoding.environ:
   141             try:
   141             try:
   142                 f = repo.svfs('phaseroots.pending')
   142                 f = repo.svfs('phaseroots.pending')
   143             except IOError as inst:
   143             except IOError as inst:
   144                 if inst.errno != errno.ENOENT:
   144                 if inst.errno != errno.ENOENT:
   145                     raise
   145                     raise