From: Ed Bartosh Date: Thu, 10 May 2012 11:18:22 +0000 (+0300) Subject: Fixed crashes 'Revision xxx not found' in changelog mode X-Git-Tag: 0.5~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1c4e69db16f45f252b01af1c0ced7637e6234c1;p=tools%2Fgbs.git Fixed crashes 'Revision xxx not found' in changelog mode Change-Id: I6de270201e86cb98d3b605b575c56dd2fd4d8ca0 --- diff --git a/gitbuildsys/cmd_changelog.py b/gitbuildsys/cmd_changelog.py index 8d97780..e41de26 100644 --- a/gitbuildsys/cmd_changelog.py +++ b/gitbuildsys/cmd_changelog.py @@ -116,18 +116,20 @@ def do(opts, _args): # get the commit start from the opts.since if opts.since: - commitid_since = repo.rev_parse(opts.since) - if not commitid_since: - msger.error("Invalid since commit object name: %s" % (opts.since)) + since = opts.since else: - sha1 = get_latest_rev(fn_changes) - if sha1: - commitid_since = repo.rev_parse(sha1) - if not commitid_since: + since = get_latest_rev(fn_changes) + + commitid_since = None + if since: + try: + commitid_since = repo.rev_parse(since) + except GitRepositoryError: + if opts.since: + msger.error("Invalid commit: %s" % (opts.since)) + else: msger.error("Can't find last commit ID in the log, "\ - "please specify it by '--since'") - else: - commitid_since = None + "please specify it by '--since'") commits = repo.get_commits(commitid_since, 'HEAD') if not commits: