##// END OF EJS Templates
merge with stable
Augie Fackler -
r35769:6d65cef5 merge default
parent child Browse files
Show More
@@ -2712,7 +2712,8 b' def identify(ui, repo, source=None, rev='
2712 a list of tags, and a list of bookmarks.
2712 a list of tags, and a list of bookmarks.
2713
2713
2714 When REV is not given, print a summary of the current state of the
2714 When REV is not given, print a summary of the current state of the
2715 repository.
2715 repository including the working directory. Specify -r. to get information
2716 of the working directory parent without scanning uncommitted changes.
2716
2717
2717 Specifying a path to a repository root or Mercurial bundle will
2718 Specifying a path to a repository root or Mercurial bundle will
2718 cause lookup to operate on that repository/bundle.
2719 cause lookup to operate on that repository/bundle.
@@ -90,9 +90,8 b' def age(date, abbrev=False):'
90 @templatefilter('basename')
90 @templatefilter('basename')
91 def basename(path):
91 def basename(path):
92 """Any text. Treats the text as a path, and returns the last
92 """Any text. Treats the text as a path, and returns the last
93 component of the path after splitting by the path separator
93 component of the path after splitting by the path separator.
94 (ignoring trailing separators). For example, "foo/bar/baz" becomes
94 For example, "foo/bar/baz" becomes "baz" and "foo/bar//" becomes "".
95 "baz" and "foo/bar//" becomes "bar".
96 """
95 """
97 return os.path.basename(path)
96 return os.path.basename(path)
98
97
@@ -670,6 +670,7 b' class Test(unittest.TestCase):'
670
670
671 def __init__(self, path, outputdir, tmpdir, keeptmpdir=False,
671 def __init__(self, path, outputdir, tmpdir, keeptmpdir=False,
672 debug=False,
672 debug=False,
673 first=False,
673 timeout=None,
674 timeout=None,
674 startport=None, extraconfigopts=None,
675 startport=None, extraconfigopts=None,
675 py3kwarnings=False, shell=None, hgcommand=None,
676 py3kwarnings=False, shell=None, hgcommand=None,
@@ -722,6 +723,7 b' class Test(unittest.TestCase):'
722 self._threadtmp = tmpdir
723 self._threadtmp = tmpdir
723 self._keeptmpdir = keeptmpdir
724 self._keeptmpdir = keeptmpdir
724 self._debug = debug
725 self._debug = debug
726 self._first = first
725 self._timeout = timeout
727 self._timeout = timeout
726 self._slowtimeout = slowtimeout
728 self._slowtimeout = slowtimeout
727 self._startport = startport
729 self._startport = startport
@@ -906,9 +908,13 b' class Test(unittest.TestCase):'
906 f.write(line)
908 f.write(line)
907
909
908 # The result object handles diff calculation for us.
910 # The result object handles diff calculation for us.
909 if self._result.addOutputMismatch(self, ret, out, self._refout):
911 with firstlock:
910 # change was accepted, skip failing
912 if self._result.addOutputMismatch(self, ret, out, self._refout):
911 return
913 # change was accepted, skip failing
914 return
915 if self._first:
916 global firsterror
917 firsterror = True
912
918
913 if ret:
919 if ret:
914 msg = 'output changed and ' + describe(ret)
920 msg = 'output changed and ' + describe(ret)
@@ -1037,7 +1043,7 b' class Test(unittest.TestCase):'
1037 offset = '' if i == 0 else '%s' % i
1043 offset = '' if i == 0 else '%s' % i
1038 env["HGPORT%s" % offset] = '%s' % (self._startport + i)
1044 env["HGPORT%s" % offset] = '%s' % (self._startport + i)
1039 env = os.environ.copy()
1045 env = os.environ.copy()
1040 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase')
1046 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or ''
1041 env['HGEMITWARNINGS'] = '1'
1047 env['HGEMITWARNINGS'] = '1'
1042 env['TESTTMP'] = self._testtmp
1048 env['TESTTMP'] = self._testtmp
1043 env['HOME'] = self._testtmp
1049 env['HOME'] = self._testtmp
@@ -1637,6 +1643,8 b' class TTest(Test):'
1637 return TTest.ESCAPESUB(TTest._escapef, s)
1643 return TTest.ESCAPESUB(TTest._escapef, s)
1638
1644
1639 iolock = threading.RLock()
1645 iolock = threading.RLock()
1646 firstlock = threading.RLock()
1647 firsterror = False
1640
1648
1641 class TestResult(unittest._TextTestResult):
1649 class TestResult(unittest._TextTestResult):
1642 """Holds results when executing via unittest."""
1650 """Holds results when executing via unittest."""
@@ -1722,7 +1730,7 b' class TestResult(unittest._TextTestResul'
1722
1730
1723 def addOutputMismatch(self, test, ret, got, expected):
1731 def addOutputMismatch(self, test, ret, got, expected):
1724 """Record a mismatch in test output for a particular test."""
1732 """Record a mismatch in test output for a particular test."""
1725 if self.shouldStop:
1733 if self.shouldStop or firsterror:
1726 # don't print, some other test case already failed and
1734 # don't print, some other test case already failed and
1727 # printed, we're just stale and probably failed due to our
1735 # printed, we're just stale and probably failed due to our
1728 # temp dir getting cleaned up.
1736 # temp dir getting cleaned up.
@@ -2715,6 +2723,7 b' class TestRunner(object):'
2715 t = testcls(refpath, self._outputdir, tmpdir,
2723 t = testcls(refpath, self._outputdir, tmpdir,
2716 keeptmpdir=self.options.keep_tmpdir,
2724 keeptmpdir=self.options.keep_tmpdir,
2717 debug=self.options.debug,
2725 debug=self.options.debug,
2726 first=self.options.first,
2718 timeout=self.options.timeout,
2727 timeout=self.options.timeout,
2719 startport=self._getport(count),
2728 startport=self._getport(count),
2720 extraconfigopts=self.options.extra_config_opt,
2729 extraconfigopts=self.options.extra_config_opt,
@@ -2228,6 +2228,11 b' Age filter:'
2228 $ cd ..
2228 $ cd ..
2229 $ rm -rf unstable-hash
2229 $ rm -rf unstable-hash
2230
2230
2231 Filename filters:
2232
2233 $ hg debugtemplate '{"foo/bar"|basename}|{"foo/"|basename}|{"foo"|basename}|\n'
2234 bar||foo|
2235
2231 Add a dummy commit to make up for the instability of the above:
2236 Add a dummy commit to make up for the instability of the above:
2232
2237
2233 $ echo a > a
2238 $ echo a > a
General Comments 0
You need to be logged in to leave comments. Login now