On Tue, Apr 26, 2011 at 6:27 PM, Ryan Linneman <[email protected]> wrote:

> I've setup a private install of gitorious on ubuntu following
> Christians guide at
> http://cjohansen.no/en/ruby/setting_up_gitorious_on_your_own_server.
> Almost everything seems to be functional now.  I can seem to find any
> other reports of the following issue and am not well versed in Ruby/
> Rails.  The problem I have is when attempting to review a merge
> request, the section "Commits that would be merged" shows the
> following "An error has occured. Please try again later."  I've looked
> into the production.log file and get:
>
> NoMethodError (undefined method `diffs' for nil:NilClass):
>  app/models/merge_request_version.rb:107:in `single_commit_diff'
>

Ryan,
The problem you're seeing may be caused by some parts missing on your
server. A quick background:

- When you create a merge request, a new branch is pushed to the target
repository (refs/merge-requests/<merge-request-id>. This branch will be the
commit chosen as the last commit in the merge request
- At the same time, one branch is created for each version of a merge
request in a hidden tracking repository for the target repository
(refs/merge-request/<merge-request-id>/<version>

It could be that one of these branches is missing. To find the path to these
repositories on disk:

Assuming the URL to your merge request is /project/repo/merge_requests/1:
enter this inside script/console to find the location of the repositories on
disk (substitute "project", "repository" and "1" with the real values from
your merge request:

mr =
Project.find_by_slug("project").repositories.find_by_name("repo").merge_requests.find_by_sequence_number(1)
mr.target_repository.full_repository_path
mr.tracking_repository.full_repository_path

Now, verify that the merge request branch exists in the target repository:
cat <target_repo_path>/refs/merge-requests/1  # should be the SHA of the
merge request
cat <tracking_repo_path>/refs/merge-requests/1/1  # should be the same

Are both of these correct?

Cheers,
- Marius

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]

Reply via email to