Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 4832:0875082d5471
util._hgexecutable: default to 'hg'
This should make hooks work even if util.set_hgexecutable is not called
(e.g. hgweb.cgi).
Fixes issue625.
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Wed, 11 Jul 2007 18:15:21 -0300 |
parents | 41ad4105dde9 |
children | 001e8a745834 3d35c8cb5eb4 |
comparison
equal
deleted
inserted
replaced
4831:6f08bc1bd00b | 4832:0875082d5471 |
---|---|
538 else: | 538 else: |
539 match = lambda fn: incmatch(fn) and not excmatch(fn) and patmatch(fn) | 539 match = lambda fn: incmatch(fn) and not excmatch(fn) and patmatch(fn) |
540 | 540 |
541 return (roots, match, (inc or exc or anypats) and True) | 541 return (roots, match, (inc or exc or anypats) and True) |
542 | 542 |
543 _hgexecutable = None | 543 _hgexecutable = 'hg' |
544 | 544 |
545 def set_hgexecutable(path): | 545 def set_hgexecutable(path): |
546 """remember location of the 'hg' executable if easily possible | 546 """remember location of the 'hg' executable if easily possible |
547 | 547 |
548 path might be None or empty if hg was loaded as a module, | 548 path might be None or empty if hg was loaded as a module, |
549 fall back to 'hg' in this case. | 549 fall back to 'hg' in this case. |
550 """ | 550 """ |
551 global _hgexecutable | 551 global _hgexecutable |
552 _hgexecutable = path and os.path.abspath(path) or 'hg' | 552 if path: |
553 _hgexecutable = os.path.abspath(path) | |
553 | 554 |
554 def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None): | 555 def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None): |
555 '''enhanced shell command execution. | 556 '''enhanced shell command execution. |
556 run with environment maybe modified, maybe in different dir. | 557 run with environment maybe modified, maybe in different dir. |
557 | 558 |