Defect #1794

Repo Browser doesn't show file contents for Darcs repos

Added by Ralph Lange over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:2008-08-16
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:SCM
Target version:0.8
Resolution:Fixed Affected version:

Description

When browsing through a Darcs repo, clicking on any file name only gets the error: "The entry or revision was not found in the repository."

Log file shows:

Processing RepositoriesController#entry (for N.N.N.N at 2008-08-16 16:47:44) [GET]
  Session ID: e0150320690486db591253518017d93a
  Parameters: {"rev"=>"6", "action"=>"entry", "id"=>"test-rala", "controller"=>"repositories", "path"=>["README"]}
Rendering template within layouts/base
Completed in 0.03286 (30 reqs/sec) | Rendering: 0.01357 (41%) | DB: 0.00054 (1%) | 500 Internal Server Error [http://redmine.trs.bessy.de/repositories/entry/test-rala/README?rev=6]

Showing file differences works perfectly, only showing the file itself doesn't.
Verified with the test repositories.

Redmine r1747, darcs 1.0.9rc1, mysql 14.12 Distrib 5.0.32, ruby 1.8.5, Rails 2.1.0

History

#1 Updated by Ralph Lange over 9 years ago

Here's the debug log for the failing file display:

Processing RepositoriesController#entry (for 193.149.12.151 at 2008-08-16 17:20:59) [GET]
  Session ID: e0150320690486db591253518017d93a
  Parameters: {"rev"=>"6", "action"=>"entry", "id"=>"test-rala", "controller"=>"repositories", "path"=>["README"]}
  SQL (0.000089)   SET NAMES 'utf8'
  SQL (0.000038)   SET SQL_AUTO_IS_NULL=0
  Setting Columns (0.000400)   SHOW FIELDS FROM `settings`
  SQL (0.000034)   SELECT max(`settings`.updated_on) AS max_updated_on FROM `settings`
  User Columns (0.000591)   SHOW FIELDS FROM `users`
  User Load (0.000046)   SELECT * FROM `users` WHERE (`users`.`id` = 3) AND (status = 1)
  Project Columns (0.000325)   SHOW FIELDS FROM `projects`
  Project Load (0.000040)   SELECT * FROM `projects` WHERE (`projects`.`identifier` = 'test-rala') LIMIT 1
  Repository Load (0.000034)   SELECT * FROM `repositories` WHERE (`repositories`.project_id = 4) LIMIT 1
  Repository Columns (0.000249)   SHOW FIELDS FROM `repositories`
  EnabledModule Load (0.000052)   SELECT * FROM `enabled_modules` WHERE (`enabled_modules`.project_id = 4)
  EnabledModule Columns (0.000237)   SHOW FIELDS FROM `enabled_modules`
  Repository::Darcs Columns (0.000270)   SHOW FIELDS FROM `repositories`
Shelling out: darcs annotate --repodir /opt/redmine/tmp/test/darcs_repository --xml-output --match "hash 6" .
Rendering template within layouts/base
  Setting Load (0.000088)   SELECT * FROM `settings` WHERE (`settings`.`name` = 'app_title') LIMIT 1
  Setting Load (0.000041)   SELECT * FROM `settings` WHERE (`settings`.`name` = 'ui_theme') LIMIT 1
  Member Columns (0.000406)   SHOW FIELDS FROM `members`
  SQL (0.000161)   SELECT count(DISTINCT `members`.id) AS count_all FROM `members` LEFT OUTER JOIN `projects` ON `projects`.id = `members`.project_id LEFT OUTER JOIN `roles` ON `roles`.id = `members`.role_id WHERE (`members`.user_id = 3 AND (projects.status=1))
  Project Load Including Associations (0.000084)   SELECT `projects`.`id` AS t0_r0, `projects`.`name` AS t0_r1, `projects`.`description` AS t0_r2, `projects`.`homepage` AS t0_r3, `projects`.`is_public` AS t0_r4, `projects`.`parent_id` AS t0_r5, `projects`.`projects_count` AS t0_r6, `projects`.`created_on` AS t0_r7, `projects`.`updated_on` AS t0_r8, `projects`.`identifier` AS t0_r9, `projects`.`status` AS t0_r10, `parents_projects`.`id` AS t1_r0, `parents_projects`.`name` AS t1_r1, `parents_projects`.`description` AS t1_r2, `parents_projects`.`homepage` AS t1_r3, `parents_projects`.`is_public` AS t1_r4, `parents_projects`.`parent_id` AS t1_r5, `parents_projects`.`projects_count` AS t1_r6, `parents_projects`.`created_on` AS t1_r7, `parents_projects`.`updated_on` AS t1_r8, `parents_projects`.`identifier` AS t1_r9, `parents_projects`.`status` AS t1_r10 FROM `projects` LEFT OUTER JOIN `projects` parents_projects ON `parents_projects`.id = `projects`.parent_id INNER JOIN members ON projects.id = members.project_id WHERE ((`members`.user_id = 3) AND ((projects.status=1)))
Rendered layouts/_project_selector (0.00388)
  Version Columns (0.000370)   SHOW FIELDS FROM `versions`
  SQL (0.000032)   SELECT count(*) AS count_all FROM `versions` WHERE (`versions`.project_id = 4)
  Wiki Load (0.000054)   SELECT * FROM `wikis` WHERE (`wikis`.project_id = 4) LIMIT 1
  Board Columns (0.000373)   SHOW FIELDS FROM `boards`
  SQL (0.000036)   SELECT count(*) AS count_all FROM `boards` WHERE (`boards`.project_id = 4)
Completed in 0.12774 (7 reqs/sec) | Rendering: 0.03267 (25%) | DB: 0.00405 (3%) | 500 Internal Server Error [http://redmine.trs.bessy.de/repositories/entry/test-rala/README?rev=6]

#2 Updated by Ralph Lange over 9 years ago

OK, tracked it down pretty far:

When calling the darcs binary (In the log: "Shelling out:"), the correct way to call it (as it is done with diffs etc.) is

Shelling out: darcs diff --repodir /opt/redmine/tmp/test/darcs_repository --match "hash 20080308225722-98289-7909b1408ed72c966e2c84d9bb654613ce7af8cd.gz" -u README

while the failing view of the same file calls darcs as
Shelling out: darcs annotate --repodir /opt/redmine/tmp/test/darcs_repository --xml-output --match "hash 6" 

I.e. it is trying to make darcs --match on the revision number (that darcs doesn't know about) instead of the revision's hash ID.

This pretty much explains it, but - sorry! - I have no idea where to fix it.

#3 Updated by Ralph Lange over 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

I dug into ruby and the redmine code and found a way to get things working.

I uploaded the resulting patch as #1799.

#4 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from Resolved to Closed
  • Target version set to 0.8
  • Resolution set to Fixed

Patch applied in r1759.

Also available in: Atom PDF