common/SCMMergeToolStartup.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 19 Feb 2021 08:29:41 +0000
changeset 924 4d92f234f671
parent 909 993b38cb97dd
permissions -rw-r--r--
Rework and fix HGSourceCodeManager >> #revisionLogOf:...directory:module:` This commit changes the logic in two ways: 1. #newestRevision is now the newest revision in the branch that *contains* given file (not necesarily modidfes it). If there are multiple heads in that branch, pretty much random one is returned. This changes old behavior and therefore this commit updates tests. 2. If a specific single revision is requested, i.e., both from and to revisions are the same, revision log with that single revision is returned no matter whether it modifies the file or even contains that file at all. This is essentially a workaround to fix issue #305. Moreover, this commit simplifies the code a lot by delegating all the changeset searching and filtering to mercurial using revset expressions. See https://swing.fit.cvut.cz/projects/stx-jv/ticket/305#comment:3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
909
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     1
"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     2
COPYRIGHT (c) 2020 LabWare
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     3
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     4
stx:libscm - a new source code management library for Smalltalk/X
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     5
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     6
This library is free software; you can redistribute it and/or
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     7
modify it under the terms of the GNU Lesser General Public
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     8
License as published by the Free Software Foundation; either
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
     9
version 2.1 of the License. 
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    10
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    11
This library is distributed in the hope that it will be useful,
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    14
Lesser General Public License for more details.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    15
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    16
You should have received a copy of the GNU Lesser General Public
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    17
License along with this library; if not, write to the Free Software
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    19
"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    20
"{ Package: 'stx:libscm/common' }"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    21
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    22
"{ NameSpace: Smalltalk }"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    23
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    24
StandaloneStartup subclass:#SCMMergeToolStartup
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    25
	instanceVariableNames:''
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    26
	classVariableNames:''
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    27
	poolDictionaries:''
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    28
	category:'SCM-Common-StX-Tools'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    29
!
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    30
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    31
!SCMMergeToolStartup class methodsFor:'documentation'!
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    32
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    33
copyright
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    34
"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    35
COPYRIGHT (c) 2020 LabWare
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    36
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    37
stx:libscm - a new source code management library for Smalltalk/X
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    38
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    39
This library is free software; you can redistribute it and/or
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    41
License as published by the Free Software Foundation; either
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    42
version 2.1 of the License. 
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    43
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    44
This library is distributed in the hope that it will be useful,
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    47
Lesser General Public License for more details.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    48
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    50
License along with this library; if not, write to the Free Software
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    52
"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    53
!
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    54
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    55
documentation
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    56
"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    57
    documentation to be added.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    58
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    59
    [author:]
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    60
        Jan Vrany <jan.vrany@labware.com>
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    61
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    62
    [instance variables:]
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    63
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    64
    [class variables:]
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    65
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    66
    [see also:]
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    67
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    68
"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    69
! !
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    70
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    71
!SCMMergeToolStartup class methodsFor:'startup'!
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    72
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    73
main: argv
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    74
    "Application entry point. `argv` is the array of command arguments (as Array of Strings)"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    75
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    76
    | optparser positional base local other output |
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    77
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    78
    optparser := CmdLineParser new.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    79
    optparser
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    80
          on: #('-o' '--output') do:[ :o | output := o asFilename ];
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    81
          on: #('-h' '--help') do:[ self usage. Smalltalk exitIfStandalone:0 ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    82
    [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    83
        positional := optparser parse:argv.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    84
    ] on: CmdLineOptionError do:[:ex |
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    85
        Stderr nextPutLine: 'ERROR: '; nextPutLine: ex description.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    86
        Smalltalk exitIfStandalone:0.        
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    87
    ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    88
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    89
    positional size ~~ 3 ifTrue: [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    90
        Stderr nextPutLine: 'ERROR: Invalid invocation (see --help)'.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    91
        Smalltalk exitIfStandalone:1.        
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    92
    ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    93
    positional := positional collect: [:each | each asFilename ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    94
    positional do: [:each | 
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    95
        each isRegularFile ifFalse: [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    96
            Stderr nextPutLine: 'ERROR: No such file: ', each pathName.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    97
            Smalltalk exitIfStandalone:2.        
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    98
        ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
    99
        each isReadable ifFalse: [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   100
            Stderr nextPutLine: 'ERROR: File not readable: ', each pathName.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   101
            Smalltalk exitIfStandalone:2.        
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   102
        ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   103
    ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   104
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   105
    base := positional first.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   106
    local := positional second.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   107
    other := positional third.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   108
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   109
    output notNil ifTrue: [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   110
        (output exists and:[output isWritable not]) ifTrue: [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   111
            Stderr nextPutLine: 'ERROR: File not writable: ', output pathName.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   112
            Smalltalk exitIfStandalone:2.        
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   113
        ] ifFalse: [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   114
            output directory isWritable ifFalse: [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   115
                Stderr nextPutLine: 'ERROR: Directory not writable: ', output directory pathName.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   116
                Smalltalk exitIfStandalone:2.        
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   117
            ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   118
        ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   119
    ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   120
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   121
    [
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   122
        (SCMMergeTool new base: base local: local other: other output: output)
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   123
            ifTrue:[ Smalltalk exitIfStandalone:0 ]
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   124
            ifFalse:[ Smalltalk exitIfStandalone:3 ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   125
    ] on: Error do: [:ex |
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   126
        Stderr nextPutLine: 'ERROR: '; nextPutLine: ex description.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   127
        Smalltalk exitIfStandalone:4.        
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   128
    ].
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   129
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   130
    "
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   131
    SCMMergeToolStartup main: #('file.txt.base' 'file.txt' 'file.txt.other')
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   132
    SCMMergeToolStartup main: #('file.txt.base' 'file.txt')
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   133
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   134
    SCMMergeToolStartup main: #(
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   135
    '-o' '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/LargeFloat.st'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   136
         '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/LargeFloat.st.base'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   137
         '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/LargeFloat.st.local'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   138
         '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/LargeFloat.st.other')
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   139
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   140
    SCMMergeToolStartup main: #(
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   141
    '-o' '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/Smalltalk.st'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   142
         '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/Smalltalk.st.base'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   143
         '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/Smalltalk.st.local'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   144
         '/home/jv/Projects/SmalltalkX/sources/merge-with-exept/build/stx/libbasic/Smalltalk.st.other')
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   145
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   146
    "
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   147
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   148
    "Modified: / 27-08-2020 / 09:59:00 / Jan Vrany <jan.vrany@labware.com>"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   149
!
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   150
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   151
usage
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   152
    "output some command-line usage infos on stderr"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   153
    
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   154
    Stderr nextPutLine:'usage: ',self applicationName,' [-o OUTPUT] BASE LOCAL OTHER'.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   155
    Stderr nextPutLine:'  -h | --help .......... output this message'.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   156
    Stderr nextPutLine:'  -o | --output OUTPUT . save merge to OUTPUT'.
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   157
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   158
    "Modified: / 27-08-2020 / 09:41:34 / Jan Vrany <jan.vrany@labware.com>"
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   159
! !
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   160
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   161
!SCMMergeToolStartup class methodsFor:'documentation'!
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   162
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   163
version_HG
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   164
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   165
    ^ '$Changeset: <not expanded> $'
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   166
! !
993b38cb97dd Introduce `SCMMergeTool` - a merge tool for Smalltalk/X source files
Jan Vrany <jan.vrany@labware.com>
parents:
diff changeset
   167