mercurial/util.py
changeset 22632 db15bb2d6323
parent 22245 234e4c24b980
child 22633 92b54547ac5d
equal deleted inserted replaced
22631:d246eb9cabbc 22632:db15bb2d6323
   448         a.pop()
   448         a.pop()
   449         b.pop()
   449         b.pop()
   450     b.reverse()
   450     b.reverse()
   451     return os.sep.join((['..'] * len(a)) + b) or '.'
   451     return os.sep.join((['..'] * len(a)) + b) or '.'
   452 
   452 
   453 _hgexecutable = None
       
   454 
       
   455 def mainfrozen():
   453 def mainfrozen():
   456     """return True if we are a frozen executable.
   454     """return True if we are a frozen executable.
   457 
   455 
   458     The code supports py2exe (most common, Windows only) and tools/freeze
   456     The code supports py2exe (most common, Windows only) and tools/freeze
   459     (portable, not much used).
   457     (portable, not much used).
   460     """
   458     """
   461     return (safehasattr(sys, "frozen") or # new py2exe
   459     return (safehasattr(sys, "frozen") or # new py2exe
   462             safehasattr(sys, "importers") or # old py2exe
   460             safehasattr(sys, "importers") or # old py2exe
   463             imp.is_frozen("__main__")) # tools/freeze
   461             imp.is_frozen("__main__")) # tools/freeze
       
   462 
       
   463 _hgexecutable = None
   464 
   464 
   465 def hgexecutable():
   465 def hgexecutable():
   466     """return location of the 'hg' executable.
   466     """return location of the 'hg' executable.
   467 
   467 
   468     Defaults to $HG or 'hg' in the search path.
   468     Defaults to $HG or 'hg' in the search path.