From: Boyuan Yang <byang@debian.org>
Date: Fri, 19 Apr 2024 21:40:39 -0400
Subject: Tweak tcl for debian setup

---
 tkrev/tkrev.tcl     |  7 +++++--
 tkrev/tkrev_def.tcl | 17 ++++++++---------
 tkrev/workdir.tcl   |  2 +-
 3 files changed, 14 insertions(+), 12 deletions(-)

--- a/tkrev/tkrev.tcl
+++ b/tkrev/tkrev.tcl
@@ -55,10 +55,13 @@ if {[info exists starkit::topdir]} {
     set TclRoot [pwd]
   }
   #puts "TclRoot $TclRoot"
   set TclRoot [file join [file dirname $TclRoot] "lib"]
   #puts "TclRoot $TclRoot"
+
+  # Override TclRoot for debian systems
+  set TclRoot /usr/share
   
   # allow runtime replacement
   if {[info exists env(TCLROOT)]} {
     set TclRoot $env(TCLROOT)
   }
@@ -113,12 +116,12 @@ if { [info exists env(USER)] } {
 set cvscfg(cvsroot) ""
 set cvscfg(svnroot) ""
 set cvscfg(gitroot) ""
 
 # Read in defaults
-if {[file exists [file join $TCDIR tkrev_def.tcl]]} {
-  source [file join $TCDIR tkrev_def.tcl]
+if {[file exists /etc/tkrev/tkrev_def.tcl]} {
+  source /etc/tkrev/tkrev_def.tcl
 }
 
 set optfile [file join $cvscfg(home) .tkrev]
 set old_optfile [file join $cvscfg(home) .tkcvs]
 if {[file exists $old_optfile] && ![file exists $optfile]} {
--- a/tkrev/tkrev_def.tcl
+++ b/tkrev/tkrev_def.tcl
@@ -99,14 +99,14 @@ set cvscfg(dateformat) "%Y-%m-%d %H:%M:%
 # Format for mergeto- and mergefrom- tags.  The _BRANCH_ part must be
 # left as-is, but you can change the prefix and the date format, for
 # example "mergeto_BRANCH_%d%b%y".  The date format must be the same
 # for both.
 # CVS rule: a tag must not contain the characters `$,.:;@'
-#set cvscfg(mergetoformat) "t_BRANCH_%d%b%y_%H-%M"
-#set cvscfg(mergefromformat) "f_BRANCH_%d%b%y_%H-%M"
-set cvscfg(mergetoformat) "mergeto_BRANCH_%d%b%y"
-set cvscfg(mergefromformat) "mergefrom_BRANCH_%d%b%y"
+#set cvscfg(mergetoformat) "t_BRANCH_%d%b%y"
+#set cvscfg(mergefromformat) "f_BRANCH_%d%b%y"
+set cvscfg(mergetoformat) "mergeto_BRANCH_%Y-%m-%d"
+set cvscfg(mergefromformat) "mergefrom_BRANCH_%Y-%m-%d"
 set cvscfg(mergetrunkname) "trunk"
 
 # The branch browser depends on the convention of having a trunk, branches, and
 # tags structure to draw the diagram.  These variables may give you a little
 # more flexibility.
@@ -150,11 +150,11 @@ set logcfg(arrowshape) { 6 6.7 3 }
 # It's in milliseconds and something in the 1.5-3 second range is
 # generally reasonable.
 set logcfg(draw_delay) 2000
 
 # Scaling options to offer user
-set logcfg(scaling_options) {50% 0.5 80% 0.8 90% 0.9 100% 1.0 120% 1.2 150% 1.5}
+set logcfg(scaling_options) {50% 0.5 80% 0.8 90% 0.9 100% 1.0 120% 1.2 150% 1.5 200% 2.0 250% 2.5}
 
 # User options for info display
 set logcfg(update_drawing) 2
 set logcfg(scale) 1.0
 set logcfg(show_tags) 1
@@ -206,15 +206,15 @@ if {$tcl_platform(platform) == "windows"
     #set cvscfg(tkdiff) "\"/Applications/TkDiff.app/Contents/MacOS/tkdiff\""
   } else {
     # Execution
     set cvscfg(terminal) "xterm -e"
     # Command shell
-    set cvscfg(shell) {xterm -name tkrevxterm -n {TkRev xterm}}
+    set cvscfg(shell) "x-terminal-emulator  -name {TkRev-shell} -n {TkRev-shell}"
     # To override the default editor (setup when tkrev is configured and
     # installed) a user can set the cvscfg(editor) variable to the editor
     # of choice in their .tkrev file
-    set cvscfg(editor) {xterm -e vi}
+    set cvscfg(editor) {x-terminal-emulator -name TkRev-editor-shell -n TkRev-editor-shell -e sensible-editor}
     #set cvscfg(print_cmd)          {enscript -Ghr -fCourier8}
     set cvscfg(print_cmd)          "lpr"
   }
   set cvscfg(tmpdir) "/tmp"
   set cvscfg(aster) "*"
@@ -223,11 +223,11 @@ if {$tcl_platform(platform) == "windows"
   # Other defaults
   #
   # Full path to the CVS program if you want to give it,
   # otherwise the PATH environment variable will be searched.
   set cvs "cvs"
-  set cvscfg(tkdiff) "tkdiff"
+  set cvscfg(tkdiff) "/usr/bin/tkdiff"
   # The file editor to be used may also be identified by pattern-matching the
   # filename by setting the cvscfg(editors) variable.  This contains a series
   # of string pairs giving the editor-command and string-match-pattern.  The
   # first pattern (see rules for [string match]) which matches the filename
   # going down the list determines which editor is run.  If no patterns match
--- a/tkrev/workdir.tcl
+++ b/tkrev/workdir.tcl
@@ -1494,11 +1494,11 @@ proc save_options { } {
   # remove obsolete settings
   if {[info exists cvscfg(editorargs)] } {
     if {$cvscfg(editorargs) != ""} {
       set cvscfg(editor) [concat $cvscfg(editor) $cvscfg(editorargs)]
     }
-    unset cvscfg(editorargs)
+    set cvscfg(editorargs) {}
   }
   if {[info exists cvscfg(gitsince)] } {
     unset cvscfg(gitsince)
   }
   
