[PATCH 15/27] backports: add git diff support to lib/bpgit.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This will be used later for proving SmPL patches against
legacy patch series.

Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxxxxxxxxx>
---
 lib/bpgit.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/bpgit.py b/lib/bpgit.py
index f56e377..f4b53c4 100644
--- a/lib/bpgit.py
+++ b/lib/bpgit.py
@@ -328,3 +328,15 @@ def reset(opts=[], tree=None):
                                close_fds=True, universal_newlines=True, cwd=tree)
     process.wait()
     _check(process)
+
+def diff(tree=None, extra_args=None):
+    cmd = ['git', 'diff', '--color=always'] + extra_args
+
+    process = subprocess.Popen(cmd,
+                               stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+                               close_fds=True, universal_newlines=True, cwd=tree)
+    stdout = process.communicate()[0]
+    process.wait()
+    _check(process)
+
+    return stdout
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux