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

Unified Diff: gclient_scm.py

Issue 2405173003: Revert of Remove SVN and File support from gclient (Closed)
Patch Set: Created 4 years, 2 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 | « gclient.py ('k') | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index cb8e6f31746403e63f9f3fa17e16102cc23cacfd..dd871c10d21f5a3fabe729d51aca7133050baa2e 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -391,6 +391,14 @@
if managed:
self._DisableHooks()
+
+ if gclient_utils.IsDateRevision(revision):
+ # Date-revisions only work on git-repositories if the reflog hasn't
+ # expired yet. Use rev-list to get the corresponding revision.
+ # git rev-list -n 1 --before='time-stamp' branchname
+ if options.transitive:
+ self.Print('Warning: --transitive only works for SVN repositories.')
+ revision = default_rev
rev_str = ' at %s' % revision
files = [] if file_list is not None else None
@@ -1484,6 +1492,12 @@
self.Print('You can pass --force to enable automatic removal.')
raise e
+ # Retrieve the current HEAD version because svn is slow at null updates.
+ if options.manually_grab_svn_rev and not revision:
+ from_info_live = scm.SVN.CaptureRemoteInfo(from_info['URL'])
+ revision = str(from_info_live['Revision'])
+ rev_str = ' at %s' % revision
+
if from_info['URL'].rstrip('/') != base_url.rstrip('/'):
# The repository url changed, need to switch.
try:
@@ -1713,6 +1727,10 @@
new_command.append('--force')
if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
new_command.extend(('--accept', 'theirs-conflict'))
+ elif options.manually_grab_svn_rev:
+ new_command.append('--force')
+ if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
+ new_command.extend(('--accept', 'postpone'))
elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
new_command.extend(('--accept', 'postpone'))
return new_command
« no previous file with comments | « gclient.py ('k') | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698