| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 repo_root = join(self.git_root, repo) | 352 repo_root = join(self.git_root, repo) |
| 353 self._genTree(repo_root, tree) | 353 self._genTree(repo_root, tree) |
| 354 commit_hash = commit_git(repo_root) | 354 commit_hash = commit_git(repo_root) |
| 355 if self.git_hashes[repo][-1]: | 355 if self.git_hashes[repo][-1]: |
| 356 new_tree = self.git_hashes[repo][-1][1].copy() | 356 new_tree = self.git_hashes[repo][-1][1].copy() |
| 357 new_tree.update(tree) | 357 new_tree.update(tree) |
| 358 else: | 358 else: |
| 359 new_tree = tree.copy() | 359 new_tree = tree.copy() |
| 360 self.git_hashes[repo].append((commit_hash, new_tree)) | 360 self.git_hashes[repo].append((commit_hash, new_tree)) |
| 361 | 361 |
| 362 def populateSvn(self): |
| 363 raise NotImplementedError() |
| 364 |
| 365 def populateGit(self): |
| 366 raise NotImplementedError() |
| 367 |
| 362 | 368 |
| 363 class FakeRepos(FakeReposBase): | 369 class FakeRepos(FakeReposBase): |
| 364 """Implements populateSvn() and populateGit().""" | 370 """Implements populateSvn() and populateGit().""" |
| 365 NB_GIT_REPOS = 4 | 371 NB_GIT_REPOS = 4 |
| 366 | 372 |
| 367 def populateSvn(self): | 373 def populateSvn(self): |
| 368 """Creates a few revisions of changes including DEPS files.""" | 374 """Creates a few revisions of changes including DEPS files.""" |
| 369 # Repos | 375 # Repos |
| 370 check_call(['svn', 'checkout', 'svn://127.0.0.1/svn', self.svn_root, '-q', | 376 check_call(['svn', 'checkout', 'svn://127.0.0.1/svn', self.svn_root, '-q', |
| 371 '--non-interactive', '--no-auth-cache', | 377 '--non-interactive', '--no-auth-cache', |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 | 688 |
| 683 | 689 |
| 684 # Kind of hack. | 690 # Kind of hack. |
| 685 if '-l' in sys.argv: | 691 if '-l' in sys.argv: |
| 686 FakeRepos.SHOULD_LEAK = True | 692 FakeRepos.SHOULD_LEAK = True |
| 687 sys.argv.remove('-l') | 693 sys.argv.remove('-l') |
| 688 | 694 |
| 689 | 695 |
| 690 if __name__ == '__main__': | 696 if __name__ == '__main__': |
| 691 sys.exit(main(sys.argv)) | 697 sys.exit(main(sys.argv)) |
| OLD | NEW |