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

Unified Diff: gclient.py

Issue 2105493002: Restore --head/-H to gclient (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fix accidental deletion Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index a9f59cbf56ea2dca05c82c7d6b1ec80fdf6c0704..9bc21e5a5535afd2a6a322c628d07157dc7b9f72 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1475,19 +1475,18 @@ been automagically updated. The previous version is available at %s.old.
revision_overrides = {}
if not self._options.revisions:
for s in self.dependencies:
- if not s.managed:
+ if not s.managed and not self._options.head:
self._options.revisions.append('%s@unmanaged' % s.name)
if not self._options.revisions:
return revision_overrides
solutions_names = [s.name for s in self.dependencies]
- index = 0
- for revision in self._options.revisions:
+ for i, revision in enumerate(self._options.revisions):
if not '@' in revision:
# Support for --revision 123
- revision = '%s@%s' % (solutions_names[index], revision)
- name, rev = revision.split('@', 1)
+ name, rev = solutions_names[i], revision
+ else:
+ name, rev = revision.split('@', 1)
revision_overrides[name] = rev
- index += 1
return revision_overrides
def RunOnDeps(self, command, args, ignore_requirements=False, progress=True):
@@ -1999,6 +1998,10 @@ def CMDsync(parser, args):
'with the command-line flag), transitively update '
'the dependencies to the date of the given revision. '
'Only supported for SVN repositories.')
+ parser.add_option('-H', '--head', action='store_true',
+ help='Begin by automatically syncing the root gclient '
+ 'solutions to HEAD of the remote repository. Similar '
+ 'to making the solution temporarily "managed".')
parser.add_option('-D', '--delete_unversioned_trees', action='store_true',
help='Deletes from the working copy any dependencies that '
'have been removed since the last sync, as long as '
« 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