Make Darcs adapter work with stringified revisions (test added).
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1213 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -47,18 +47,19 @@ class Repository::Darcs < Repository
|
||||
|
||||
def diff(path, rev, rev_to, type)
|
||||
patch_from = changesets.find_by_revision(rev)
|
||||
return nil if patch_from.nil?
|
||||
patch_to = changesets.find_by_revision(rev_to) if rev_to
|
||||
if path.blank?
|
||||
path = patch_from.changes.collect{|change| change.path}.join(' ')
|
||||
end
|
||||
scm.diff(path, patch_from.scmid, patch_to.scmid, type)
|
||||
patch_from ? scm.diff(path, patch_from.scmid, patch_to ? patch_to.scmid : nil, type) : nil
|
||||
end
|
||||
|
||||
def fetch_changesets
|
||||
scm_info = scm.info
|
||||
if scm_info
|
||||
db_last_id = latest_changeset ? latest_changeset.scmid : nil
|
||||
next_rev = latest_changeset ? latest_changeset.revision + 1 : 1
|
||||
next_rev = latest_changeset ? latest_changeset.revision.to_i + 1 : 1
|
||||
# latest revision in the repository
|
||||
scm_revision = scm_info.lastrev.scmid
|
||||
unless changesets.find_by_scmid(scm_revision)
|
||||
@@ -71,9 +72,7 @@ class Repository::Darcs < Repository
|
||||
:committer => revision.author,
|
||||
:committed_on => revision.time,
|
||||
:comments => revision.message)
|
||||
|
||||
next if changeset.new_record?
|
||||
|
||||
|
||||
revision.paths.each do |change|
|
||||
Change.create(:changeset => changeset,
|
||||
:action => change[:action],
|
||||
|
||||
Reference in New Issue
Block a user