From 2ae2d3ef834c4d17b1c7a4e09f299b537f91d3cc Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 2 Jan 2011 06:05:54 +0000 Subject: [PATCH] Fixed: repository: mercurial: sort changesets by revision (#3449, #3567). In DVCS, changesets are not in date order. Because Mercurial backend inserts changesets from eariest, 'ORDER BY id' means 'order by revision number'. Contributed by Yuya Nishihara. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4611 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/repository/mercurial.rb | 15 +++++++++++++++ .../repositories/mercurial_repository.tar.gz | Bin 7827 -> 8058 bytes test/unit/repository_mercurial_test.rb | 11 +++++++++++ 3 files changed, 26 insertions(+) diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index 10722395..9ce3b63e 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -18,6 +18,9 @@ require 'redmine/scm/adapters/mercurial_adapter' class Repository::Mercurial < Repository + # sort changesets by revision number + has_many :changesets, :order => "#{Changeset.table_name}.id DESC", :foreign_key => 'repository_id' + attr_protected :root_url validates_presence_of :url @@ -52,6 +55,18 @@ class Repository::Mercurial < Repository entries end + # Returns the latest changesets for +path+; sorted by revision number + def latest_changesets(path, rev, limit=10) + if path.blank? + changesets.find(:all, :include => :user, :limit => limit) + else + changes.find(:all, :include => {:changeset => :user}, + :conditions => ["path = ?", path.with_leading_slash], + :order => "#{Changeset.table_name}.id DESC", + :limit => limit).collect(&:changeset) + end + end + def fetch_changesets scm_info = scm.info if scm_info diff --git a/test/fixtures/repositories/mercurial_repository.tar.gz b/test/fixtures/repositories/mercurial_repository.tar.gz index 1d8ad305732f7a0d7bfbcd52bbeec919da88e3f1..c2a1b58745c8fdf994e7ab43b11919e79a639be4 100644 GIT binary patch literal 8058 zcmV-=ABEr_iwFP`T1-p;1MFG}IF(!5-dl)Grc5arqC(h%y*HV*GR8^mN|9+}o5wwv zGDPNCX;6lUa1xoP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ZM%U6SAuV3TWlpi*iuON43AR0fpuaQBEhJ z$f$Hk6E-r3P$+C5j76N&?}t6M+!K3ll|Ap~*4A zL=c~x7(Y8Hi~~Rtj@Y85_;?uuIV7eep&Vs6g%JvEd&^T`*J>eq3K>YpvT@kOQk=*} z_8)o-YTcjgJ_V^tv$zOUCrJhYLJm|U-5rBL=*AyiPlJRaAFH-*dd2FXc64swX3bYSmXt6B_g z*NR{&5UQc{rF3;2>1-!pJuV-(OE4|&juIp|6dNv<6AJX33A7%xELMrjNZuqJ7y?H+y;*_c#^$e>Gx%b{qMWHv6g>S~k6B6d@?c(ia0XI%E(NAd2kuq@ zSy_{D++jPcVt|h+O%@K8bRm_YZ71Xrn5BmOhI@j%d^J==`2c-FcGU{#7mDdh-L2e0 z%GUqHuv0TVY>jJA_FQ7C3eraZ&|hpPT96cO6JlqfTe3fG47WvSRF+0%X<(L0fkOf` z8BT{ZXLwjymx(1hch85r1XgFskJ#y25h1fx6Kqq|(>gk{6YsDxX%=qd2uW1T=knXz lPJcXav%`P^0|pEjFkrxd0RsjM7%=EX{0^uzbfy4!001CPd#eBd diff --git a/test/unit/repository_mercurial_test.rb b/test/unit/repository_mercurial_test.rb index 16e72c35..17b72cf6 100644 --- a/test/unit/repository_mercurial_test.rb +++ b/test/unit/repository_mercurial_test.rb @@ -76,6 +76,17 @@ class RepositoryMercurialTest < ActiveSupport::TestCase assert_equal @repository.changesets.find_by_revision('0').committed_on, rev0_committed_on end end + + def test_changeset_order_by_revision + @repository.fetch_changesets + @repository.reload + + c0 = @repository.latest_changeset + c1 = @repository.changesets.find_by_revision('0') + # sorted by revision (id), not by date + assert c0.revision.to_i > c1.revision.to_i + assert c0.committed_on < c1.committed_on + end else puts "Mercurial test repository NOT FOUND. Skipping unit tests !!!" def test_fake; assert true end