Merge lp:~mwhudson/launchpad/incremental-bzr-svn-imports into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~mwhudson/launchpad/incremental-bzr-svn-imports
Merge into: lp:launchpad
Diff against target: 108 lines (+35/-19)
3 files modified
lib/lp/codehosting/codeimport/tests/test_worker.py (+28/-16)
lib/lp/codehosting/codeimport/worker.py (+6/-2)
utilities/sourcedeps.conf (+1/-1)
To merge this branch: bzr merge lp:~mwhudson/launchpad/incremental-bzr-svn-imports
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+21209@code.launchpad.net

Commit message

Move to a newer bzr-svn and start doing incremental bzr-svn imports

Description of the change

Hi,

This branch moves us to using a newer bzr-svn and does incremental bzr-svn imports.

Cheers,
mwh

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Well that looks easy. I bet the bzr-svn branch was bigger.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
2--- lib/lp/codehosting/codeimport/tests/test_worker.py 2010-02-23 22:37:03 +0000
3+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2010-03-12 02:35:28 +0000
4@@ -896,8 +896,33 @@
5 self.assertRaises(NotBranchError, worker.run)
6
7
8+class PartialTest:
9+ """A test case for incremental imports.
10+
11+ When all foreign branch plugins support incremental imports, this can go
12+ into PullingImportWorkerTests. For now though, bzr-hg still lacks the
13+ needed support.
14+ """
15+
16+ def test_partial(self):
17+ # Only config.codeimport.revisions_import_limit will be imported in a
18+ # given run. When bzr-svn and bzr-hg support revision import limits,
19+ # this test case can be moved up to PullingImportWorkerTests.
20+ worker = self.makeImportWorker(self.makeSourceDetails(
21+ 'trunk', [('README', 'Original contents')]))
22+ self.makeForeignCommit(worker.source_details)
23+ self.assertTrue(self.foreign_commit_count > 1)
24+ self.pushConfig(
25+ 'codeimport', revisions_import_limit=self.foreign_commit_count-1)
26+ self.assertEqual(
27+ CodeImportWorkerExitCode.SUCCESS_PARTIAL, worker.run())
28+ self.assertEqual(
29+ CodeImportWorkerExitCode.SUCCESS, worker.run())
30+
31+
32+
33 class TestGitImport(WorkerTest, TestActualImportMixin,
34- PullingImportWorkerTests):
35+ PullingImportWorkerTests, PartialTest):
36
37 rcstype = 'git'
38
39@@ -950,20 +975,6 @@
40 return self.factory.makeCodeImportSourceDetails(
41 rcstype='git', url=repository_path)
42
43- def test_partial(self):
44- # Only config.codeimport.revisions_import_limit will be imported in a
45- # given run. When bzr-svn and bzr-hg support revision import limits,
46- # this test case can be moved up to PullingImportWorkerTests.
47- worker = self.makeImportWorker(self.makeSourceDetails(
48- 'trunk', [('README', 'Original contents')]))
49- self.makeForeignCommit(worker.source_details)
50- self.assertTrue(self.foreign_commit_count > 1)
51- self.pushConfig(
52- 'codeimport', revisions_import_limit=self.foreign_commit_count-1)
53- self.assertEqual(
54- CodeImportWorkerExitCode.SUCCESS_PARTIAL, worker.run())
55- self.assertEqual(
56- CodeImportWorkerExitCode.SUCCESS, worker.run())
57
58
59 class TestMercurialImport(WorkerTest, TestActualImportMixin,
60@@ -1018,7 +1029,8 @@
61
62
63 class TestBzrSvnImport(WorkerTest, SubversionImportHelpers,
64- TestActualImportMixin, PullingImportWorkerTests):
65+ TestActualImportMixin, PullingImportWorkerTests,
66+ PartialTest):
67
68 rcstype = 'bzr-svn'
69
70
71=== modified file 'lib/lp/codehosting/codeimport/worker.py'
72--- lib/lp/codehosting/codeimport/worker.py 2010-02-23 21:26:40 +0000
73+++ lib/lp/codehosting/codeimport/worker.py 2010-03-12 02:35:28 +0000
74@@ -524,8 +524,8 @@
75 def getExtraPullArgs(self):
76 """Return extra arguments to `InterBranch.pull`.
77
78- This method only really exists because only bzr-git supports the
79- 'limit' argument to this method. When bzr-svn and bzr-hg plugin do
80+ This method only really exists because only bzr-git and bzr-svn
81+ support the 'limit' argument to this method. When bzr-hg plugin does
82 too, this method can go away.
83 """
84 return {}
85@@ -652,6 +652,10 @@
86 class BzrSvnImportWorker(PullingImportWorker):
87 """An import worker for importing Subversion via bzr-svn."""
88
89+ def getExtraPullArgs(self):
90+ """See `PullingImportWorker.getExtraPullArgs`."""
91+ return {'limit': config.codeimport.revisions_import_limit}
92+
93 @property
94 def format_classes(self):
95 """See `PullingImportWorker.opening_format`."""
96
97=== modified file 'utilities/sourcedeps.conf'
98--- utilities/sourcedeps.conf 2010-03-04 20:19:39 +0000
99+++ utilities/sourcedeps.conf 2010-03-12 02:35:28 +0000
100@@ -2,7 +2,7 @@
101 bzr-git lp:~launchpad-pqm/bzr-git/devel;revno=251
102 bzr-hg lp:~launchpad-pqm/bzr-hg/devel;revno=281
103 bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=47
104-bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=2707
105+bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=2708
106 cscvs lp:~launchpad-pqm/launchpad-cscvs/devel;revno=430
107 dulwich lp:~launchpad-pqm/dulwich/devel;revno=417
108 launchpad-loggerhead lp:~launchpad-pqm/launchpad-loggerhead/devel;revno=54