Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Side by Side Diff: gclient_scm.py

Issue 372045: gclient: fix bug where ssh urls with a username weren't parse correctly (Closed)
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698