Edgewall Software
Modify

Opened 11 years ago

Last modified 5 months ago

#11061 new defect

TypeError: Git object id must be byte or a text string, not: int

Reported by: Christian Boos Owned by:
Priority: normal Milestone: next-major-releases
Component: plugin/git Version:
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

We should be able to cope with git-svn converted repositories which might contain svn style TracLinks (like our own repository).

… but this ticket is more an opportunity to congratulate Jun for his effort with the jomae.git@pygit2 branch ;-)

We should also add libgit2/pygit2 versions to the system info. In my case, it's 0.17.0 and 0.17.3 on OpenSuSE 0.12.2.

Btw, I've also tried on Windows with the bleeding edge (build of latest from yesterday), but got many errors, the API has evolved quite a bit since 0.17.3.


How to Reproduce

While doing a GET operation on /log/trunk/, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'path': u'/trunk/', 'revs': u'11577-11612'}

User agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0

System Information

Trac 1.1.2dev
Babel 0.9.6
Docutils 0.9
Genshi 0.6 (without speedups)
Pygments 1.5
pysqlite 2.6.0
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC]
pytz 2012b
setuptools 0.6
SQLite 3.7.12.1
jQuery 1.8.3

Enabled Plugins

Python Traceback

Traceback (most recent call last):
  File "/home/cboos/trac/trunk/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/cboos/trac/trunk/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/cboos/trac/trunk/trac/versioncontrol/web_ui/log.py", line 113, in process_request
    rev = unicode(repos.normalize_rev(rev))
  File "/home/cboos/trac/trunk/tracopt/versioncontrol/git/git_fs.py", line 520, in normalize_rev
    commit = self._get_commit(rev, raises=False)
  File "/home/cboos/trac/trunk/tracopt/versioncontrol/git/git_fs.py", line 445, in _get_commit
    git_object = self.git_repos[rev]
TypeError: Git object id must be byte or a text string, not: int

Attachments (0)

Change History (4)

in reply to:  description comment:1 by Jun Omae, 11 years ago

Thanks for your trying and suggestions! Fixed it in the branch. Ah, 1.0-stable has the same issue….

...
  File "/home/jun66j5/src/trac/edgewall/github/tracopt/versioncontrol/git/git_fs.py", line 404, in normalize_rev
    normrev = self.git.verifyrev(rev)
  File "/home/jun66j5/src/trac/edgewall/github/tracopt/versioncontrol/git/PyGIT.py", line 690, in verifyrev
    rev = self._fs_from_unicode(rev)
  File "/home/jun66j5/src/trac/edgewall/github/tracopt/versioncontrol/git/PyGIT.py", line 379, in <lambda>
    self._fs_from_unicode = lambda s: s.encode(git_fs_encoding)
AttributeError: 'int' object has no attribute 'encode'

We should be able to cope with git-svn converted repositories which might contain svn style TracLinks (like our own repository).

The log: link with revision ranges doesn't work for non-linear repository. We should support for git and mercurial repository.

We should also add libgit2/pygit2 versions to the system info. In my case, it's 0.17.0 and 0.17.3 on OpenSuSE 0.12.2.

Sure. Added to the system info in d4257341/jomae.git.

comment:2 by Ryan J Ollos, 9 years ago

Milestone: next-dev-1.1.xnext-dev-1.3.x

Narrowing focus for milestone:1.2. Please move ticket to milestone:1.2 if you intend to fix it.

comment:3 by Ryan J Ollos, 5 years ago

Milestone: next-dev-1.3.xnext-dev-1.5.x

Milestone renamed

comment:4 by Ryan J Ollos, 5 years ago

Milestone: next-dev-1.5.xnext-major-releases

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.