Eskil

Diff
Login

Differences From Artifact [19b6a9139f]:

To Artifact [55d383e3c2]:


405
406
407
408
409
410
411










412
413
414
415
416
417
418
    return $cmd
}

# Get a SVN patch
proc eskil::rev::SVN::getPatch {revs files {fileListName {}}} {
    set cmd [list exec svn diff]
    lappend cmd {*}[RevsToCmd $revs]










    lappend cmd {*}$files

    if {[catch {eval $cmd} res]} {
        tk_messageBox -icon error -title "SVN error" -message $res
        return ""
    }
    if {$fileListName ne ""} {







>
>
>
>
>
>
>
>
>
>







405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
    return $cmd
}

# Get a SVN patch
proc eskil::rev::SVN::getPatch {revs files {fileListName {}}} {
    set cmd [list exec svn diff]
    lappend cmd {*}[RevsToCmd $revs]
    set ext {}
    if {$::Pref(context) >= 0} {
        lappend ext --context $::Pref(context)
    }
    if {$::Pref(ignore) in "-w -b"} {
        lappend ext $::Pref(ignore)
    }
    if {[llength $ext] > 0} {
        lappend cmd -x $ext
    }
    lappend cmd {*}$files

    if {[catch {eval $cmd} res]} {
        tk_messageBox -icon error -title "SVN error" -message $res
        return ""
    }
    if {$fileListName ne ""} {
613
614
615
616
617
618
619






620
621
622
623
624
625
626
    GetTopDir $filename dir tail
    catch {execDir $dir git add $tail}
}

# Get a GIT patch
proc eskil::rev::GIT::getPatch {revs files {fileListName {}}} {
    set cmd [list exec git diff -p]






    if {[llength $revs] == 0} {
        # Always default to HEAD to see changes regardless of index
        lappend cmd HEAD
    } else {
        foreach rev $revs {
            lappend cmd $rev
        }







>
>
>
>
>
>







623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
    GetTopDir $filename dir tail
    catch {execDir $dir git add $tail}
}

# Get a GIT patch
proc eskil::rev::GIT::getPatch {revs files {fileListName {}}} {
    set cmd [list exec git diff -p]
    if {$::Pref(context) >= 0} {
        lappend cmd -U$::Pref(context)
    }
    if {$::Pref(ignore) in "-w -b"} {
        lappend cmd $::Pref(ignore)
    }
    if {[llength $revs] == 0} {
        # Always default to HEAD to see changes regardless of index
        lappend cmd HEAD
    } else {
        foreach rev $revs {
            lappend cmd $rev
        }
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
        foreach line [lsearch -all -inline -regexp [split $res \n] {^diff -}] {
            if {[regexp { a/(.*) b/} $line -> fn]} {
                lappend fileList $fn
            }
        }
        set fileList [lsort -dictionary -unique $fileList]
    }
    
    return $res
}

# Get a GIT change set
proc eskil::rev::GIT::getChangedFiles {dir revs} {
    set cmd [list execDir $dir git diff --name-only]
    if {[llength $revs] == 0} {







|







655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
        foreach line [lsearch -all -inline -regexp [split $res \n] {^diff -}] {
            if {[regexp { a/(.*) b/} $line -> fn]} {
                lappend fileList $fn
            }
        }
        set fileList [lsort -dictionary -unique $fileList]
    }

    return $res
}

# Get a GIT change set
proc eskil::rev::GIT::getChangedFiles {dir revs} {
    set cmd [list execDir $dir git diff --name-only]
    if {[llength $revs] == 0} {
691
692
693
694
695
696
697







698
699
700
701
702
703
704
        lappend cmd --from [lindex $revs 0]
    }
    if {[llength $revs] >= 2} {
        lappend cmd --to [lindex $revs 1]
    }
    # Include added files contents
    lappend cmd -N








    lappend cmd {*}$files

    if {[catch {eval $cmd} res]} {
        tk_messageBox -icon error -title "FOSSIL error" -message $res
        return ""
    }







>
>
>
>
>
>
>







707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
        lappend cmd --from [lindex $revs 0]
    }
    if {[llength $revs] >= 2} {
        lappend cmd --to [lindex $revs 1]
    }
    # Include added files contents
    lappend cmd -N

    if {$::Pref(context) >= 0} {
        lappend cmd --context $::Pref(context)
    }
    if {$::Pref(ignore) in "-w -b"} {
        lappend cmd -w
    }

    lappend cmd {*}$files

    if {[catch {eval $cmd} res]} {
        tk_messageBox -icon error -title "FOSSIL error" -message $res
        return ""
    }