diff options
author | Guido Günther <agx@sigxcpu.org> | 2011-12-27 18:09:11 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2011-12-27 19:13:57 +0100 |
commit | f9ca26405c53a6ad829e1bcf4f60c5a6bb4ae4d9 (patch) | |
tree | 79113c3ae290d08f9b322ca4feb67e7bcc59fb23 /gbp/scripts | |
parent | 6fc0ec045b5cb4ad01a7583481d83a8552cd76a7 (diff) |
GitRepository: Add num option to git_commits
to limit number of returned commits and fix path option to also accept a
list of paths instead of a string.
Diffstat (limited to 'gbp/scripts')
-rw-r--r-- | gbp/scripts/dch.py | 7 | ||||
-rw-r--r-- | gbp/scripts/pq.py | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index 4a49f61c..ed6a3aaf 100644 --- a/gbp/scripts/dch.py +++ b/gbp/scripts/dch.py @@ -261,11 +261,11 @@ def guess_snapshot_commit(cp, repo, options): # If the current topmost changelog entry has already been tagged rely on # the version information only. The upper level relies then on the version # info anyway: - if repo.find_version(options.debian_tag, cp['Version']): + if repo.find_version(options.debian_tag, cp.version): return None # If we didn't find a snapshot header we look at the point the changelog # was last touched. - last = repo.get_commits(paths="debian/changelog", options=["-1"]) + last = repo.get_commits(paths="debian/changelog", num=1) if last: gbp.log.info("Changelog last touched at '%s'" % last[0]) return last[0] @@ -427,8 +427,7 @@ def main(argv): if args: gbp.log.info("Only looking for changes on '%s'" % " ".join(args)) - commits = repo.get_commits(since=since, until=until, - paths=" ".join(args), + commits = repo.get_commits(since=since, until=until, paths=args, options=options.git_log.split(" ")) commits.reverse() diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index 1852973d..dafb6973 100644 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -215,7 +215,7 @@ def import_quilt_patches(repo, branch, series, tries, force): raise GbpError, ("Patch queue branch '%s'. already exists. Try 'rebase' instead." % pq_branch) - commits = repo.get_commits(options=['-%d' % tries], first_parent=True) + commits = repo.get_commits(num=tries, first_parent=True) # If we go back in history we have to safe our pq so we always try to apply # the latest one if len(commits) > 1: |