Commit 398a46ee authored by lpique's avatar lpique Committed by Commit bot

Revert of Remove SVN and File support from gclient (patchset #4 id:60001 of...

Revert of Remove SVN and File support from gclient (patchset #4 id:60001 of https://codereview.chromium.org/2398493004/ )

Reason for revert:
The Chrome buildbots pass "--transitive" still. Removing the option causes them to fail to build.

Example:

https://uberchromegw.corp.google.com/i/chromeos.chrome/builders/x86-alex-tot-chrome-pfq-informational/builds/21555

Original issue's description:
> Remove SVN and File support from gclient
>
> FileImpl was only usable with SVN.
>
> R=maruel@chromium.org
> BUG=641588
>
> Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/b3a24c3fd5159972f58063967a9c07ef724ff97b

TBR=maruel@chromium.org,agable@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=641588

Review-Url: https://codereview.chromium.org/2405173003
parent 7e269f0d
This diff is collapsed.
......@@ -392,6 +392,14 @@ class GitWrapper(SCMWrapper):
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 @@ class SVNWrapper(SCMWrapper):
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 @@ class SVNWrapper(SCMWrapper):
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
......@@ -244,13 +244,17 @@ class GclientTest(trial_dir.TestCase):
obj.dependencies[0], 'foo/dir2',
gclient.GClientKeywords.FromImpl('bar'), None, None, None, None,
None, 'DEPS', True, False),
gclient.Dependency(
obj.dependencies[0], 'foo/dir3',
gclient.GClientKeywords.FileImpl('url'), None, None, None, None,
None, 'DEPS', True, False),
],
[])
# Make sure __str__() works fine.
# pylint: disable=W0212
obj.dependencies[0]._file_list.append('foo')
str_obj = str(obj)
self.assertEquals(370, len(str_obj), '%d\n%s' % (len(str_obj), str_obj))
self.assertEquals(471, len(str_obj), '%d\n%s' % (len(str_obj), str_obj))
def testHooks(self):
topdir = self.root_dir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment