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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 | 331 |
332 # Testing: | 332 # Testing: |
333 # - dependency disapear | 333 # - dependency disapear |
334 # - dependency renamed | 334 # - dependency renamed |
335 # - versioned and unversioned reference | 335 # - versioned and unversioned reference |
336 # - relative and full reference | 336 # - relative and full reference |
337 # - deps_os | 337 # - deps_os |
338 # - var | 338 # - var |
339 # - hooks | 339 # - hooks |
340 # - From | 340 # - From |
| 341 # - File |
341 # TODO(maruel): | 342 # TODO(maruel): |
342 # - File | |
343 # - $matching_files | 343 # - $matching_files |
344 # - use_relative_paths | 344 # - use_relative_paths |
345 fs = file_system(1, """ | 345 fs = file_system(1, """ |
346 vars = { | 346 vars = { |
347 'DummyVariable': 'third_party', | 347 'DummyVariable': 'third_party', |
348 } | 348 } |
349 deps = { | 349 deps = { |
350 'src/other': 'svn://%(host)s/svn/trunk/other@1', | 350 'src/other': 'svn://%(host)s/svn/trunk/other@1', |
351 'src/third_party/fpp': '/trunk/' + Var('DummyVariable') + '/foo', | 351 'src/third_party/fpp': '/trunk/' + Var('DummyVariable') + '/foo', |
352 } | 352 } |
353 deps_os = { | 353 deps_os = { |
354 'mac': { | 354 'mac': { |
355 'src/third_party/prout': '/trunk/third_party/prout', | 355 'src/third_party/prout': '/trunk/third_party/prout', |
356 }, | 356 }, |
357 }""" % { 'host': self.HOST }) | 357 }""" % { 'host': self.HOST }) |
358 self._commit_svn(fs) | 358 self._commit_svn(fs) |
359 | 359 |
360 fs = file_system(2, """ | 360 fs = file_system(2, """ |
361 deps = { | 361 deps = { |
362 'src/other': 'svn://%(host)s/svn/trunk/other', | 362 'src/other': 'svn://%(host)s/svn/trunk/other', |
363 #'src/third_party/foo': '/trunk/third_party/foo@1', | |
364 'src/third_party/foo': From('src/other', 'foo/bar'), | 363 'src/third_party/foo': From('src/other', 'foo/bar'), |
| 364 'src/file/foo': File('svn://%(host)s/svn/trunk/third_party/foo/origin'), |
365 } | 365 } |
366 # I think this is wrong to have the hooks run from the base of the gclient | 366 # I think this is wrong to have the hooks run from the base of the gclient |
367 # checkout. It's maybe a bit too late to change that behavior. | 367 # checkout. It's maybe a bit too late to change that behavior. |
368 hooks = [ | 368 hooks = [ |
369 { | 369 { |
370 'pattern': '.', | 370 'pattern': '.', |
371 'action': ['python', '-c', | 371 'action': ['python', '-c', |
372 'open(\\'src/svn_hooked1\\', \\'w\\').write(\\'svn_hooked1\\')'], | 372 'open(\\'src/svn_hooked1\\', \\'w\\').write(\\'svn_hooked1\\')'], |
373 }, | 373 }, |
374 { | 374 { |
(...skipping 25 matching lines...) Expand all Loading... |
400 # Testing: | 400 # Testing: |
401 # - dependency disapear | 401 # - dependency disapear |
402 # - dependency renamed | 402 # - dependency renamed |
403 # - versioned and unversioned reference | 403 # - versioned and unversioned reference |
404 # - relative and full reference | 404 # - relative and full reference |
405 # - deps_os | 405 # - deps_os |
406 # - var | 406 # - var |
407 # - hooks | 407 # - hooks |
408 # - From | 408 # - From |
409 # TODO(maruel): | 409 # TODO(maruel): |
410 # - File | 410 # - File: File is hard to test here because it's SVN-only. It's |
| 411 # implementation should probably be replaced to use urllib instead. |
411 # - $matching_files | 412 # - $matching_files |
412 # - use_relative_paths | 413 # - use_relative_paths |
413 self._commit_git('repo_3', { | 414 self._commit_git('repo_3', { |
414 'origin': 'git/repo_3@1\n', | 415 'origin': 'git/repo_3@1\n', |
415 }) | 416 }) |
416 | 417 |
417 self._commit_git('repo_3', { | 418 self._commit_git('repo_3', { |
418 'origin': 'git/repo_3@2\n', | 419 'origin': 'git/repo_3@2\n', |
419 }) | 420 }) |
420 | 421 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 | 633 |
633 | 634 |
634 # Kind of hack. | 635 # Kind of hack. |
635 if '-l' in sys.argv: | 636 if '-l' in sys.argv: |
636 FakeRepos.SHOULD_LEAK = True | 637 FakeRepos.SHOULD_LEAK = True |
637 sys.argv.remove('-l') | 638 sys.argv.remove('-l') |
638 | 639 |
639 | 640 |
640 if __name__ == '__main__': | 641 if __name__ == '__main__': |
641 sys.exit(main(sys.argv)) | 642 sys.exit(main(sys.argv)) |
OLD | NEW |