]> source.dussan.org Git - redmine.git/commitdiff
scm: git: set revisions ordering inconsistent in existing database (#5357).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 19 May 2011 02:16:27 +0000 (02:16 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 19 May 2011 02:16:27 +0000 (02:16 +0000)
Between version 0.9 r2840 (#1406) and version 1.2 r5073 (#7821, #5357),
git revisions are stored as *C-B-A-F-E-D* in database.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5853 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository/git.rb

index 3e2edd9f7fa20eb068da27dd31cc2ca1ac928d30..7b229a279231603ecced936e54b56513b147a62f 100644 (file)
@@ -109,7 +109,17 @@ class Repository::Git < Repository
     scm_brs = branches
     return if scm_brs.nil? || scm_brs.empty?
     h = extra_info || {}
-    h["branches"]  ||= {}
+    h["branches"]       ||= {}
+    h["db_consistent"]  ||= {}
+    if changesets.count == 0
+      h["db_consistent"]["ordering"] = 1
+      merge_extra_info(h)
+      self.save
+    elsif ! h["db_consistent"].has_key?("ordering")
+      h["db_consistent"]["ordering"] = 0
+      merge_extra_info(h)
+      self.save
+    end
     scm_brs.each do |br|
       from_scmid = nil
       from_scmid = h["branches"][br]["last_scmid"] if h["branches"][br]