Ticket #4366 (closed enhancement: fixed)
Opened 5 years ago
Last modified 5 years ago
Provide additional radio button in log template
| Reported by: | Tim Hatch <trac@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | version control/log view | Version: | 0.10.2 |
| Severity: | normal | Keywords: | ranges |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
This is a little difficult to explain. r4431:4432 shows the log message for both, but the radio buttons don't allow selecting "Prior to This" as a source revision for a diff to actually get the net changes for the two.
Of course, this is only valid if the node existed prior to what's being displayed.
Here's a rough hack that keys off whether the last listed change is an 'add' or something else. If it's a 'something else' then allow diffing to that n-1th revision. Move or copy probably needs to be on the list of things that perhaps can't be diffed against. A true fix would delve more into the source and see if it actually exists at r(n-1).
Index: templates/revisionlog.html
===================================================================
--- templates/revisionlog.html (revision 4434)
+++ templates/revisionlog.html (working copy)
@@ -110,7 +110,7 @@
<tr class="$odd_even">
<td class="diff">
<input type="radio" name="old" value="${item.path}@${item.rev}"
- checked="${idx == (len(items) - 1) or None}" />
+ checked="${len(items)==0 or (items[-1].change=='add' and idx==len(items)-1)}" />
<input type="radio" name="new" value="${item.path}@${item.rev}"
checked="${idx == 0 or None}" />
</td>
@@ -146,6 +146,14 @@
</tr>
</py:with>
</py:for>
+ <tr py:if="len(items) and items[-1].change != 'add'">
+ <td class="diff">
+ <input type="radio" name="old"
+ value="${items[-1].path}@${items[-1].rev-1}"
+ checked="checked" />
+ </td>
+ <td colspan="6">Prior State</td>
+ </tr>
</tbody>
</table>
Attachments
Change History
comment:1 Changed 5 years ago by Tim Hatch <trac@…>
- Summary changed from Provide additional ratio button in log template to Provide additional radio button in log template
comment:2 Changed 5 years ago by cboos
- Milestone set to 1.0
I see what you mean; yes, I already thought that this would be nice.
However, the fix would rather be in the log.py file, simply stopping one rev later.
Granted the code in log.py is currently a bit arcane...
(setting to 1.0 to keep it on the radar)
comment:3 Changed 5 years ago by Tim Hatch <trac@…>
+1 on the log.py comment. That's why I didn't touch it!
So basically when revs is specified, back up revs.pairs[0][0] by 1, and/or when limit is specified, increment by 1. When either of these is used, should a flag be set that keeps the changelog message from showing up in the log view? I don't want to confuse users into thinking too many are displayed... but if it hits the end of line and there isn't a previous, we want to display the last one normally.
comment:4 Changed 5 years ago by cboos
Well, actually this might be much simpler than expected (in log.py): look for the "limit" related comments and the del info[-1]. Similar things could be done for stop_rev and in case of ranges, this should be done for each interval.
I agree with displaying just a blank line (besides the radio button) for the extraneous revisions. This will have the additional benefit of separating the intervals.
comment:5 Changed 5 years ago by Tim Hatch <trac@…>
Here's another version which handles the few cases I'm able to test. I went ahead and left in the color block for the type of changeset, thinking that might be useful. Less hacking is added to the template, as the logic is pretty much all in log.py.
The peek_back flag is set whenever it's allowed to (it doesn't make any sense to peek if it's not going to be displayed with radio buttons!)
Changed 5 years ago by cboos
- Attachment revisionlog-t4366.diff added
show "separator" lines in the revision log, for being able to generate the correct range of differences
comment:6 Changed 5 years ago by cboos
- Milestone changed from 1.0 to 0.11
- Status changed from new to assigned
Here's my take at it, attachment:revisionlog-t4366.diff.
Nothing fancy, but seems to do the job for normal views and revision ranges (single range or multiple ranges).
No separator is shown when an explicit stop rev is given. This enables one to go back and forth between a given revision range diff and its corresponding changeset view.
comment:7 Changed 5 years ago by cboos
Of course, this is only valid if the node existed prior to what's being displayed.
He, I knew something was missing before I could commit that change ;)
Changed 5 years ago by cboos
- Attachment revisionlog-t4366.2.diff added
patch fixed, works when the first revision is an addition
comment:8 Changed 5 years ago by cboos
- Keywords ranges added
- Resolution set to fixed
- Status changed from assigned to closed
Ok, committed this one as r4712.



typo'd in summary.