-set next_browser_id 0
-
-proc show_blame {commit path} {
- global next_browser_id blame_status blame_data
-
- if {[winfo ismapped .]} {
- set w .browser[incr next_browser_id]
- set tl $w
- toplevel $w
- } else {
- set w {}
- set tl .
- }
- set blame_status($w) {Loading current file content...}
+class blame {
+
+field commit ; # input commit to blame
+field path ; # input filename to view in $commit
+
+field w
+field w_line
+field w_load
+field w_file
+field w_cmit
+field status
+
+field highlight_line -1 ; # current line selected
+field highlight_commit {} ; # sha1 of commit selected
+
+field total_lines 0 ; # total length of file
+field blame_lines 0 ; # number of lines computed
+field commit_count 0 ; # number of commits in $commit_list
+field commit_list {} ; # list of commit sha1 in receipt order
+field order ; # array commit -> receipt order
+field header ; # array commit,key -> header field
+field line_commit ; # array line -> sha1 commit
+field line_file ; # array line -> file name
+
+field r_commit ; # commit currently being parsed
+field r_orig_line ; # original line number
+field r_final_line ; # final line number
+field r_line_count ; # lines in this region
+
+constructor new {i_commit i_path} {
+ set commit $i_commit
+ set path $i_path
+
+ make_toplevel top w
+ wm title $top "[appname] ([reponame]): File Viewer"
+ set status "Loading $commit:$path..."