diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-04-12 17:13:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-04-12 17:13:17 +0000 |
commit | 7aaa538fd9cb34b88c037a7d03a5351c1e2c852e (patch) | |
tree | 81cdef6303af17ea7729dc2262ce5b46496b8e00 /app | |
parent | 6d2a89142af235b5d0a9e30350859fb99ac665f3 (diff) | |
download | redmine-7aaa538fd9cb34b88c037a7d03a5351c1e2c852e.tar.gz redmine-7aaa538fd9cb34b88c037a7d03a5351c1e2c852e.zip |
Fixed: error when browsing an empty Mercurial repository (#1046).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1343 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/models/repository/mercurial.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index b183c15a7..18cbc9495 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -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 |