sapling/tests/test_push_eol.py
Dan Villiom Podlaski Christiansen d5e302cab7 push: obsolete rather than rebase & strip when enabled
This requires a few changes to wrappers.push() to use obsolescence
rather than strip and to make the rebase -- which is non-destructive
with obsolete active -- to no longer keep the originals. Possible
future work involves no longer relying on rebase for non-outgoing
revisions, and simply leaving them in the troubled state.

We test this feature by adding setting obsolete_mode_tests to True in
classes that push changes.
2013-08-09 19:30:25 +02:00

38 lines
1.1 KiB
Python

import test_util
import unittest
class TestPushEol(test_util.TestBase):
obsolete_mode_tests = True
def setUp(self):
test_util.TestBase.setUp(self)
self._load_fixture_and_fetch('emptyrepo.svndump')
def _test_push_dirs(self, stupid):
changes = [
# Root files with LF, CRLF and mixed EOL
('lf', 'lf', 'a\nb\n\nc'),
('crlf', 'crlf', 'a\r\nb\r\n\r\nc'),
('mixed', 'mixed', 'a\r\nb\n\r\nc\nd'),
]
self.commitchanges(changes)
self.pushrevisions(stupid)
self.assertchanges(changes, self.repo['tip'])
changes = [
# Update all files once, with same EOL
('lf', 'lf', 'a\nb\n\nc\na\nb\n\nc'),
('crlf', 'crlf', 'a\r\nb\r\n\r\nc\r\na\r\nb\r\n\r\nc'),
('mixed', 'mixed', 'a\r\nb\n\r\nc\nd\r\na\r\nb\n\r\nc\nd'),
]
self.commitchanges(changes)
self.pushrevisions(stupid)
self.assertchanges(changes, self.repo['tip'])
def test_push_dirs(self):
self._test_push_dirs(False)
def test_push_dirs_stupid(self):
self._test_push_dirs(True)