Index: tests/gclient_smoketest.py |
=================================================================== |
--- tests/gclient_smoketest.py (revision 82287) |
+++ tests/gclient_smoketest.py (working copy) |
@@ -327,6 +327,58 @@ |
tree['src/svn_hooked1'] = 'svn_hooked1' |
self.assertTree(tree) |
+ def testSyncTransitive(self): |
+ # TODO(maruel): safesync. |
+ if not self.enabled: |
+ return |
+ self.gclient(['config', self.svn_base + 'trunk/src/']) |
+ # Test unversioned checkout. |
M-A Ruel
2011/04/20 15:43:28
This whole part is unneeded since is already teste
Florian Loitsch
2011/04/20 18:32:01
Done.
|
+ self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], |
+ ['running', 'running', |
+ # This is due to the way svn update is called for a |
+ # single file when File() is used in a DEPS file. |
+ ('running', os.path.join(self.root_dir, 'src', 'file', 'other')), |
+ 'running', 'running', 'running', 'running']) |
+ tree = self.mangle_svn_tree( |
+ ('trunk/src@2', 'src'), |
+ ('trunk/third_party/foo@1', 'src/third_party/foo'), |
+ ('trunk/other@2', 'src/other')) |
+ tree['src/file/other/DEPS'] = ( |
+ self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) |
+ tree['src/svn_hooked1'] = 'svn_hooked1' |
+ self.assertTree(tree) |
+ |
+ # Manually remove svn_hooked1 before synching to make sure it's not |
+ # recreated. |
+ os.remove(join(self.root_dir, 'src', 'svn_hooked1')) |
+ |
+ # Test incremental versioned sync: sync transitively backward. |
+ self.parseGclient( |
+ ['sync', '--transitive', '--revision', 'src@1', '--deps', 'mac', |
+ '--delete_unversioned_trees', '--jobs', '1'], |
+ ['running', 'running', 'running', 'running', 'deleting']) |
+ tree = self.mangle_svn_tree( |
+ ('trunk/src@1', 'src'), |
+ ('trunk/third_party/foo@1', 'src/third_party/fpp'), |
+ ('trunk/other@1', 'src/other'), |
+ ('trunk/third_party/foo@1', 'src/third_party/prout')) |
+ tree['src/file/other/DEPS'] = ( |
+ self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) |
+ self.assertTree(tree) |
+ # Test incremental sync: delete-unversioned_trees isn't there. |
M-A Ruel
2011/04/20 15:43:28
I don't think the remaining of the test adds any v
Florian Loitsch
2011/04/20 18:32:01
Done.
|
+ self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], |
+ ['running', 'running', 'running', 'running', 'running']) |
+ tree = self.mangle_svn_tree( |
+ ('trunk/src@2', 'src'), |
+ ('trunk/third_party/foo@1', 'src/third_party/fpp'), |
+ ('trunk/third_party/foo@1', 'src/third_party/foo'), |
+ ('trunk/other@2', 'src/other'), |
+ ('trunk/third_party/foo@1', 'src/third_party/prout')) |
+ tree['src/file/other/DEPS'] = ( |
+ self.FAKE_REPOS.svn_revs[2]['trunk/other/DEPS']) |
+ tree['src/svn_hooked1'] = 'svn_hooked1' |
+ self.assertTree(tree) |
+ |
def testSyncIgnoredSolutionName(self): |
"""TODO(maruel): This will become an error soon.""" |
if not self.enabled: |
@@ -718,7 +770,7 @@ |
['running', 'running', 'running', 'running', 'running']) |
# TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must |
# add sync parsing to get the list of updated files. |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
tree['src/git_hooked1'] = 'git_hooked1' |
@@ -743,7 +795,7 @@ |
# Test incremental sync: delete-unversioned_trees isn't there. |
self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], |
['running', 'running', 'running']) |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@1', 'src/repo2/repo3'), |
('repo_3@2', 'src/repo2/repo_renamed'), |
@@ -752,6 +804,50 @@ |
tree['src/git_hooked2'] = 'git_hooked2' |
self.assertTree(tree) |
+ #def testSyncTransitive(self): |
+ #if not self.enabled: |
+ #return |
+ ## TODO(maruel): safesync. |
+ #self.gclient(['config', self.git_base + 'repo_1', '--name', 'src']) |
+ ## Test unversioned checkout. |
+ #self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], |
+ #['running', 'running', 'running', 'running', 'running']) |
+ ## TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must |
+ ## add sync parsing to get the list of updated files. |
+ #tree = self.mangle_git_tree(('repo_1@3', 'src'), |
+ #('repo_2@1', 'src/repo2'), |
+ #('repo_3@2', 'src/repo2/repo_renamed')) |
+ #tree['src/git_hooked1'] = 'git_hooked1' |
+ #tree['src/git_hooked2'] = 'git_hooked2' |
+ #self.assertTree(tree) |
+ |
+ ## Manually remove git_hooked1 before synching to make sure it's not |
+ ## recreated. |
+ #os.remove(join(self.root_dir, 'src', 'git_hooked1')) |
+ |
+ ## Test incremental versioned sync: sync backward. |
+ #self.parseGclient(['sync', '--transitive', '--jobs', '1', '--revision', |
+ #'src@' + self.githash('repo_1', 2), |
+ #'--deps', 'mac', '--delete_unversioned_trees'], |
+ #['running', 'running', 'deleting']) |
+ #tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ #('repo_2@2', 'src/repo2'), |
+ #('repo_3@1', 'src/repo2/repo3'), |
+ #('repo_4@1', 'src/repo4')) |
+ #tree['src/git_hooked2'] = 'git_hooked2' |
+ #self.assertTree(tree) |
+ ## Test incremental sync: delete-unversioned_trees isn't there. |
+ #self.parseGclient(['sync', '--deps', 'mac', '--jobs', '1'], |
+ #['running', 'running', 'running']) |
+ #tree = self.mangle_git_tree(('repo_1@3', 'src'), |
+ #('repo_2@1', 'src/repo2'), |
+ #('repo_3@1', 'src/repo2/repo3'), |
+ #('repo_3@2', 'src/repo2/repo_renamed'), |
+ #('repo_4@1', 'src/repo4')) |
+ #tree['src/git_hooked1'] = 'git_hooked1' |
+ #tree['src/git_hooked2'] = 'git_hooked2' |
+ #self.assertTree(tree) |
+ |
def testSyncIgnoredSolutionName(self): |
"""TODO(maruel): This will become an error soon.""" |
if not self.enabled: |
@@ -763,7 +859,7 @@ |
['running', 'running', 'running', 'running', 'running'], |
'Please fix your script, having invalid --revision flags ' |
'will soon considered an error.\n') |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
tree['src/git_hooked1'] = 'git_hooked1' |
@@ -795,7 +891,7 @@ |
untangle=True) |
# TODO(maruel): http://crosbug.com/3582 hooks run even if not matching, must |
# add sync parsing to get the list of updated files. |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
tree['src/git_hooked1'] = 'git_hooked1' |
@@ -821,7 +917,7 @@ |
# Test incremental sync: delete-unversioned_trees isn't there. |
self.parseGclient(['sync', '--deps', 'mac', '--jobs', '8'], |
['running', 'running', 'running'], untangle=True) |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@1', 'src/repo2/repo3'), |
('repo_3@2', 'src/repo2/repo_renamed'), |
@@ -852,7 +948,7 @@ |
self.assertEquals(13, len(out)) |
self.checkString('', results[1]) |
self.assertEquals(0, results[2]) |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
# TODO(maruel): http://crosbug.com/3583 This file should have been removed. |
@@ -872,7 +968,7 @@ |
return |
self.gclient(['config', self.git_base + 'repo_1', '--name', 'src']) |
self.gclient(['sync', '--deps', 'mac']) |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
tree['src/git_hooked1'] = 'git_hooked1' |
@@ -886,7 +982,7 @@ |
['running', 'running']) |
self.assertEquals(1, len(out[0])) |
self.assertEquals(1, len(out[1])) |
- tree = self.mangle_git_tree(('repo_1@2', 'src'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
tree['src/git_hooked1'] = 'git_hooked1' |
@@ -913,7 +1009,7 @@ |
'src/repo2/repo_renamed: %(base)srepo_3@%(hash3)s\n' % |
{ |
'base': self.git_base, |
- 'hash1': self.githash('repo_1', 2), |
+ 'hash1': self.githash('repo_1', 3), |
'hash2': self.githash('repo_2', 1), |
'hash3': self.githash('repo_3', 2), |
}) |
@@ -941,7 +1037,7 @@ |
('running', self.root_dir + '/src/file/other'), |
'running', 'running', 'running', 'running', 'running', 'running', |
'running', 'running']) |
- tree = self.mangle_git_tree(('repo_1@2', 'src-git'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src-git'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
tree.update(self.mangle_svn_tree( |
@@ -965,14 +1061,14 @@ |
'{"name": "src-git",' |
'"url": "' + self.git_base + 'repo_1"}]']) |
self.parseGclient(['sync', '--deps', 'mac', '--jobs', '8'], |
- ['running', 'running', 'running', |
+ ['running', 'running', 'running', 'running', 'running', |
# This is due to the way svn update is called for a single |
# file when File() is used in a DEPS file. |
('running', self.root_dir + '/src/file/other'), |
- 'running', 'running', 'running', 'running', 'running', 'running', |
+ 'running', 'running', 'running', 'running', |
'running', 'running'], |
untangle=True) |
- tree = self.mangle_git_tree(('repo_1@2', 'src-git'), |
+ tree = self.mangle_git_tree(('repo_1@3', 'src-git'), |
('repo_2@1', 'src/repo2'), |
('repo_3@2', 'src/repo2/repo_renamed')) |
tree.update(self.mangle_svn_tree( |
@@ -1044,7 +1140,7 @@ |
'src/third_party/foo: %(svn_base)s/third_party/foo@1\n') % { |
'svn_base': self.svn_base + 'trunk', |
'git_base': self.git_base, |
- 'hash1': self.githash('repo_1', 2), |
+ 'hash1': self.githash('repo_1', 3), |
'hash2': self.githash('repo_2', 1), |
'hash3': self.githash('repo_3', 2), |
} |