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

Unified Diff: patch.py

Issue 11028002: Make apply_issue.py much more verbose about what it's doing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix unit test Created 8 years, 3 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 | « checkout.py ('k') | tests/checkout_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patch.py
diff --git a/patch.py b/patch.py
index 9083094e834dac7f3cd8fce4bb33669389f65048..cd594f8e485055a14b0e7963d13c621245301706 100644
--- a/patch.py
+++ b/patch.py
@@ -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."""
« no previous file with comments | « checkout.py ('k') | tests/checkout_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698