debugcommands: introduce debugpeer command
`hg debugpeer <path>` will establish a connection to a peer repository
and print information about it.
If you add --debug, it will log low-level protocol request info. This
will be useful for upcoming tests around protocol handshaking.
Differential Revision: https://phab.mercurial-scm.org/D2025
from __future__ import absolute_import
from __future__ import print_function
import unittest
from mercurial import (
mdiff,
)
class splitnewlinesTests(unittest.TestCase):
def test_splitnewlines(self):
cases = {'a\nb\nc\n': ['a\n', 'b\n', 'c\n'],
'a\nb\nc': ['a\n', 'b\n', 'c'],
'a\nb\nc\n\n': ['a\n', 'b\n', 'c\n', '\n'],
'': [],
'abcabc': ['abcabc'],
}
for inp, want in cases.iteritems():
self.assertEqual(mdiff.splitnewlines(inp), want)
if __name__ == '__main__':
import silenttestrunner
silenttestrunner.main(__name__)