Commit 4dd9f720 authored by maruel@chromium.org's avatar maruel@chromium.org

Make apply_issue.py much more verbose about what it's doing.

It's to help users figuring out what is happening.

TBR=rogerta@chromium.org
BUG=153284


Review URL: https://chromiumcodereview.appspot.com/11028002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@159504 0039d316-1c4b-4281-b951-d872f2087c98
parent 9d5f4ad1
......@@ -132,9 +132,9 @@ def main():
# chromium_commands.py?view=markup
open('.buildbot-patched', 'w').close()
# Apply the patch.
print('\nApplying the patch.')
try:
scm_obj.apply_patch(patchset)
scm_obj.apply_patch(patchset, verbose=True)
except checkout.PatchApplicationFailed, e:
print >> sys.stderr, str(e)
return 1
......
This diff is collapsed.
......@@ -100,6 +100,10 @@ class FilePatchBase(object):
out += '%s->' % self.source_filename_utf8
return out + self.filename_utf8
def dump(self):
"""Dumps itself in a verbose way to help diagnosing."""
return str(self)
class FilePatchDelete(FilePatchBase):
"""Deletes a file."""
......@@ -123,6 +127,9 @@ class FilePatchBinary(FilePatchBase):
def get(self):
return self.data
def __str__(self):
return str(super(FilePatchBinary, self)) + ' %d bytes' % len(self.data)
class Hunk(object):
"""Parsed hunk data container."""
......@@ -491,6 +498,10 @@ class FilePatchDiff(FilePatchBase):
# We're done.
return
def dump(self):
"""Dumps itself in a verbose way to help diagnosing."""
return str(self) + '\n' + self.get(True)
class PatchSet(object):
"""A list of FilePatch* objects."""
......
......@@ -308,9 +308,9 @@ class SvnCheckout(SvnBaseTest):
self._check_exception(
self._get_co(None),
'While running patch -p1 --forward --force --no-backup-if-mismatch;\n'
'patching file chrome/file.cc\n'
'Hunk #1 FAILED at 3.\n'
'1 out of 1 hunk FAILED -- saving rejects to file '
' patching file chrome/file.cc\n'
' Hunk #1 FAILED at 3.\n'
' 1 out of 1 hunk FAILED -- saving rejects to file '
'chrome/file.cc.rej\n')
def testSvnProps(self):
......@@ -328,8 +328,8 @@ class SvnCheckout(SvnBaseTest):
e.status,
'While running svn propset svn:ignore foo chrome/file.cc '
'--non-interactive;\n'
'patching file chrome/file.cc\n'
'svn: Cannot set \'svn:ignore\' on a file (\'chrome/file.cc\')\n')
' patching file chrome/file.cc\n'
' svn: Cannot set \'svn:ignore\' on a file (\'chrome/file.cc\')\n')
co.prepare(None)
svn_props = [('svn:eol-style', 'LF'), ('foo', 'bar')]
co.apply_patch(
......@@ -472,9 +472,10 @@ class RawCheckout(SvnBaseTest):
def testException(self):
self._check_exception(
self._get_co(None),
'patching file chrome/file.cc\n'
'Hunk #1 FAILED at 3.\n'
'1 out of 1 hunk FAILED -- saving rejects to file '
'While running patch -u --binary -p1;\n'
' patching file chrome/file.cc\n'
' Hunk #1 FAILED at 3.\n'
' 1 out of 1 hunk FAILED -- saving rejects to file '
'chrome/file.cc.rej\n')
def testProcess(self):
......@@ -514,9 +515,9 @@ class ReadOnlyCheckout(SvnBaseTest):
self._check_exception(
self._get_co(None),
'While running patch -p1 --forward --force --no-backup-if-mismatch;\n'
'patching file chrome/file.cc\n'
'Hunk #1 FAILED at 3.\n'
'1 out of 1 hunk FAILED -- saving rejects to file '
' patching file chrome/file.cc\n'
' Hunk #1 FAILED at 3.\n'
' 1 out of 1 hunk FAILED -- saving rejects to file '
'chrome/file.cc.rej\n')
def testProcess(self):
......
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