if errors:
raise GitException, 'GIT index merging failed (possible conflicts)'
-def diff(files = None, rev1 = 'HEAD', rev2 = None, diff_flags = []):
+def diff(files = None, rev1 = 'HEAD', rev2 = None, diff_flags = [],
+ binary = True):
"""Show the diff between rev1 and rev2
"""
if not files:
files = []
+ if binary and '--binary' not in diff_flags:
+ diff_flags = diff_flags + ['--binary']
if rev1 and rev2:
return GRun('diff-tree', '-p',
return '\n'.join(result)
-def pretty_commit(commit_id = 'HEAD', diff_flags = []):
+def pretty_commit(commit_id = 'HEAD', flags = []):
"""Return a given commit (log + diff)
"""
- return GRun('diff-tree',
- *(diff_flags
- + ['--cc', '--always', '--pretty', '-r', commit_id])
- ).raw_output()
+ return GRun('show', *(flags + [commit_id])).raw_output()
def checkout(files = None, tree_id = None, force = False):
"""Check out the given or all files