Commit 7aaa538f authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Fixed: error when browsing an empty Mercurial repository (#1046).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1343 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 6d2a8914
......@@ -58,7 +58,9 @@ class Repository::Mercurial < Repository
# latest revision found in database
db_revision = latest_changeset ? latest_changeset.revision.to_i : -1
# latest revision in the repository
scm_revision = scm_info.lastrev.identifier.to_i
latest_revision = scm_info.lastrev
return if latest_revision.nil?
scm_revision = latest_revision.identifier.to_i
if db_revision < scm_revision
logger.debug "Fetching changesets for repository #{url}" if logger && logger.debug?
identifier_from = db_revision + 1
......
......@@ -105,7 +105,8 @@ module Redmine
line_feeds += 1 if line.chomp.empty?
end
end
revisions << build_revision_from_changeset(changeset)
# Add the last changeset if there is one left
revisions << build_revision_from_changeset(changeset) if changeset[:date]
end
return nil if $? && $?.exitstatus != 0
revisions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment