Show More
@@ -95,16 +95,18 b' def get_gitdiff(filenode_old, filenode_n' | |||||
95 |
|
95 | |||
96 | :param ignore_whitespace: ignore whitespaces in diff |
|
96 | :param ignore_whitespace: ignore whitespaces in diff | |
97 | """ |
|
97 | """ | |
|
98 | # make sure we pass in default context | |||
|
99 | context = context or 3 | |||
98 |
|
100 | |||
99 | for filenode in (filenode_old, filenode_new): |
|
101 | for filenode in (filenode_old, filenode_new): | |
100 | if not isinstance(filenode, FileNode): |
|
102 | if not isinstance(filenode, FileNode): | |
101 | raise VCSError("Given object should be FileNode object, not %s" |
|
103 | raise VCSError("Given object should be FileNode object, not %s" | |
102 | % filenode.__class__) |
|
104 | % filenode.__class__) | |
103 |
|
105 | |||
104 | old_raw_id = getattr(filenode_old.changeset, 'raw_id', '0' * 40) |
|
106 | repo = filenode_new.changeset.repository | |
105 |
|
|
107 | old_raw_id = getattr(filenode_old.changeset, 'raw_id', repo.EMPTY_CHANGESET) | |
|
108 | new_raw_id = getattr(filenode_new.changeset, 'raw_id', repo.EMPTY_CHANGESET) | |||
106 |
|
109 | |||
107 | repo = filenode_new.changeset.repository |
|
|||
108 | vcs_gitdiff = repo.get_diff(old_raw_id, new_raw_id, filenode_new.path, |
|
110 | vcs_gitdiff = repo.get_diff(old_raw_id, new_raw_id, filenode_new.path, | |
109 | ignore_whitespace, context) |
|
111 | ignore_whitespace, context) | |
110 |
|
112 |
General Comments 0
You need to be logged in to leave comments.
Login now