@@ -42,6 +42,10 class Repository::Mercurial < Repository | |||||
42 | changeset.scmid |
|
42 | changeset.scmid | |
43 | end |
|
43 | end | |
44 |
|
44 | |||
|
45 | def diff_format_revisions(cs, cs_to, sep=':') | |||
|
46 | super(cs, cs_to, ' ') | |||
|
47 | end | |||
|
48 | ||||
45 | def entries(path=nil, identifier=nil) |
|
49 | def entries(path=nil, identifier=nil) | |
46 | entries=scm.entries(path, identifier) |
|
50 | entries=scm.entries(path, identifier) | |
47 | if entries |
|
51 | if entries |
@@ -128,6 +128,9 class RepositoriesMercurialControllerTest < ActionController::TestCase | |||||
128 | end |
|
128 | end | |
129 |
|
129 | |||
130 | def test_diff |
|
130 | def test_diff | |
|
131 | @repository.fetch_changesets | |||
|
132 | @repository.reload | |||
|
133 | ||||
131 | [4, '4', 'def6d2f1254a'].each do |r1| |
|
134 | [4, '4', 'def6d2f1254a'].each do |r1| | |
132 | # Full diff of changeset 4 |
|
135 | # Full diff of changeset 4 | |
133 | get :diff, :id => 3, :rev => 4 |
|
136 | get :diff, :id => 3, :rev => 4 | |
@@ -141,6 +144,25 class RepositoriesMercurialControllerTest < ActionController::TestCase | |||||
141 | :sibling => { :tag => 'td', |
|
144 | :sibling => { :tag => 'td', | |
142 | :attributes => { :class => /diff_out/ }, |
|
145 | :attributes => { :class => /diff_out/ }, | |
143 | :content => /def remove/ } |
|
146 | :content => /def remove/ } | |
|
147 | assert_tag :tag => 'h2', :content => /4:def6d2f1254a/ | |||
|
148 | end | |||
|
149 | end | |||
|
150 | end | |||
|
151 | ||||
|
152 | def test_diff_two_revs | |||
|
153 | @repository.fetch_changesets | |||
|
154 | @repository.reload | |||
|
155 | ||||
|
156 | [2, '400bb8672109', '400', 400].each do |r1| | |||
|
157 | [4, 'def6d2f1254a'].each do |r2| | |||
|
158 | get :diff, :id => 3, :rev => r1, | |||
|
159 | :rev_to => r2 | |||
|
160 | assert_response :success | |||
|
161 | assert_template 'diff' | |||
|
162 | ||||
|
163 | diff = assigns(:diff) | |||
|
164 | assert_not_nil diff | |||
|
165 | assert_tag :tag => 'h2', :content => /4:def6d2f1254a 2:400bb8672109/ | |||
144 | end |
|
166 | end | |
145 | end |
|
167 | end | |
146 | end |
|
168 | end |
General Comments 0
You need to be logged in to leave comments.
Login now