annotate tests/test_push_eol.py @ 990:def2144c0a8c

push: rebase one at a time before push Previously when pushing n commits, push would rebase n, commit 1, rebase n-1, commit 1, rebase n-2, etc. This caused push to be very slow on large repositories. Pushing 10 commits on our repo took 75 seconds per commit, and that grew at n^2 with the number of commits being pushed. This changes push to rebase each commit individually. Now pushing 10 commits on our repo takes 25 seconds per commit, and is constant relative to the number of commits being pushed.
author Durham Goode <durham@fb.com>
date Wed, 02 Jan 2013 17:51:07 -0800
parents 04729f3a3d17
children d741f536f23a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
1 import test_util
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
2
643
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 642
diff changeset
3 import unittest
d2ef7220a079 tests: import test_util as the first module in all relevant tests
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 642
diff changeset
4
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
5 class TestPushEol(test_util.TestBase):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
6 def setUp(self):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
7 test_util.TestBase.setUp(self)
865
04729f3a3d17 test_util: merge load_fixture_and_fetch() into TestBase method
Patrick Mezard <patrick@mezard.eu>
parents: 833
diff changeset
8 self._load_fixture_and_fetch('emptyrepo.svndump')
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
9
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
10 def _test_push_dirs(self, stupid):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
11 changes = [
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
12 # Root files with LF, CRLF and mixed EOL
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
13 ('lf', 'lf', 'a\nb\n\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
14 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
15 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
16 ]
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
17 self.commitchanges(changes)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
18 self.pushrevisions(stupid)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
19 self.assertchanges(changes, self.repo['tip'])
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
20
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
21 changes = [
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
22 # Update all files once, with same EOL
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
23 ('lf', 'lf', 'a\nb\n\nc\na\nb\n\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
24 ('crlf', 'crlf', 'a\r\nb\r\n\r\nc\r\na\r\nb\r\n\r\nc'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
25 ('mixed', 'mixed', 'a\r\nb\n\r\nc\nd\r\na\r\nb\n\r\nc\nd'),
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
26 ]
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
27 self.commitchanges(changes)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
28 self.pushrevisions(stupid)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
29 self.assertchanges(changes, self.repo['tip'])
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
30
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
31 def test_push_dirs(self):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
32 self._test_push_dirs(False)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
33
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
34 def test_push_dirs_stupid(self):
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
35 self._test_push_dirs(True)
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
36
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
37 def suite():
833
312b37bc5e20 tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents: 643
diff changeset
38 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestPushEol),
642
c2d606a1dc6f tests: get rid of DOS line endings.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 96
diff changeset
39 ]
833
312b37bc5e20 tests: avoid shadowing Python builtin all()
Yonggang Luo <luoyonggang@gmail.com>
parents: 643
diff changeset
40 return unittest.TestSuite(all_tests)