| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 datetime | 9 import datetime |
| 10 import errno | 10 import errno |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 for k, v in dict2.iteritems(): | 56 for k, v in dict2.iteritems(): |
| 57 if k not in dict1: | 57 if k not in dict1: |
| 58 diff[k] = v | 58 diff[k] = v |
| 59 return diff | 59 return diff |
| 60 | 60 |
| 61 | 61 |
| 62 def commit_svn(repo, usr, pwd): | 62 def commit_svn(repo, usr, pwd): |
| 63 """Commits the changes and returns the new revision number.""" | 63 """Commits the changes and returns the new revision number.""" |
| 64 to_add = [] | 64 to_add = [] |
| 65 to_remove = [] | 65 to_remove = [] |
| 66 for status, filepath in scm.SVN.CaptureStatus(repo): | 66 for status, filepath in scm.SVN.CaptureStatus(None, repo): |
| 67 if status[0] == '?': | 67 if status[0] == '?': |
| 68 to_add.append(filepath) | 68 to_add.append(filepath) |
| 69 elif status[0] == '!': | 69 elif status[0] == '!': |
| 70 to_remove.append(filepath) | 70 to_remove.append(filepath) |
| 71 if to_add: | 71 if to_add: |
| 72 subprocess2.check_output( | 72 subprocess2.check_output( |
| 73 ['svn', 'add', '--no-auto-props', '-q'] + to_add, cwd=repo) | 73 ['svn', 'add', '--no-auto-props', '-q'] + to_add, cwd=repo) |
| 74 if to_remove: | 74 if to_remove: |
| 75 subprocess2.check_output(['svn', 'remove', '-q'] + to_remove, cwd=repo) | 75 subprocess2.check_output(['svn', 'remove', '-q'] + to_remove, cwd=repo) |
| 76 | 76 |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 fake.set_up_git() | 743 fake.set_up_git() |
| 744 print('Fake setup, press enter to quit or Ctrl-C to keep the checkouts.') | 744 print('Fake setup, press enter to quit or Ctrl-C to keep the checkouts.') |
| 745 sys.stdin.readline() | 745 sys.stdin.readline() |
| 746 except KeyboardInterrupt: | 746 except KeyboardInterrupt: |
| 747 trial_dir.TrialDir.SHOULD_LEAK.leak = True | 747 trial_dir.TrialDir.SHOULD_LEAK.leak = True |
| 748 return 0 | 748 return 0 |
| 749 | 749 |
| 750 | 750 |
| 751 if __name__ == '__main__': | 751 if __name__ == '__main__': |
| 752 sys.exit(main(sys.argv)) | 752 sys.exit(main(sys.argv)) |
| OLD | NEW |