##// END OF EJS Templates
unbundle: free temporary objects after use...
unbundle: free temporary objects after use This reduces peak RSS for larger unbundle operations by ~30 Bytes per changeset on AMD64. This can't be a direct delete for Python 2.7, so reset the object instead and leave a comment. The efilesset object can't be deleted as it is referenced by the local onchangelog function and Python 2.7 rejects a delete on the existance of a nested scope. Differential Revision: https://phab.mercurial-scm.org/D9153

File last commit:

r43829:e170e425 default
r46321:44d84b72 default
Show More
test-dirs.py
27 lines | 644 B | text/x-python | PythonLexer
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799 from __future__ import absolute_import
import unittest
import silenttestrunner
utils: move the `dirs` definition in pathutil (API)...
r43923 from mercurial import pathutil
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799
class dirstests(unittest.TestCase):
def testdirs(self):
for case, want in [
(b'a/a/a', [b'a', b'a/a', b'']),
(b'alpha/beta/gamma', [b'', b'alpha', b'alpha/beta']),
]:
utils: move the `dirs` definition in pathutil (API)...
r43923 d = pathutil.dirs({})
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799 d.addpath(case)
self.assertEqual(sorted(d), sorted(want))
def testinvalid(self):
with self.assertRaises(ValueError):
utils: move the `dirs` definition in pathutil (API)...
r43923 d = pathutil.dirs({})
Augie Fackler
dirs: reject consecutive slashes in paths...
r43799 d.addpath(b'a//b')
if __name__ == '__main__':
silenttestrunner.main(__name__)