setup.py
changeset 7801 e5627562b9f2
parent 7790 1817e45c2212
child 7826 f0a7accf1d68
equal deleted inserted replaced
7800:58125c27ddbe 7801:e5627562b9f2
   101     # execute hg out of this directory with a custom environment which
   101     # execute hg out of this directory with a custom environment which
   102     # includes the pure Python modules in mercurial/pure
   102     # includes the pure Python modules in mercurial/pure
   103     pypath = os.environ.get('PYTHONPATH', '')
   103     pypath = os.environ.get('PYTHONPATH', '')
   104     purepath = os.path.join('mercurial', 'pure')
   104     purepath = os.path.join('mercurial', 'pure')
   105     os.environ['PYTHONPATH'] = os.pathsep.join(['mercurial', purepath, pypath])
   105     os.environ['PYTHONPATH'] = os.pathsep.join(['mercurial', purepath, pypath])
       
   106     os.environ['HGRCPATH'] = '' # do not read any config file
   106     cmd = '%s hg id -it' % sys.executable
   107     cmd = '%s hg id -it' % sys.executable
   107     l = os.popen(cmd).read().split()
   108     l = os.popen(cmd).read().split()
   108     os.environ['PYTHONPATH'] = pypath
   109     os.environ['PYTHONPATH'] = pypath
   109     while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
   110     while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
   110         l.pop()
   111         l.pop()