aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-09-14 10:34:20 +0200
committerGuido Günther <agx@sigxcpu.org>2010-09-14 10:36:38 +0200
commit70c5b22006fcf56933e66480a61bdf4d00a2475a (patch)
tree2503a8b43a5da7e47b8f860aad153af6de24dd7f /gbp
parentaf977814839275395f9c747b32611da712cf443d (diff)
Improve compression format detection
by checking if a version is already on the pristine-tar branch and use it's compression type if found. LP: #615212
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 635e24c4..9d5a3181 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -259,6 +259,18 @@ class GitRepository(object):
for line in commit:
yield line
+ def grep_log(self, regex, where=None):
+ args = ['--pretty=format:%H']
+ args.append("--grep=%s" % regex)
+ if where:
+ args.append(where)
+ args.append('--')
+
+ commits, ret = self.__git_getoutput('log', args)
+ if ret:
+ raise GitRepositoryError, "Error grepping log for %s" % regex
+ return [ commit.strip() for commit in commits[::-1] ]
+
def get_subject(self, commit):
"""Gets the subject of a commit"""
self.__check_path()