Bug 4313

Summary: buildhistory-diff should give coherent message with bad arguments
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Stoicescu Cornel <corneliux.stoicescu>
Component: coreAssignee: Paul Eggleton <bluelightning>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, meta.mr.watcher, meta.watcher, sgw
Version: 1.4   
Target Milestone: 1.5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Stoicescu Cornel 2013-04-16 12:22:09 UTC
Expected result:
"
cornel@NODE1:~/SSD/poky/build$ buildhistory-diff a
Report significant differences in the buildhistory repository
Syntax: buildhistory-diff <buildhistory-path> <since-revision> [to-revision]
If to-revision is not specified, it defaults to HEAD
"

Actual result (for 2 arguments instead of 3):
"
cornel@NODE1:~/SSD/poky/build$ buildhistory-diff a b
Traceback (most recent call last):
  File "/home/cornel/SSD/poky/scripts/buildhistory-diff", line 62, in <module>
    main()
  File "/home/cornel/SSD/poky/scripts/buildhistory-diff", line 54, in main
    changes = oe.buildhistory_analysis.process_changes(sys.argv[1], sys.argv[2], torev)
  File "/home/cornel/SSD/poky/meta/lib/oe/buildhistory_analysis.py", line 357, in process_changes
    repo = git.Repo(repopath)
  File "/usr/local/lib/python2.7/dist-packages/git/repo/base.py", line 98, in __init__
    raise NoSuchPathError(epath)
git.exc.NoSuchPathError: /home/cornel/SSD/poky/build/a
"

Actual result with 3 arguments but an existent commit:
"
cornel@NODE1:~/SSD/poky/build$ buildhistory-diff tmp/buildhistory/ c6cf1ce6995f5b4034313afa5786396fb5545f34 HEAD
Traceback (most recent call last):
  File "/home/cornel/SSD/poky/scripts/buildhistory-diff", line 62, in <module>
    main()
  File "/home/cornel/SSD/poky/scripts/buildhistory-diff", line 54, in main
    changes = oe.buildhistory_analysis.process_changes(sys.argv[1], sys.argv[2], torev)
  File "/home/cornel/SSD/poky/meta/lib/oe/buildhistory_analysis.py", line 359, in process_changes
    commit = repo.commit(revision1)
  File "/usr/local/lib/python2.7/dist-packages/git/repo/base.py", line 378, in commit
    return self.rev_parse(str(rev)+"^0")
  File "/usr/local/lib/python2.7/dist-packages/git/repo/fun.py", line 151, in rev_parse
    obj = name_to_object(repo, rev[:start])
  File "/usr/local/lib/python2.7/dist-packages/git/repo/fun.py", line 89, in name_to_object
    return Object.new_from_sha(repo, hex_to_bin(hexsha))
  File "/usr/local/lib/python2.7/dist-packages/git/objects/base.py", line 64, in new_from_sha
    oinfo = repo.odb.info(sha1)
  File "/usr/local/lib/python2.7/dist-packages/gitdb/db/base.py", line 256, in info
    return self._db_query(sha).info(sha)
  File "/usr/local/lib/python2.7/dist-packages/gitdb/db/base.py", line 243, in _db_query
    raise BadObject(sha)
gitdb.exc.BadObject: BadObject: c6cf1ce6995f5b4034313afa5786396fb5545f34
"
Comment 2 Stoicescu Cornel 2013-10-01 14:40:24 UTC
Verified in:
poky master:2f64fae60b3f61a2c45dc9e5314d2d16b1e64605