Eskil

Check-in [a50e753c1b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Revert bad file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:a50e753c1b235748934d9187358974b7d91d6f0fd54b830f8c6bcae6a504ae3f
User & Date: peter 2019-02-04 16:08:32
Context
2019-02-04
16:17
Bug fix in file select check-in: 433fedb7d2 user: peter tags: trunk
16:08
Revert bad file. check-in: a50e753c1b user: peter tags: trunk
15:56
Document default print settings. check-in: c07ac8613c user: peter tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/dirdiff.tcl.

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
...
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
...
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
...
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
...
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
}

# Sort file names
proc Fsort {l} {
    lsort -dictionary $l
}

set ::profList [list CompareFiles eskil::rev::SVN::mount]
proc InitProf {} {
    foreach n $::profList {
        trace add execution $n {enter} [list DoProfEnter $n]
        trace add execution $n {leave} [list DoProfLeave $n]
    }
    set ::prof(start) [clock milliseconds]
}
proc DoProfEnter {point args} {
    set ::prof($point,enter) [clock milliseconds]
}
proc DoProfLeave {point args} {
    set dur [expr { [clock milliseconds] - $::prof($point,enter)}]
    incr ::prof($point,dur) $dur
}
proc EndProf {} {
    set ::prof(end) [clock milliseconds]
    set ::prof(dur) [expr {$::prof(end) - $::prof(start)}]
    foreach n $::profList {
        trace remove execution $n {enter} [list DoProfEnter $n]
        trace remove execution $n {leave} [list DoProfLeave $n]
    }
    parray ::prof
}

# Compare two files or dirs
# Return true if equal
proc CompareFiles {file1 file2} {
    if {[catch {file lstat $file1 stat1}]} {
        return 0
    }
    if {[catch {file lstat $file2 stat2}]} {
................................................................................
    }

    switch $::Pref(dir,comparelevel) {
        2 -
        1 { # Check contents internally
            set bufsz 65536
            set eq 2 ;# 2 = equal this far, 1 = equal, 0 = not equal
            DoProfEnter OpenFile1
            set ch1 [open $file1 r]
            DoProfLeave OpenFile1
            DoProfEnter OpenFile2
            set ch2 [open $file2 r]
            DoProfLeave OpenFile2
            if {$::Pref(dir,comparelevel) == 2} {
                fconfigure $ch1 -translation binary
                fconfigure $ch2 -translation binary
            }
            # Allow a plugin to do its thing
            if {$anyPlugin} {
                #puts "PLUGIN!"
................................................................................
                } else {
                    if {![string equal $f1 $f2]} {
                        set eq 0
                    }
                }
            }
            while {$eq == 2 && ![eof $ch1] && ![eof $ch2]} {
                DoProfEnter ReadIt
                set f1 [read $ch1 $bufsz]
                set f2 [read $ch2 $bufsz]
                DoProfLeave ReadIt
                if {$nocase} {
                    if {![string equal -nocase $f1 $f2]} {
                        set eq 0
                    }
                } else {
                    if {![string equal $f1 $f2]} {
                        set eq 0
................................................................................
                    }
                }
            }
            if {$eq == 2 && (![eof $ch1] || ![eof $ch2])} {
                set eq 0
            }
            # Errors during close are not interesting
            DoProfEnter Close
            catch {close $ch1}
            catch {close $ch2}
            DoProfLeave Close
        }
    }
    return [expr {$eq != 0}]
}

# Returns the contents of a directory as a sorted list of full file paths.
proc DirContents {dir} {
................................................................................
            set DebugCh ""
            set DebugTime {}
        }
        # Uncomment to activate debug logging
        #set DebugCh [open ~/dirdiff.log a]
        #$self DlogTablelist
        $self Dlog RESTART
        InitProf
        set AfterId ""
        set IdleQueue {}
        set ScheduledRestart 0
        array unset IdleQueueArr
        set protect {left 0 right 0}

        # Directory Diff only supports one plugin.
................................................................................
            } else {
                set statusvar "$rightfull  ($count)"
            }

            $self Dlog Reschedule
            set AfterId [after $AfterTime [mymethod UpdateIdle]]
        } else {
            EndProf
            $self Dlog DONE
            set statusvar ""
            set AfterId ""
        }
    }

    method SetNodeStatus {node status} {







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<

<
<

<







 







<


<







 







<


<







 







<







 







<







46
47
48
49
50
51
52

























53
54
55
56
57
58
59
...
101
102
103
104
105
106
107

108


109

110
111
112
113
114
115
116
...
154
155
156
157
158
159
160

161
162

163
164
165
166
167
168
169
...
170
171
172
173
174
175
176

177
178

179
180
181
182
183
184
185
...
434
435
436
437
438
439
440

441
442
443
444
445
446
447
...
904
905
906
907
908
909
910

911
912
913
914
915
916
917
}

# Sort file names
proc Fsort {l} {
    lsort -dictionary $l
}


























# Compare two files or dirs
# Return true if equal
proc CompareFiles {file1 file2} {
    if {[catch {file lstat $file1 stat1}]} {
        return 0
    }
    if {[catch {file lstat $file2 stat2}]} {
................................................................................
    }

    switch $::Pref(dir,comparelevel) {
        2 -
        1 { # Check contents internally
            set bufsz 65536
            set eq 2 ;# 2 = equal this far, 1 = equal, 0 = not equal

            set ch1 [open $file1 r]


            set ch2 [open $file2 r]

            if {$::Pref(dir,comparelevel) == 2} {
                fconfigure $ch1 -translation binary
                fconfigure $ch2 -translation binary
            }
            # Allow a plugin to do its thing
            if {$anyPlugin} {
                #puts "PLUGIN!"
................................................................................
                } else {
                    if {![string equal $f1 $f2]} {
                        set eq 0
                    }
                }
            }
            while {$eq == 2 && ![eof $ch1] && ![eof $ch2]} {

                set f1 [read $ch1 $bufsz]
                set f2 [read $ch2 $bufsz]

                if {$nocase} {
                    if {![string equal -nocase $f1 $f2]} {
                        set eq 0
                    }
                } else {
                    if {![string equal $f1 $f2]} {
                        set eq 0
................................................................................
                    }
                }
            }
            if {$eq == 2 && (![eof $ch1] || ![eof $ch2])} {
                set eq 0
            }
            # Errors during close are not interesting

            catch {close $ch1}
            catch {close $ch2}

        }
    }
    return [expr {$eq != 0}]
}

# Returns the contents of a directory as a sorted list of full file paths.
proc DirContents {dir} {
................................................................................
            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.
................................................................................
            } else {
                set statusvar "$rightfull  ($count)"
            }

            $self Dlog Reschedule
            set AfterId [after $AfterTime [mymethod UpdateIdle]]
        } else {

            $self Dlog DONE
            set statusvar ""
            set AfterId ""
        }
    }

    method SetNodeStatus {node status} {