Mercurial > kallithea
comparison rhodecode/lib/vcs/backends/git/changeset.py @ 2499:c919d8c4f6a2 beta
fixed git diff function when initial revision had no parents to compare with
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 21 Jun 2012 01:34:11 +0200 |
parents | 1f9c467e01eb |
children | aaa41736ae51 |
comparison
equal
deleted
inserted
replaced
2498:9989d727ef1b | 2499:c919d8c4f6a2 |
---|---|
193 return cs | 193 return cs |
194 | 194 |
195 return _prev(self, branch) | 195 return _prev(self, branch) |
196 | 196 |
197 def diff(self, ignore_whitespace=True, context=3): | 197 def diff(self, ignore_whitespace=True, context=3): |
198 return ''.join(self.repository.get_diff(self, self.parents[0], | 198 rev1 = self.parents[0] if self.parents else self.repository.EMPTY_CHANGESET |
199 rev2 = self | |
200 return ''.join(self.repository.get_diff(rev1, rev2, | |
199 ignore_whitespace=ignore_whitespace, | 201 ignore_whitespace=ignore_whitespace, |
200 context=context)) | 202 context=context)) |
201 | 203 |
202 def get_file_mode(self, path): | 204 def get_file_mode(self, path): |
203 """ | 205 """ |