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

Unified Diff: gclient.py

Issue 3130007: Add revinfo --actual to fetch the actual revisions, (Closed)
Patch Set: address nit Created 10 years, 4 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 | tests/gclient_smoketest.py » ('j') | 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 87b1aeea54300da3c56b0e1e7f7e7bd20e6e72fa..41dc58b9c69c3937249203ea39d53d311b4e9f3e 100644
--- a/gclient.py
+++ b/gclient.py
@@ -793,11 +793,16 @@ solutions = [
# Print the snapshot configuration file
print(self.DEFAULT_SNAPSHOT_FILE_TEXT % {'solution_list': new_gclient})
else:
- entries = sorted(self.tree(False), key=lambda i: i.name)
- for d in entries:
- entry_url = GetURLAndRev(d)
- line = '%s: %s' % (d.name, entry_url)
- if not d is entries[-1]:
+ entries = {}
+ for d in self.tree(False):
+ if self._options.actual:
+ entries[d.name] = GetURLAndRev(d)
+ else:
+ entries[d.name] = d.parsed_url
+ keys = sorted(entries.keys())
+ for x in keys:
+ line = '%s: %s' % (x, entries[x])
+ if x is not keys[-1]:
line += ';'
print line
logging.info(str(self))
@@ -1110,9 +1115,13 @@ def CMDrevinfo(parser, args):
help='override deps for the specified (comma-separated) '
'platform(s); \'all\' will process all deps_os '
'references')
+ parser.add_option('-a', '--actual', action='store_true',
+ help='gets the actual checked out revisions instead of the '
+ 'ones specified in the DEPS and .gclient files')
parser.add_option('-s', '--snapshot', action='store_true',
help='creates a snapshot .gclient file of the current '
- 'version of all repositories to reproduce the tree')
+ 'version of all repositories to reproduce the tree, '
+ 'implies -a')
(options, args) = parser.parse_args(args)
client = GClient.LoadCurrentConfig(options)
if not client:
« no previous file with comments | « no previous file | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698