Patch #4262 » bzr-fixes.patch
| app/helpers/repositories_helper.rb (working copy) | ||
|---|---|---|
|
:id => @project,
|
||
|
:path => path_param,
|
||
|
:rev => @changeset.revision) unless s || c.action == 'D'
|
||
|
text << " - #{c.revision}" unless c.revision.blank?
|
||
|
text << " - #{c.revision}" unless c.revision.blank? or c.revision.length > 8
|
||
|
text << ' (' + link_to('diff', :controller => 'repositories',
|
||
|
:action => 'diff',
|
||
|
:id => @project,
|
||
|
:path => path_param,
|
||
|
:rev => @changeset.revision) + ') ' if c.action == 'M'
|
||
|
text << ' ' + content_tag('span', c.from_path, :class => 'copied-from') unless c.from_path.blank?
|
||
|
text << " - #{c.revision}" unless c.revision.blank? or c.revision.length < 8
|
||
|
end
|
||
|
output << "<li class='#{style}'>#{text}</li>"
|
||
|
output << render_changes_tree(tree[file][:s]) if s
|
||
| ... | ... | |
|
end
|
||
|
def bazaar_field_tags(form, repository)
|
||
|
content_tag('p', form.text_field(:url, :label => 'Root directory', :size => 60, :required => true, :disabled => (repository && !repository.new_record?)))
|
||
|
content_tag('p', form.text_field(:url, :label => 'Branch location', :size => 60, :required => true, :disabled => (repository && !repository.new_record?)) +
|
||
|
'<br />(local path, http://, https://)')
|
||
|
end
|
||
|
|
||
|
def filesystem_field_tags(form, repository)
|
||
| app/models/repository/bazaar.rb (working copy) | ||
|---|---|---|
|
def self.scm_name
|
||
|
'Bazaar'
|
||
|
end
|
||
|
|
||
|
def latest_changesets(path, rev, limit=10)
|
||
|
if path.blank?
|
||
|
changesets.find(:all, :include => :user,
|
||
|
:order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC",
|
||
|
:limit => limit)
|
||
|
else
|
||
|
entry = changes.first(:conditions => ["path = ?", path.with_leading_slash], :limit => 1)
|
||
|
return [] unless entry
|
||
|
changes.find(:all, :include => {:changeset => :user},
|
||
|
:conditions => ["changes.revision = ?", entry.revision],
|
||
|
:order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC",
|
||
|
:limit => limit).collect(&:changeset)
|
||
|
end
|
||
|
end
|
||
|
def entries(path=nil, identifier=nil)
|
||
|
entries = scm.entries(path, identifier)
|
||
|
if entries
|
||
| ... | ... | |
|
c = Change.find(:first,
|
||
|
:include => :changeset,
|
||
|
:conditions => ["#{Change.table_name}.revision = ? and #{Changeset.table_name}.repository_id = ?", e.lastrev.revision, id],
|
||
|
:order => "#{Changeset.table_name}.revision DESC")
|
||
|
:order => "#{Changeset.table_name}.committed_on DESC")
|
||
|
if c
|
||
|
e.lastrev.identifier = c.changeset.revision
|
||
|
e.lastrev.name = c.changeset.revision
|
||
| ... | ... | |
|
Change.create(:changeset => changeset,
|
||
|
:action => change[:action],
|
||
|
:path => change[:path],
|
||
|
:from_path => change[:from_path],
|
||
|
:from_revision => change[:from_revision],
|
||
|
:revision => change[:revision])
|
||
|
end
|
||
|
end
|
||
| lib/redmine/scm/adapters/bazaar_adapter.rb (working copy) | ||
|---|---|---|
|
identifier_from = 'last:1' unless identifier_from and identifier_from.to_i > 0
|
||
|
identifier_to = 1 unless identifier_to and identifier_to.to_i > 0
|
||
|
revisions = Revisions.new
|
||
|
cmd = "#{BZR_BIN} log -v --show-ids -r#{identifier_to.to_i}..#{identifier_from} #{target(path)}"
|
||
|
cmd = "#{BZR_BIN} log --show-ids -r#{identifier_to.to_i}..#{identifier_from} #{target(path)}"
|
||
|
cmd << " -v" if options[:with_paths]
|
||
|
cmd << " --limit #{options[:limit].to_i}" if options[:limit]
|
||
|
shellout(cmd) do |io|
|
||
|
revision = nil
|
||
|
parsing = nil
|
||
| ... | ... | |
|
when 'removed'
|
||
|
revision.paths << {:action => 'D', :path => "/#{path}", :revision => revid}
|
||
|
when 'renamed'
|
||
|
new_path = path.split('=>').last
|
||
|
revision.paths << {:action => 'M', :path => "/#{new_path.strip}", :revision => revid} if new_path
|
||
|
old_path, new_path = path.split('=>')
|
||
|
if new_path
|
||
|
revision.paths << {:action => 'R',
|
||
|
:path => "/#{new_path.strip}",
|
||
|
:revision => revid,
|
||
|
:from_path => "/#{old_path.strip}"}
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||