Modify

Opened 6 years ago

Closed 15 months ago

#2672 closed defect (wontfix)

git plugin complains of: UnboundLocalError: local variable 'rev' referenced before assignment with an empty repository

Reported by: wam-trac-hacks-org@… Owned by: sjain
Priority: normal Component: TracGitPlugin
Severity: normal Keywords: git GitPlugin
Cc: Trac Release: 0.11

Description (last modified by rjollos)

When loading the Git plugin (for the trac .11 release) I get:

Trac detected an internal error:
UnboundLocalError: local variable 'rev' referenced before assignment

If I go into the source of the TracGit module, and execute PyGit.py, I get a similar error:

draal:~/gitplugin/0.11/tracext/git$ python PyGIT.py /data/git/[scrubbed]/.git
git version [{'v_tuple': (1, 5, 2, 5), 'v_min_tuple': (1, 5, 2), 'v_compatible': True, 'v_min_str': '1.5.2', 'v_str': '1.5.2.5'}]
statm = (5029888, 3309568, 1613824, 1011712, 0, 1720320, 0)
DATA:      0     +0
DATA:      0     +0
Traceback (most recent call last):
  File "PyGIT.py", line 694, in <module>
    print "[%s]" % g.head()
  File "PyGIT.py", line 358, in head
    return self.verifyrev("HEAD")
  File "PyGIT.py", line 364, in verifyrev
    db, tag_db = self.rev_cache[2:4]
  File "PyGIT.py", line 269, in get_rev_cache
    oldest = rev
UnboundLocalError: local variable 'rev' referenced before assignment

This was from the latest zip file that was pulled down Feb 26, 2008

Looking into the code a bit, I realized that the problem comes from PyGIT's processing of an empty repository (immediately after 'git init' and before any commits). Once I discovered this, I added a file to the repository and the problem went away.

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by anonymous

Looks like this might be a duplicate of #2013, which has a user contributed patch on it as well.

comment:2 Changed 15 months ago by rjollos

  • Description modified (diff)

comment:3 Changed 15 months ago by rjollos

  • Resolution set to wontfix
  • Status changed from new to closed

Tickets should no longer be filed against TracGitPlugin. See GitPlugin or Git support in Trac 1.0.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from sjain. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.