Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Allow directories to be created in directory diff. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
564e5775777716649b97cb231611c11b |
User & Date: | peter 2017-06-18 22:26:38.634 |
Context
2017-06-18
| ||
22:51 | Allow one side of directory diff to be protected from editing. [ff3da54573] check-in: 0095f5a716 user: peter tags: trunk | |
22:26 | Allow directories to be created in directory diff. check-in: 564e577577 user: peter tags: trunk | |
2017-03-31
| ||
12:55 | Variable size on commit window check-in: d544944776 user: peter tags: trunk | |
Changes
Changes to Changes.
1 2 3 4 5 6 7 | 2017-03-18 When needing an editor, try VISUAL and EDITOR plus a set of common ones. 2017-02-05 Bumped revision to 2.7.4 Handle multiple preprocess definitions that can be saved with preferences. | > > > | 1 2 3 4 5 6 7 8 9 10 | 2017-06-19 Allow directories to be created in directory diff. 2017-03-18 When needing an editor, try VISUAL and EDITOR plus a set of common ones. 2017-02-05 Bumped revision to 2.7.4 Handle multiple preprocess definitions that can be saved with preferences. |
︙ | ︙ |
Changes to src/dirdiff.tcl.
︙ | ︙ | |||
492 493 494 495 496 497 498 | if {$state} { $tree expandall } else { $tree collapseall } } | | < < | | < < | | < < | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > | 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | if {$state} { $tree expandall } else { $tree collapseall } } # Create a directory missing on one side method CreateDir {node to} { set lf [$tree rowattrib $node leftfull] set rf [$tree rowattrib $node rightfull] set parent [$tree parent $node] set lp [$tree rowattrib $parent leftfull] set rp [$tree rowattrib $parent rightfull] if {$to eq "right"} { set src $lf if {$rp ne ""} { set dst [file join $rp [file tail $src]] } else { return } } elseif {$to eq "left"} { set src $rf if {$lp ne ""} { set dst [file join $lp [file tail $src]] } else { return } } else { error "Bad from argument to CreateDir: $to" } if {[tk_messageBox -icon question -title "Create dir?" -message \ "Create\n$dst ?" -type yesno] eq "yes"} { file mkdir $dst # FIXA: update file info in tree too #$self SetNodeStatus $node equal } } # Copy a file from one directory to the other method CopyFile {node from} { if {$from eq "left"} { set to right } elseif {$from eq "right"} { set to left } else { error "Bad from argument to CopyFile: $from" } set fromf [$tree rowattrib $node ${from}full] set tof [$tree rowattrib $node ${to}full] set parent [$tree parent $node] set fromp [$tree rowattrib $parent ${from}full] set top [$tree rowattrib $parent ${to}full] set src $fromf if {$tof ne ""} { set dst $tof } else { # Go up until we find a common parent set dst [file tail $src] set Count 0 ;# Safety check while debugging while {$Count < 1000} { if {[incr Count] > 999} { error "Internal error in CopyFile $from" } if {$top ne ""} { set dst [file join $top $dst] break } # Continue up to a commmon parent set dst [file join [file tail $fromp] $dst] set parent [$tree parent $parent] set fromp [$tree rowattrib $parent ${from}full] set top [$tree rowattrib $parent ${to}full] } } if {[file exists $dst]} { if {[tk_messageBox -icon question -title "Overwrite file?" -message \ "Copy\n$src\noverwriting\n$dst ?" -type yesno] eq "yes"} { file copy -force $src $dst # FIXA: update file info in tree too $self SetNodeStatus $node equal } } else { set msg "Copy\n$src\nto\n$dst ?" set dstdir [file dirname $dst] if {![file isdirectory $dstdir]} { append msg "\nCreating Directory\n$dstdir ?" } if {[tk_messageBox -icon question -title "Copy file?" -message \ $msg -type yesno] eq "yes"} { if {![file isdirectory $dstdir]} { file mkdir $dstdir } file copy $src $dst # FIXA: update file info in tree too $self SetNodeStatus $node equal } } } |
︙ | ︙ | |||
614 615 616 617 618 619 620 | if {$lf ne "" && $rf ne ""} { # Directory, both exist $m add command -label "Go down" -command [mymethod \ newTopDir $lf $rf] } if {$lf ne ""} { # Directory, left exist | | | > > > > > | | > > > > > | 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | if {$lf ne "" && $rf ne ""} { # Directory, both exist $m add command -label "Go down" -command [mymethod \ newTopDir $lf $rf] } if {$lf ne ""} { # Directory, left exist $m add command -label "Go down left" -command \ [mymethod newTopDir $lf ""] if {$rf eq ""} { # Only left exist $m add command -label "Create Dir right" -command \ [mymethod CreateDir $node right] } } if {$rf ne ""} { # Directory, right exist $m add command -label "Go down right" -command \ [mymethod newTopDir "" $rf] if {$lf eq ""} { # Only right exist $m add command -label "Create Dir left" -command \ [mymethod CreateDir $node left] } } } if {$type eq "file"} { if {([string match left* $colname] || $oneside) && $lf ne ""} { $m add command -label "Copy File to Right" \ -command [mymethod CopyFile $node left] $m add command -label "Edit Left File" \ |
︙ | ︙ | |||
882 883 884 885 886 887 888 889 890 891 892 893 894 895 | $self SetNodeStatus $id unknown $self AddNodeToIdle $id } return [$tree rowattrib $id status] } method addCmdCol {tbl row col w} { set key [$tree getfullkeys $row] set status [$tree rowattrib $row status] set type [$tree rowattrib $row type] set lf [$tree rowattrib $row leftfull] set rf [$tree rowattrib $row rightfull] set bg [$tbl cget -background] ttk::style configure Apa.TFrame -background $bg | > | 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 | $self SetNodeStatus $id unknown $self AddNodeToIdle $id } return [$tree rowattrib $id status] } method addCmdCol {tbl row col w} { puts "addCmdCol $row $col" set key [$tree getfullkeys $row] set status [$tree rowattrib $row status] set type [$tree rowattrib $row type] set lf [$tree rowattrib $row leftfull] set rf [$tree rowattrib $row rightfull] set bg [$tbl cget -background] ttk::style configure Apa.TFrame -background $bg |
︙ | ︙ |