contrib/genosxversion.py
branchstable
changeset 45397 148d177a4f2d
parent 43076 2372284d9457
child 48875 6000f5b25c9b
equal deleted inserted replaced
45396:fc8299319ffe 45397:148d177a4f2d
     4 import argparse
     4 import argparse
     5 import os
     5 import os
     6 import subprocess
     6 import subprocess
     7 import sys
     7 import sys
     8 
     8 
     9 # Always load hg libraries from the hg we can find on $PATH.
     9 try:
    10 hglib = subprocess.check_output(['hg', 'debuginstall', '-T', '{hgmodules}'])
    10     # Always load hg libraries from the hg we can find on $PATH.
    11 sys.path.insert(0, os.path.dirname(hglib))
    11     hglib = subprocess.check_output(['hg', 'debuginstall', '-T', '{hgmodules}'])
       
    12     sys.path.insert(0, os.path.dirname(hglib))
       
    13 except subprocess.CalledProcessError:
       
    14     # We're probably running with a PyOxidized Mercurial, so just
       
    15     # proceed and hope it works out okay.
       
    16     pass
    12 
    17 
    13 from mercurial import util
    18 from mercurial import util
    14 
    19 
    15 ap = argparse.ArgumentParser()
    20 ap = argparse.ArgumentParser()
    16 ap.add_argument(
    21 ap.add_argument(