equal
deleted
inserted
replaced
243 _sethgexecutable(pycompat.sysexecutable) |
243 _sethgexecutable(pycompat.sysexecutable) |
244 elif (not pycompat.iswindows and os.path.basename( |
244 elif (not pycompat.iswindows and os.path.basename( |
245 pycompat.fsencode(getattr(mainmod, '__file__', ''))) == 'hg'): |
245 pycompat.fsencode(getattr(mainmod, '__file__', ''))) == 'hg'): |
246 _sethgexecutable(pycompat.fsencode(mainmod.__file__)) |
246 _sethgexecutable(pycompat.fsencode(mainmod.__file__)) |
247 else: |
247 else: |
248 exe = findexe('hg') or os.path.basename(sys.argv[0]) |
248 exe = findexe('hg') |
249 _sethgexecutable(pycompat.fsencode(exe)) |
249 if exe: |
|
250 _sethgexecutable(pycompat.fsencode(exe)) |
|
251 else: |
|
252 _sethgexecutable(os.path.basename(pycompat.sysargv[0])) |
250 return _hgexecutable |
253 return _hgexecutable |
251 |
254 |
252 def _sethgexecutable(path): |
255 def _sethgexecutable(path): |
253 """set location of the 'hg' executable""" |
256 """set location of the 'hg' executable""" |
254 global _hgexecutable |
257 global _hgexecutable |