Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Process directory diff in a nicer order. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
82b33e15065aef4c295dde1af71057a6 |
User & Date: | peter 2018-01-14 20:02:17.382 |
Context
2018-01-14
| ||
20:17 | Clean up after dir diff fixes check-in: 9d15692c0d user: peter tags: trunk | |
20:02 | Process directory diff in a nicer order. check-in: 82b33e1506 user: peter tags: trunk | |
2018-01-11
| ||
16:28 | Bumped revision to 2.8.1 check-in: 3e91ca34e5 user: peter tags: trunk | |
Changes
Changes to Changes.
1 2 3 4 5 6 7 | 2018-01-11 Bumped revision to 2.8.1 Corrected detected of Emacs for Registry. (Broken in 2.7.4) 2017-12-28 Pause before a large file in dirdiff processing to make it clear where it is slowed down. | > > > | 1 2 3 4 5 6 7 8 9 10 | 2018-01-14 Process directory diff in a nicer order. 2018-01-11 Bumped revision to 2.8.1 Corrected detected of Emacs for Registry. (Broken in 2.7.4) 2017-12-28 Pause before a large file in dirdiff processing to make it clear where it is slowed down. |
︙ | ︙ |
Changes to src/dirdiff.tcl.
︙ | ︙ | |||
303 304 305 306 307 308 309 310 311 312 313 314 315 316 | option -leftdirvariable -default "" -configuremethod SetDirOption option -rightdirvariable -default "" -configuremethod SetDirOption option -statusvar -default "" option -changelist -default "" variable AfterId "" variable DebugCh "" variable PauseBgProcessing 0 variable ScheduledRestart 0 variable AfterTime 1 variable IdleQueue {} variable IdleQueueArr variable leftMark "" variable rightMark "" | > | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | option -leftdirvariable -default "" -configuremethod SetDirOption option -rightdirvariable -default "" -configuremethod SetDirOption option -statusvar -default "" option -changelist -default "" variable AfterId "" variable DebugCh "" variable DebugTime {} variable PauseBgProcessing 0 variable ScheduledRestart 0 variable AfterTime 1 variable IdleQueue {} variable IdleQueueArr variable leftMark "" variable rightMark "" |
︙ | ︙ | |||
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | # Delete all idle processing if {$AfterId ne ""} { after cancel $AfterId } if {$DebugCh ne ""} { close $DebugCh set DebugCh "" } # Uncomment to activate debug logging #set DebugCh [open ~/dirdiff.log a] set AfterId "" set IdleQueue {} set ScheduledRestart 0 array unset IdleQueueArr set protect {left 0 right 0} # Directory Diff only supports one plugin. | > > > | 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | # Delete all idle processing if {$AfterId ne ""} { after cancel $AfterId } if {$DebugCh ne ""} { close $DebugCh set DebugCh "" set DebugTime {} } # Uncomment to activate debug logging #set DebugCh [open ~/dirdiff.log a] #$self DlogTablelist $self Dlog RESTART set AfterId "" set IdleQueue {} set ScheduledRestart 0 array unset IdleQueueArr set protect {left 0 right 0} # Directory Diff only supports one plugin. |
︙ | ︙ | |||
767 768 769 770 771 772 773 | if {[winfo exists $w]} { $w configure -state disabled } } dict set widgets $side {} } | | > > | > > > > > > | > | > > > > > > > > > > > > > > > > > > > > > > > | | | | | 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 | if {[winfo exists $w]} { $w configure -state disabled } } dict set widgets $side {} } method AddNodeToIdle {node {first 0}} { if {[info exists IdleQueueArr($node)]} { return } if {$first} { # Items are popped from the end, so last is first lappend IdleQueue $node } else { # Avoid compiled linsert by having index in a variable set c0 0 set IdleQueue [linsert $IdleQueue[set IdleQueue {}] $c0 $node] } set IdleQueueArr($node) 1 if {$AfterId eq ""} { set AfterId [after $AfterTime [mymethod UpdateIdle]] } } # Debug logging method Dlog {args} { if {$DebugCh ne ""} { set msg [join $args] set now [clock clicks -milliseconds] set suffix "" if {[dict exists $DebugTime $msg]} { set delta [expr {$now - [dict get $DebugTime $msg]}] set suffix " (+$delta)" } dict set DebugTime $msg $now puts $DebugCh "$now $msg$suffix" flush $DebugCh } } method DlogTablelist {} { puts DlogTablelist foreach cmd [info commands ::tablelist::*] { set tail [namespace tail $cmd] #if {[string match *SubCmd $tail]} continue if {$tail in { synchronize tablelistWidgetCmd cleanupWindow getTablelistPath handleMotion handleMotionDelayed rowIndex isInteger keyToRow colIndex }} continue trace add execution $cmd enter [mymethod Dlog] puts "Traced $cmd" } } method UpdateIdle {} { $self Dlog UpdateIdle set AfterId "X" if {$PauseBgProcessing} { $self Dlog Pause set AfterId [after 200 [mymethod UpdateIdle]] return } set pre [clock clicks -milliseconds] set errors {} set count 0 while {[llength $IdleQueue] > 0} { set node [lindex $IdleQueue end] # Always make a pause before a large file if {[$tree rowattrib $node type] ne "directory"} { if {[$tree rowattrib $node largefile]} { if {$count > 0} { $self Dlog "New Lap for large file" break } } } incr count set IdleQueue [lrange $IdleQueue[set IdleQueue {}] 0 end-1] unset IdleQueueArr($node) if {[$tree rowattrib $node type] ne "directory"} { set sts [catch {$self UpdateFileNode $node} err] } else { set sts [catch {$self UpdateDirNode $node} err] } if {$sts} { lappend errors $node $err break } # Work for at least 200 ms to keep things efficient set post [clock clicks -milliseconds] if {($post - $pre) > 200} break } #if {($post - $pre) > 1000} { #puts "[expr $post - $pre] ms for [$tree set $node leftfull]" #} # Update the status variable to track progress if {$options(-statusvar) ne ""} { |
︙ | ︙ | |||
852 853 854 855 856 857 858 | set statusvar "" set AfterId "" return } } if {[llength $IdleQueue] > 0} { | | | 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 | set statusvar "" set AfterId "" return } } if {[llength $IdleQueue] > 0} { set node [lindex $IdleQueue end] set leftfull [$tree rowattrib $node leftfull] set rightfull [$tree rowattrib $node rightfull] if {$leftfull ne ""} { set statusvar "$leftfull ($count)" } else { set statusvar "$rightfull ($count)" } |
︙ | ︙ | |||
976 977 978 979 980 981 982 | set name [file tail $df1] } else { set type $type2 set name [file tail $df2] } set largeFile 0 if {$type eq "directory"} { | | | 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 | set name [file tail $df1] } else { set type $type2 set name [file tail $df2] } set largeFile 0 if {$type eq "directory"} { set values [list $name/ \ "" "" \ "" \ "" ""] } else { set values [list $name \ $size1 $time1 \ "" \ |
︙ | ︙ | |||
1008 1009 1010 1011 1012 1013 1014 | $tree cellconfigure $id,command -window [mymethod addCmdCol] } } if {$type eq "directory"} { ## Make it so that this node is openable $tree collapse $id | < < | < | 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 | $tree cellconfigure $id,command -window [mymethod addCmdCol] } } if {$type eq "directory"} { ## Make it so that this node is openable $tree collapse $id $self SetNodeStatus $id empty $self AddNodeToIdle $id 1 } elseif {$size1 == ""} { $self SetNodeStatus $id new } elseif {$size2 == ""} { $self SetNodeStatus $id old } else { $self SetNodeStatus $id unknown $self AddNodeToIdle $id |
︙ | ︙ |