OLD | NEW |
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Gclient-specific SCM-specific operations.""" | 5 """Gclient-specific SCM-specific operations.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import re | 9 import re |
10 import subprocess | 10 import subprocess |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 if args: | 113 if args: |
114 raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args)) | 114 raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args)) |
115 | 115 |
116 url, revision = gclient_utils.SplitUrlRevision(self.url) | 116 url, revision = gclient_utils.SplitUrlRevision(self.url) |
117 rev_str = "" | 117 rev_str = "" |
118 if options.revision: | 118 if options.revision: |
119 # Override the revision number. | 119 # Override the revision number. |
120 revision = str(options.revision) | 120 revision = str(options.revision) |
121 if revision: | 121 if revision: |
122 url = '%s@%s' % (url, revision) | |
123 rev_str = ' at %s' % revision | 122 rev_str = ' at %s' % revision |
124 | 123 |
125 if options.verbose: | 124 if options.verbose: |
126 print("\n_____ %s%s" % (self.relpath, rev_str)) | 125 print("\n_____ %s%s" % (self.relpath, rev_str)) |
127 | 126 |
128 if not os.path.exists(self.checkout_path): | 127 if not os.path.exists(self.checkout_path): |
129 self._Run(['clone', url, self.checkout_path], | 128 self._Run(['clone', url, self.checkout_path], |
130 cwd=self._root_dir, redirect_stdout=False) | 129 cwd=self._root_dir, redirect_stdout=False) |
131 if revision: | 130 if revision: |
132 self._Run(['reset', '--hard', revision], redirect_stdout=False) | 131 self._Run(['reset', '--hard', revision], redirect_stdout=False) |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 self.ReplaceAndPrint(line) | 453 self.ReplaceAndPrint(line) |
455 else: | 454 else: |
456 if (line.startswith(self.original_prefix) or | 455 if (line.startswith(self.original_prefix) or |
457 line.startswith(self.working_prefix)): | 456 line.startswith(self.working_prefix)): |
458 self.ReplaceAndPrint(line) | 457 self.ReplaceAndPrint(line) |
459 else: | 458 else: |
460 print line | 459 print line |
461 | 460 |
462 filterer = DiffFilterer(self.relpath) | 461 filterer = DiffFilterer(self.relpath) |
463 self.RunAndFilterOutput(command, path, False, False, filterer.Filter) | 462 self.RunAndFilterOutput(command, path, False, False, filterer.Filter) |
OLD | NEW |