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 |