⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rcs.tcl

📁 This Source-Navigator, an IDE for C/C++/Fortran/Java/Tcl/PHP/Python and a host of other languages.
💻 TCL
📖 第 1 页 / 共 2 页
字号:
        }        if {![info exists sn_verctl_options(${rcstype},unlock)] || ![info\          exists sn_verctl_options(${rcstype},unlock-individual)]} {            ${menu} entryconfig 5 -state disabled        }        if {![info exists\          sn_verctl_options(${rcstype},checkout-individual-to-stdout)]} {            ${menu} entryconfig 7 -state disabled        }    }    method open_view {view} {        set active 1        sn_change_view ${view}        Refresh    }    method log_revision {{rev ""}} {        # called from a combo box at the top right of the history window        # to display revision log information        set rev [string trim ${rev}]        if {[string compare ${rev} [get_indep String All]] == 0} {            # ok, display something about all revisions            set rev ""        }        set files ""        foreach f [${selected_list} marked] {            lappend files [lindex ${f} 0]        }        if {[string compare ${files} ""] != 0} {            # there are selected files, so go on and show the log information            ${this} show_log ${files} ${rcs_hist_show} ${rcs_symb_show} 1 ${rev}        }    }    method check_in_out {cmd} {        set files [source_file_names [${selected_list} marked]]        if {${files} == ""} {            return        }        # Block the UI while running the command.        tixBusy $itk_component(hull) on        switch ${cmd} {            "ci" {                    sn_rcs_checkin ${files}                }            "co" {                    sn_rcs_checkout ${files}                }            "unco" {                    sn_rcs_discard ${files}                }            "lock" {                    sn_rcs_lockunlockdel lock ${files}                }            "unlock" {                    sn_rcs_lockunlockdel unlock ${files}                }            "del" {                    sn_rcs_lockunlockdel del ${files}                }        }        # Release the UI back to the user.        tixBusy $itk_component(hull) off    }    method hist_show_name {} {        return ${rcs_hist_show}    }    method symb_show_name {} {        return ${rcs_symb_show}    }    proc refresh {files} {        load_again ${files}        set objects [itcl_info objects "*" -class [info class]]        foreach obj ${objects} {            # $obj append_lock_info $files            set show [${obj} hist_show_name]            set symb [${obj} symb_show_name]            ${obj} show_log [lindex ${files} 0] ${show} ${symb}        }    }    proc load_again {files} {        sn_parse_uptodate ${files}    }    method edit_file {} {        set name [lindex [${selected_list} get active] 0]        sn_edit_file dummy ${name}    }    method diff {} {        set o_files [source_file_names [${selected_list} marked]]        sn_rcs_diff ${this} ${o_files}    }    method toggle_show {} {         set file_list $itk_option(-input)        set state normal        set load_state disabled        ${selected_list} selection clear 0 end        ${rcs_hist_top}.r configure -contents {}        ${selected_list} activate end    }    #---------------------------------------------------------------------    # modifies the display of the file list by appending    # information about locked revisions and who locked them    # Parameters: files	   = a list of files to get information for    #---------------------------------------------------------------------    method append_lock_info {files} {        global sn_options    }    protected variable file_list    proc source_file_names {files} {        set fls ""        foreach f ${files} {            lappend fls [lindex ${f} 0]        }        return ${fls}    }    method show_log {file log sym {bsy 0} {rev ""}} {        # display information in the history window        global ${this}-history        set file [lindex ${file} 0]        # Block UI while we get the log info.        tixBusy $itk_component(hull) on        # set the title string of the history window        set hist_lb [get_indep String ChooseHistory]        # get the information of the file        set error [catch {sn_rcs_get_revisions ${file} ${rev} sy rv lg 0} ret]        # clean the tags and history windows        ${log} delete 0 end        ${sym} delete 0 end        if {!${error} && ${ret}} {            # lg   = log text            # sy   = symbol text            # rv   = list of existing revisions for $file            # 0	= no busy flag            set rv [linsert ${rv} 0 [get_indep String All]]            # insert the log information into the history window            eval ${log} insert end ${lg}            eval ${sym} insert end ${sy}            if {${rev} != ""} {                set curs end            } else {                set curs 0            }            ${log} see ${curs}            ${sym} see ${curs}            append hist_lb " " ${file}        } else {            # there were no rcs information, make check in possible            set rv ""        }        # finally display the results:        set ${this}-history ${hist_lb}        if {${rev} == ""} {            ${rcs_hist_top}.r configure -contents ${rv}        }        # Release UI back to user.        tixBusy $itk_component(hull) off    }    method locking {} {        return ${locking}    }    # Here you should read the value of 'locking' from a global    # variable of the project. Having it set to 0 is not desireable.    common locking 1    itk_option define -input input Input {} {        if {[winfo exists ${selected_list}]} {            ${selected_list} setSelectorContents $itk_option(-input)        }    }    method Take {{bsy 1} {nodisable ""}} {        global ${this}-value        if {${bsy}} {            ${this} grab set        }        tkwait variable ${this}-value        if {[catch {set ret [set ${this}-value]}]} {            set ret "cancel"        }        if {${bsy}} {            catch {${this} grab release}        }        itcl::delete object ${this}        return ${ret}    }    method active {{val -1}} {        if {${val} != -1} {            set active ${val}        }        return ${active}    }    method Refresh {} {        ${this} configure -input [sn_project_file_list 0]        set file_list $itk_option(-input)         set active 0        ${selected_list} setSelectorContents [sn_project_file_list 0]        toggle_show    }    proc Refresh_YourSelf {} {        foreach prj [itcl_info objects "*" -class RevisionCtrl&] {            if {! [${prj} active]} {                ${prj} open_view default            }        }    }    public variable ovr ""    protected variable ok    protected variable files_to_unload ""    protected variable selected_list ""    protected variable rcs_hist_top    protected variable rcs_hist_show    protected variable rcs_symb_top    protected variable rcs_symb_show    protected variable active 0}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -