Using a dedicated variable is clearer and less fragile. It cannot hurt.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
Using a dedicated variable is clearer and less fragile. It cannot hurt.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | tests/hghave.py (2 lines) | |||
M | tests/run-tests.py (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
06d889fe6993 | 12a7bb692a73 | Pierre-Yves David | Jul 9 2021, 7:58 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | Alphare | ||
Closed | Alphare | ||
Closed | Alphare | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | Alphare | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Abandoned | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | D11067 windows: use abspath in url | |
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | Alphare | ||
Closed | Alphare |
except (AttributeError, ImportError): | except (AttributeError, ImportError): | ||||
return False | return False | ||||
# Test the executable | # Test the executable | ||||
return matchoutput('brz --version 2>&1', br'Breezy \(brz\) ') | return matchoutput('brz --version 2>&1', br'Breezy \(brz\) ') | ||||
@check("chg", "running with chg") | @check("chg", "running with chg") | ||||
def has_chg(): | def has_chg(): | ||||
return 'CHGHG' in os.environ | return 'CHG_INSTALLED_AS_HG' in os.environ | ||||
@check("rhg", "running with rhg as 'hg'") | @check("rhg", "running with rhg as 'hg'") | ||||
def has_rhg(): | def has_rhg(): | ||||
return 'RHG_INSTALLED_AS_HG' in os.environ | return 'RHG_INSTALLED_AS_HG' in os.environ | ||||
@check("cvs", "cvs client/server") | @check("cvs", "cvs client/server") |
self._hgcommand += b'.exe' | self._hgcommand += b'.exe' | ||||
real_hg = os.path.join(self._bindir, self._hgcommand) | real_hg = os.path.join(self._bindir, self._hgcommand) | ||||
assert real_hg is not None | assert real_hg is not None | ||||
osenvironb[b'HGTEST_REAL_HG'] = real_hg | osenvironb[b'HGTEST_REAL_HG'] = real_hg | ||||
# set CHGHG, then replace "hg" command by "chg" | # set CHGHG, then replace "hg" command by "chg" | ||||
chgbindir = self._bindir | chgbindir = self._bindir | ||||
if self.options.chg or self.options.with_chg: | if self.options.chg or self.options.with_chg: | ||||
osenvironb[b'CHG_INSTALLED_AS_HG'] = b'1' | |||||
osenvironb[b'CHGHG'] = real_hg | osenvironb[b'CHGHG'] = real_hg | ||||
else: | else: | ||||
osenvironb.pop(b'CHGHG', None) # drop flag for hghave | # drop flag for hghave | ||||
osenvironb.pop(b'CHG_INSTALLED_AS_HG', None) | |||||
if self.options.chg: | if self.options.chg: | ||||
self._hgcommand = b'chg' | self._hgcommand = b'chg' | ||||
elif self.options.with_chg: | elif self.options.with_chg: | ||||
chgbindir = os.path.dirname(os.path.realpath(self.options.with_chg)) | chgbindir = os.path.dirname(os.path.realpath(self.options.with_chg)) | ||||
self._hgcommand = os.path.basename(self.options.with_chg) | self._hgcommand = os.path.basename(self.options.with_chg) | ||||
# configure fallback and replace "hg" command by "rhg" | # configure fallback and replace "hg" command by "rhg" | ||||
rhgbindir = self._bindir | rhgbindir = self._bindir |