Modify ↓
Opened 18 years ago
Closed 12 years ago
#2672 closed defect (wontfix)
git plugin complains of: UnboundLocalError: local variable 'rev' referenced before assignment with an empty repository
| Reported by: | Owned by: | Samat Jain | |
|---|---|---|---|
| Priority: | normal | Component: | TracGitPlugin |
| Severity: | normal | Keywords: | git GitPlugin |
| Cc: | Trac Release: | 0.11 |
Description (last modified by )
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 18 years ago by
comment:2 Changed 12 years ago by
| Description: | modified (diff) |
|---|
comment:3 Changed 12 years ago by
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |
Tickets should no longer be filed against TracGitPlugin. See GitPlugin or Git support in Trac 1.0.
Note: See
TracTickets for help on using
tickets.



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