Quantcast
Channel: The Trac Project: Ticket #10819: Incorrect git repo path makes BrowserModule fail to load
Viewing all articles
Browse latest Browse all 16

Article 1

$
0
0

The attached patch makes two changes:

  1. The GitError in PyGIT.py inherits from TracError instead of Exception. This way Trac core's BrowserModule can catch the error and handle it elegantly. (That already happens, in source:trunk/trac/versioncontrol/web_ui/browser.py#L517— but only for exceptions that inherit from TracError.) This fixes the problem — the Browse Source tab no longer disappears if an invalid Git repository is added, and the behavior is consistent with the SVN versioncontrol backend.
  2. I added the git_dir path to this particular error in the git backend. So instead of "GIT control files not found, maybe wrong directory?" it now says "GIT control files not found at /tmp/, maybe wrong directory?" This makes user error easier to diagnose, and is more consistent with the SVN backend error: "/tmp/ does not appear to be a Subversion repository."

I'm not sure if PyGIT.py is supposed to have no dependencies on Trac core, though — if that's the case then a different approach would be needed.


Viewing all articles
Browse latest Browse all 16

Latest Images

Trending Articles





Latest Images