OLD | NEW |
---|---|
1 # Copyright 2009 Google Inc. All Rights Reserved. | 1 # Copyright 2009 Google Inc. All Rights Reserved. |
2 # | 2 # |
3 # Licensed under the Apache License, Version 2.0 (the "License"); | 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
4 # you may not use this file except in compliance with the License. | 4 # you may not use this file except in compliance with the License. |
5 # You may obtain a copy of the License at | 5 # You may obtain a copy of the License at |
6 # | 6 # |
7 # http://www.apache.org/licenses/LICENSE-2.0 | 7 # http://www.apache.org/licenses/LICENSE-2.0 |
8 # | 8 # |
9 # Unless required by applicable law or agreed to in writing, software | 9 # Unless required by applicable law or agreed to in writing, software |
10 # distributed under the License is distributed on an "AS IS" BASIS, | 10 # distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 | 118 |
119 All updated files will be appended to file_list. | 119 All updated files will be appended to file_list. |
120 | 120 |
121 Raises: | 121 Raises: |
122 Error: if can't get URL for relative path. | 122 Error: if can't get URL for relative path. |
123 """ | 123 """ |
124 | 124 |
125 if args: | 125 if args: |
126 raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args)) | 126 raise gclient_utils.Error("Unsupported argument(s): %s" % ",".join(args)) |
127 | 127 |
128 components = self.url.split("@") | 128 if self.url.startswith('ssh:'): |
129 # Make sure ssh://test@example.com/test.git@stable works | |
130 regex = "(ssh://(?:[\w]+@)?[-\w:\.]+/[-\w\.]+)(?:@([\w/]+))?" | |
M-A Ruel
2009/11/07 19:29:40
Doesn't the regex work with svn url? If so, no nee
M-A Ruel
2009/11/09 16:39:24
You need to use r"" btw.
| |
131 components = re.search(regex, self.url).groups() | |
132 else: | |
133 components = self.url.split("@") | |
129 url = components[0] | 134 url = components[0] |
130 revision = None | 135 revision = None |
131 if options.revision: | 136 if options.revision: |
132 revision = options.revision | 137 revision = options.revision |
133 elif len(components) == 2: | 138 elif len(components) == 2: |
134 revision = components[1] | 139 revision = components[1] |
135 | 140 |
136 if options.verbose: | 141 if options.verbose: |
137 rev_str = "" | 142 rev_str = "" |
138 if revision: | 143 if revision: |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
784 # Col 3 | 789 # Col 3 |
785 if wc_status[0].getAttribute('copied') == 'true': | 790 if wc_status[0].getAttribute('copied') == 'true': |
786 statuses[3] = '+' | 791 statuses[3] = '+' |
787 # Col 4 | 792 # Col 4 |
788 if wc_status[0].getAttribute('switched') == 'true': | 793 if wc_status[0].getAttribute('switched') == 'true': |
789 statuses[4] = 'S' | 794 statuses[4] = 'S' |
790 # TODO(maruel): Col 5 and 6 | 795 # TODO(maruel): Col 5 and 6 |
791 item = (''.join(statuses), file) | 796 item = (''.join(statuses), file) |
792 results.append(item) | 797 results.append(item) |
793 return results | 798 return results |
OLD | NEW |