Chromium Code Reviews| Index: gclient.py |
| diff --git a/gclient.py b/gclient.py |
| index c3e295c42e1dca0fff893a61352cfa7deee4fe36..6117ecafcad7fa86560de953f083edecbc2c5e61 100755 |
| --- a/gclient.py |
| +++ b/gclient.py |
| @@ -641,6 +641,19 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): |
| command, options, parsed_url, self.parent.name, revision_overrides) |
| self._used_scm = gclient_scm.CreateSCM( |
| parsed_url, self.root.root_dir, self.name) |
| + |
|
borenet
2013/11/12 19:33:37
This may not be in the right place. Any alternati
iannucci
2013/11/13 06:26:30
the 'force' flag would probably be sufficient
borenet
2013/11/13 19:12:24
Done.
|
| + # When updating, determine whether the destination directory contains a |
| + # checkout of the desired repository. If not, avoid conflicts by |
| + # deleting the directory before running the update. |
| + if command == 'update': |
| + actual_remote_url = self._used_scm.GetRemoteURL(options) |
| + url, _ = gclient_utils.SplitUrlRevision(parsed_url) |
| + if actual_remote_url != url: |
| + dest_dir = os.path.join(self.root.root_dir, self.name) |
| + logging.debug('%s does not contain a checkout of %s. Removing.' % |
|
iannucci
2013/11/13 06:26:30
I think this should actually be at least a warn, s
borenet
2013/11/13 19:12:24
Done.
|
| + dest_dir) |
| + gclient_utils.rmtree(dest_dir) |
|
borenet
2013/11/12 19:33:37
Alternatively, we could move into a temporary dire
iannucci
2013/11/13 06:26:30
This sounds like a lot of complexity to me with ve
borenet
2013/11/13 19:12:24
Agreed. I think the most I'd want to do is move i
Isaac (away)
2013/12/03 18:25:05
Other than bots, I don't think it's OK for gclient
Isaac (away)
2013/12/03 18:25:49
Ignore this comment, it's stale.
borenet
2013/12/03 21:12:02
Confirming that you're okay with the deletion appr
Isaac (away)
2013/12/04 03:29:19
Yes. With a prompt this is fine.
|
| + |
| self._got_revision = self._used_scm.RunCommand(command, options, args, |
| file_list) |
| if file_list: |