Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 22632:db15bb2d6323
util: move _hgexecutable a few lines, closer to where it is used
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Sun, 28 Sep 2014 16:57:06 +0200 |
parents | 234e4c24b980 |
children | 92b54547ac5d |
comparison
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. |