Edgewall Software
Modify

Opened 14 years ago

Closed 13 years ago

#4366 closed enhancement (fixed)

Provide additional radio button in log template

Reported by: Tim Hatch <trac@…> Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: version control/log view Version: 0.10.2
Severity: normal Keywords: ranges
Cc: Branch:
Release Notes:
API Changes:
Internal 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 (3)

t4366b.diff (3.4 KB ) - added by Tim Hatch <trac@…> 14 years ago.
Second try
revisionlog-t4366.diff (3.8 KB ) - added by Christian Boos 14 years ago.
show "separator" lines in the revision log, for being able to generate the correct range of differences
revisionlog-t4366.2.diff (3.8 KB ) - added by Christian Boos 14 years ago.
patch fixed, works when the first revision is an addition

Download all attachments as: .zip

Change History (11)

comment:1 by Tim Hatch <trac@…>, 14 years ago

Summary: Provide additional ratio button in log templateProvide additional radio button in log template

typo'd in summary.

comment:2 by Christian Boos, 14 years ago

Milestone: 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 by Tim Hatch <trac@…>, 14 years ago

+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 by Christian Boos, 14 years ago

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.

by Tim Hatch <trac@…>, 14 years ago

Attachment: t4366b.diff added

Second try

comment:5 by Tim Hatch <trac@…>, 14 years ago

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!)

by Christian Boos, 14 years ago

Attachment: revisionlog-t4366.diff added

show "separator" lines in the revision log, for being able to generate the correct range of differences

comment:6 by Christian Boos, 14 years ago

Milestone: 1.00.11
Status: newassigned

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 by Christian Boos, 14 years ago

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 ;)

by Christian Boos, 14 years ago

Attachment: revisionlog-t4366.2.diff added

patch fixed, works when the first revision is an addition

comment:8 by Christian Boos, 13 years ago

Keywords: ranges added
Resolution: fixed
Status: assignedclosed

Ok, committed this one as r4712.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.