OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Generate fake repositories for testing.""" | 6 """Generate fake repositories for testing.""" |
7 | 7 |
8 import atexit | 8 import atexit |
9 import errno | 9 import errno |
10 import logging | 10 import logging |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 deps_os = { | 354 deps_os = { |
355 'mac': { | 355 'mac': { |
356 'src/third_party/prout': '/trunk/third_party/prout', | 356 'src/third_party/prout': '/trunk/third_party/prout', |
357 }, | 357 }, |
358 }""" % { 'host': self.HOST }) | 358 }""" % { 'host': self.HOST }) |
359 self._commit_svn(fs) | 359 self._commit_svn(fs) |
360 | 360 |
361 fs = file_system(2, """ | 361 fs = file_system(2, """ |
362 deps = { | 362 deps = { |
363 'src/other': 'svn://%(host)s/svn/trunk/other', | 363 'src/other': 'svn://%(host)s/svn/trunk/other', |
364 'src/third_party/foo': From('src/other', 'foo/bar'), | 364 # Load another DEPS and load a dependency from it. That's an example of |
365 'src/file/foo': File('svn://%(host)s/svn/trunk/third_party/foo/origin'), | 365 # WebKit's chromium checkout flow. Verify it works out of order. |
| 366 'src/third_party/foo': From('src/file/other', 'foo/bar'), |
| 367 'src/file/other': File('svn://%(host)s/svn/trunk/other/DEPS'), |
366 } | 368 } |
367 # I think this is wrong to have the hooks run from the base of the gclient | 369 # I think this is wrong to have the hooks run from the base of the gclient |
368 # checkout. It's maybe a bit too late to change that behavior. | 370 # checkout. It's maybe a bit too late to change that behavior. |
369 hooks = [ | 371 hooks = [ |
370 { | 372 { |
371 'pattern': '.', | 373 'pattern': '.', |
372 'action': ['python', '-c', | 374 'action': ['python', '-c', |
373 'open(\\'src/svn_hooked1\\', \\'w\\').write(\\'svn_hooked1\\')'], | 375 'open(\\'src/svn_hooked1\\', \\'w\\').write(\\'svn_hooked1\\')'], |
374 }, | 376 }, |
375 { | 377 { |
376 # Should not be run. | 378 # Should not be run. |
377 'pattern': 'nonexistent', | 379 'pattern': 'nonexistent', |
378 'action': ['python', '-c', | 380 'action': ['python', '-c', |
379 'open(\\'src/svn_hooked2\\', \\'w\\').write(\\'svn_hooked2\\')'], | 381 'open(\\'src/svn_hooked2\\', \\'w\\').write(\\'svn_hooked2\\')'], |
380 }, | 382 }, |
381 ] | 383 ] |
382 """ % { 'host': self.HOST }) | 384 """ % { 'host': self.HOST }) |
383 fs['trunk/other/DEPS'] = """ | 385 fs['trunk/other/DEPS'] = """ |
384 deps = { | 386 deps = { |
385 'foo/bar': '/trunk/third_party/foo@1', | 387 'foo/bar': '/trunk/third_party/foo@1', |
| 388 # Only the requested deps should be processed. |
| 389 'invalid': '/does_not_exist', |
386 } | 390 } |
387 """ | 391 """ |
388 self._commit_svn(fs) | 392 self._commit_svn(fs) |
389 | 393 |
390 def setUpGIT(self): | 394 def setUpGIT(self): |
391 """Creates git repositories and start the servers.""" | 395 """Creates git repositories and start the servers.""" |
392 if self.gitdaemon: | 396 if self.gitdaemon: |
393 return True | 397 return True |
394 self.setUp() | 398 self.setUp() |
395 if sys.platform == 'win32': | 399 if sys.platform == 'win32': |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 | 638 |
635 | 639 |
636 # Kind of hack. | 640 # Kind of hack. |
637 if '-l' in sys.argv: | 641 if '-l' in sys.argv: |
638 FakeRepos.SHOULD_LEAK = True | 642 FakeRepos.SHOULD_LEAK = True |
639 sys.argv.remove('-l') | 643 sys.argv.remove('-l') |
640 | 644 |
641 | 645 |
642 if __name__ == '__main__': | 646 if __name__ == '__main__': |
643 sys.exit(main(sys.argv)) | 647 sys.exit(main(sys.argv)) |
OLD | NEW |