aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/lib/vcs/backends/git/changeset.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-06-04 17:26:34 +0200
committerMarcin Kuzminski <marcin@python-works.com>2012-06-04 17:26:34 +0200
commit83a074925e2cb0de2bdc6df4fd3343041403f1cc (patch)
tree676e011357aabc7f65dcad4e40292f1dbbf36e16 /rhodecode/lib/vcs/backends/git/changeset.py
parent1855e74ff003efa1834893e76bb5a23f1b4c0173 (diff)
Added diff option into git and hg changeset objects, representing git formated patch against parent1
--HG-- branch : beta
Diffstat (limited to 'rhodecode/lib/vcs/backends/git/changeset.py')
-rw-r--r--rhodecode/lib/vcs/backends/git/changeset.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rhodecode/lib/vcs/backends/git/changeset.py b/rhodecode/lib/vcs/backends/git/changeset.py
index cda48417..ddd439dc 100644
--- a/rhodecode/lib/vcs/backends/git/changeset.py
+++ b/rhodecode/lib/vcs/backends/git/changeset.py
@@ -194,6 +194,11 @@ class GitChangeset(BaseChangeset):
return _prev(self, branch)
+ def diff(self, ignore_whitespace=True, context=3):
+ return ''.join(self.repository.get_diff(self, self.parents[0],
+ ignore_whitespace=ignore_whitespace,
+ context=context))
+
def get_file_mode(self, path):
"""
Returns stat mode of the file at the given ``path``.