Eskil

Check-in [be2d8c443d]
Login

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

Overview
Comment:Handle GIT revisions better for directory diff.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: be2d8c443df87151950a7a617723fc82ce25891a6a99a001eacf0da130e51def
User & Date: peter 2017-12-06 23:15:50.143
Context
2017-12-07
16:57
Support -nocase in dirdiff. Repaired plugins for dirdiff (broken by multi plugin). check-in: 9379b0b64f user: peter tags: trunk
2017-12-06
23:15
Handle GIT revisions better for directory diff. check-in: be2d8c443d user: peter tags: trunk
2017-12-04
23:35
Corrected release files check-in: 0d353fdadd user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Changes.



1
2
3
4
5
6
7



2017-12-05
 Bumped revision to 2.8.0

2017-12-04
 Support multiple plugins from command line.

2017-12-02
>
>
>







1
2
3
4
5
6
7
8
9
10
2017-12-07
 Handle GIT revisions better for directory diff.
 
2017-12-05
 Bumped revision to 2.8.0

2017-12-04
 Support multiple plugins from command line.

2017-12-02
Changes to src/rev.tcl.
659
660
661
662
663
664
665



666
667
668
669
670
671
672

673
674
675
676
677
678
679

# Return revision list of a GIT file
proc eskil::rev::GIT::GetRevList {filename} {
    set old ""
    set cmd [list exec git log --first-parent --oneline -n 50]
    if {$filename eq ""} {
        # Nothing



    } else {
        set old [pwd]
        cd [file dirname $filename]
        lappend cmd [file nativename [file tail $filename]]
    }
    if {[catch {eval $cmd} res]} {
        # What to do here?

        set revs [list HEAD]
    } else {
        set lines [split $res \n]
        set revs {}
        foreach line $lines {
            if {[regexp {^(\w+)} $line -> rev]} {
                lappend revs $rev







>
>
>







>







659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683

# Return revision list of a GIT file
proc eskil::rev::GIT::GetRevList {filename} {
    set old ""
    set cmd [list exec git log --first-parent --oneline -n 50]
    if {$filename eq ""} {
        # Nothing
    } elseif {[file isdirectory $filename]} {
        set old [pwd]
        cd $filename
    } else {
        set old [pwd]
        cd [file dirname $filename]
        lappend cmd [file nativename [file tail $filename]]
    }
    if {[catch {eval $cmd} res]} {
        # What to do here?
        puts "ERROR for '$filename' $res"
        set revs [list HEAD]
    } else {
        set lines [split $res \n]
        set revs {}
        foreach line $lines {
            if {[regexp {^(\w+)} $line -> rev]} {
                lappend revs $rev
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
    foreach rev $revs {
        # Special cases that shortcuts to GIT special names
        if {$rev eq "_" || $rev eq "0"} {set rev HEAD}

        if {[string is integer -strict $rev] && $rev < 0} {
            # A negative integer rev is a relative rev
            set revList [eskil::rev::GIT::GetRevList $filename]

            set rev [lindex $revList [- $rev]]
            if {$rev eq ""} {
                set rev [lindex $revs end]
            }
        }
        # Let anything else through
        lappend result $rev







|







767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
    foreach rev $revs {
        # Special cases that shortcuts to GIT special names
        if {$rev eq "_" || $rev eq "0"} {set rev HEAD}

        if {[string is integer -strict $rev] && $rev < 0} {
            # A negative integer rev is a relative rev
            set revList [eskil::rev::GIT::GetRevList $filename]
            
            set rev [lindex $revList [- $rev]]
            if {$rev eq ""} {
                set rev [lindex $revs end]
            }
        }
        # Let anything else through
        lappend result $rev