CVSSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Mon, 25 Feb 2002 20:58:35 +0100
changeset 1138 aa7687ec256f
parent 1136 6ebfad528813
child 1141 9f0bd4f3d482
permissions -rw-r--r--
implements -> includesSelector
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     1
"
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     2
 COPYRIGHT (c) 1995 by Claus Gittinger
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
     3
              All Rights Reserved
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     4
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     5
 This software is furnished under a license and may be used
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     6
 only in accordance with the terms of that license and with the
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     8
 be provided or otherwise made available to, or used by, any
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
     9
 other person.  No title to or ownership of the software is
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    10
 hereby transferred.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    11
"
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    12
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
    14
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    15
AbstractSourceCodeManager subclass:#CVSSourceCodeManager
811
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
    16
	instanceVariableNames:''
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
    17
	classVariableNames:'Verbose CVSRoot CVSWorkDirectory RemoteCVS CVSBinDir
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
    18
		CVSModuleRoots CMD_checkout CVSTempDir DisabledModules'
811
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
    19
	poolDictionaries:''
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
    20
	category:'System-SourceCodeManagement'
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    21
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    22
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
    23
!CVSSourceCodeManager class methodsFor:'documentation'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    24
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    25
copyright
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    26
"
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    27
 COPYRIGHT (c) 1995 by Claus Gittinger
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
    28
              All Rights Reserved
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    29
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    30
 This software is furnished under a license and may be used
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    31
 only in accordance with the terms of that license and with the
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    33
 be provided or otherwise made available to, or used by, any
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    34
 other person.  No title to or ownership of the software is
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    35
 hereby transferred.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    36
"
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    37
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    38
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    39
documentation
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    40
"
134
f5a8ddd00d66 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 133
diff changeset
    41
    SourceCodeManager which accesses the sourcecode through cvs.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    42
    It requires the shell environment variable CVSROOT to be set
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
    43
    to the top of the repository tree. (or alternatively, the CVSRoot
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
    44
    variable being set by a private.rc file).
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
    45
    Under that top, for each module (especially the stx module itself), 
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
    46
    a subdirectory containing that modules directories must exist.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    47
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    48
    If not specified otherwise, the module defaults to 'stx'. 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    49
    If a class has its home in another module, it has to be compiled
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    50
    with a corresponding entry in the package string (see below).
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    51
    Within a module, classes are organized in classlibraries, and the corresponding
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    52
    source code is found in various subdirectories of CVSROOT. The directories
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    53
    name can also be provided by the package string - if not, it defaults to the
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    54
    libraries name.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    55
    The package string controls all this, and is REQUIRED in order for the sourceCodeManager
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    56
    to be able to retrieve a classes source.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    57
    The package strings format is:
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    58
        '...any infotext....(sourceCodeInfo)'
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    59
    the sourceCOdeInfo consists of multiple entries, separated by colons.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    60
    The following formats are allowed:
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    61
        (libraryName)                   - module defaults to 'stx'; directory to the name of the library
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    62
        (foo/bar/x)                     - module defaults to 'stx'; dir is 'foo/bar/x'; library name defaults to x
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    63
        (module:directory:libname)      - specifies all components
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    64
    The first formats are intermediate, for backward compatibility. We urge everyone
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    65
    to use the last format (by changing the Make.proto files and add a -P flag to
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    66
    the stc compiler flags (see libbasic/Make.proto as an example).
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    67
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    68
    Notice, that the sourceCodeManager is (currently) only consulted, if no
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    69
    source subdirectory exists, or no source file is found there. If it does exist,
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    70
    that one is supposed to contain an up-to-date version of the classes source
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    71
    (this is temporary - in the future the probe order will be reversed, trying
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    72
     the source repository first).
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    73
    The source directory is required for systems which do NO source code control.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    74
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    75
    Setup:
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    76
        - make certain, that the commands 'cvs' and 'co' are available on your system.
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    77
        - add setup for the CVSROOT environment variable to your .bashrc / .login / .profile
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    78
        - Make certain that either no local source directory exists, or it is empty or it contains
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    79
          only source code for files NOT found in the repository (this will not be required in future versions).
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    80
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
    81
    Caveat:
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    82
        currently, the rcs container is accessed directly, since cvs mangles the files ident-string and
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    83
        thus does not correctly recreate the original file (all source is offset by some characters w.r.t. the
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    84
        compiled file).
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    85
        Therefore, sevrer-mode CVS is not supported.
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
    86
680
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    87
    [class variables:]
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    88
        CVSTempDir      <String | nil>  where a directory tree is
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    89
                                        generated temporarily for checkin/checkout
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    90
                                        (default is nil -> current dir)
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    91
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    92
        CVSRoot         <String>        the CVS root. Imported from the
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    93
                                        CVSROOT shell variable.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    94
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    95
        RemoteCVS       <Boolean>       if true, remote CVS access is used
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    96
                                        (i.e. via a socket to a CVS server).
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    97
                                        if false, disk access is used;
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    98
                                        files in CVSRoot must be accessable.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
    99
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   100
        CVSWorkDirectory                not yet supported/implemented.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   101
                                        PLANNED: name of a directory hierarchy,
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   102
                                        which is kept in sync with the current
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   103
                                        version.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   104
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   105
        CVSBinDir                       where the CVS commands are found
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   106
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   107
        CVSModuleRoots  <Directory>     per-module roots.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   108
                                        If empty, or no entry is found for a
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   109
                                        module is found, CVSRoot is used.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   110
                                        Otherwise, specifies a per-module CVSRoot.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   111
                                        (allows multiple CVS hierarchies)
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   112
236
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
   113
    [author:]
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
   114
        Claus Gittinger
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
   115
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
   116
    [see also:]
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
   117
        ( cvs manual page :man: cvs )
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
   118
        ( Coding style used in Smalltalk/X classes :html: programming/codingStyle.html )
7f570e0a0a75 documentation
Claus Gittinger <cg@exept.de>
parents: 224
diff changeset
   119
433
273920a11e41 sourceCodeManagement is only enabled in the commercial release
Claus Gittinger <cg@exept.de>
parents: 380
diff changeset
   120
    [restrictions:]
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   121
        commercial version only
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   122
"
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   123
!
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   124
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   125
examples
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   126
"
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   127
    Default setup:
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   128
        This setup accesses all sources from a single repository: /files/CVS.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   129
        Actually, this is the setup as used within eXept for development.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   130
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   131
            CVSSourceCodeManager initializeForRepository:'/files/CVS'.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   132
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   133
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   134
    Dual repository setup:
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   135
        This accesses all ST/X standard classes' source from the /files/CVS
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   136
        repository, while your private classes are created in and accessed from
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   137
        '/files/myCVS'.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   138
        This setup is useful, if you need revision management on the
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   139
        ST/X standard classes as well as for your own classes.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   140
        In order to do this, you should (manually) check in all ST/X classes
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   141
        into a private repository WHILE preserving the original revision numbers.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   142
        A shell-procedure similar to:
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   143
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   144
            for i in lib*/*.st
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   145
            do
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   146
                id=`ident $i`
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   147
                set $id
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   148
                rev=$3
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   149
                ci -r$rev <CVSDIR>/$i $i
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   150
            done
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   151
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   152
        should acomplish this.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   153
        Now, that you have all ST/X files in your own repository (and with the
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   154
        original revision numbers), access is possible by defining CVSROOT
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   155
        as above. However, in order to have your own files being stored in
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   156
        another repository, you have to give a per-module repository.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   157
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   158
        This defines the default repository (for your containers):
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   159
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   160
            CVSSourceCodeManager initializeForRepository:'/files/myCVS'.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   161
657
5f2bf7de1c35 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 655
diff changeset
   162
        and this specifies a repository for all standard ST/X classes (in the stx module):
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   163
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   164
            CVSSourceCodeManager repositoryName:'/files/CVS' forModule:'stx'
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   165
1023
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   166
    Dual repository setup for eXept customers with a full licence
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   167
    (these can access our in-house master repository, for convenient software update
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   168
     and uploading):
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   169
        All class sourcees under the 'stx' module (i.e. packageID is 'stx:*') can be accessed
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   170
        from the eXept cvs server (i.e. CVSROOT for them is :pserver:userName@exept.de:/files/CVS/stc).
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   171
        All local classes should be maintained in and accessed from a local cvs repository
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   172
        such as '/files/myCVS'.
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   173
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   174
        Then, tell the CVSSourceCodeManager about this;
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   175
        first the default repository:
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   176
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   177
            CVSSourceCodeManager initializeForRepository:'/files/myCVS'.
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   178
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   179
        and the repository for all standard ST/X classes (in the stx module):
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   180
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   181
            CVSSourceCodeManager repositoryName:':pserver:userName@exept.de:/files/CVS' forModule:'stx'
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   182
"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   183
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   184
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
   185
!CVSSourceCodeManager class methodsFor:'initialization'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   186
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   187
forgetDisabledModules
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   188
    DisabledModules := nil.
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   189
!
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   190
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   191
initCommands
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   192
    CMD_checkout := 'cvs -n checkout %1'.
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   193
!
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
   194
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   195
initialize
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   196
    "check if $CVSROOT (the shell variable) or CVSRoot (the smalltalk global)
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   197
     is set, check if cvs commands can be executed and install myself as the
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   198
     SourceCodeManager if this works out ok"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   199
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   200
    | s f top ok triedPath cvsCmd cmdName |
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 157
diff changeset
   201
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   202
    DisabledModules := nil.
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   203
680
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   204
    "/ where a temporary directory hierarchy is
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   205
    "/ created for checkin/checkout
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   206
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   207
    CVSTempDir ifNil:[ 
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   208
        CVSTempDir := Filename tempDirectory pathName 
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   209
    ].
680
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   210
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   211
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   212
    "/ if CVSROOT is non-empty and both cvs and co are available
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   213
    "/ as commands, assume this system uses a cvs source code management.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   214
    "/
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   215
    CVSRoot ifNil:[
445
c085b7d46bc8 added access to CVSRoot directory (can now be set late in the private.rc file)
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   216
        CVSRoot := OperatingSystem getEnvironment:'CVSROOT'
c085b7d46bc8 added access to CVSRoot directory (can now be set late in the private.rc file)
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   217
    ].
c085b7d46bc8 added access to CVSRoot directory (can now be set late in the private.rc file)
Claus Gittinger <cg@exept.de>
parents: 433
diff changeset
   218
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   219
    CVSRoot ifNil:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   220
        'CVSSourceCodeManager [info]: disabled since $CVSROOT is not set' infoPrintCR.
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   221
        ^ self
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   222
    ].
489
c3c3e7fe3584 check for 'co' and 'rlog' commands. Give a message if not present.
Claus Gittinger <cg@exept.de>
parents: 488
diff changeset
   223
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   224
    OperatingSystem isMSDOSlike ifTrue:[
1124
1336e6ac4749 *** empty log message ***
bg
parents: 1123
diff changeset
   225
        cvsCmd := 'cvs'
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   226
    ] ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   227
        cvsCmd := 'cvs'
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   228
    ].
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   229
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   230
    CVSBinDir size > 0 ifTrue:[
1116
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   231
        OperatingSystem isMSDOSlike ifTrue:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   232
            cmdName := CVSBinDir asFilename constructString:cvsCmd.
1116
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   233
            (OperatingSystem canExecuteCommand:cmdName) ifFalse:[
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   234
                CVSBinDir := ''.
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   235
            ] ifTrue:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   236
                CVSBinDir := CVSBinDir asFilename pathName
1116
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   237
            ]
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   238
        ]
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   239
    ].
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   240
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   241
    CVSBinDir size == 0 ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   242
        CVSBinDir := ''.
1123
89bff6c2b033 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1119
diff changeset
   243
        (ok := OperatingSystem canExecuteCommand:cvsCmd) ifFalse:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   244
            "/ mhmh - no cvs;
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   245
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   246
            OperatingSystem isUNIXlike ifTrue:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   247
                triedPath := #( '/usr/local/bin' ).
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   248
            ] ifFalse:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   249
                OperatingSystem isMSDOSlike ifTrue:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   250
                    triedPath := Array with:'c:\bin'
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   251
                                        with:(Filename currentDirectory pathName)
1124
1336e6ac4749 *** empty log message ***
bg
parents: 1123
diff changeset
   252
                                        with:(OperatingSystem stxBinDirPath ? 'c:\windows').
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   253
                ] ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   254
                    triedPath := #()
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   255
                ]
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   256
            ].
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   257
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   258
            triedPath do:[:eachTriedDir |
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   259
                ok ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   260
                    (OperatingSystem canExecuteCommand:(eachTriedDir asFilename constructString:cvsCmd)) ifTrue:[
811
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
   261
                        ok := true.
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   262
                        CVSBinDir := eachTriedDir.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   263
                    ]
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   264
                ]
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   265
            ].
595
73cca1ff3252 added a hook to specify the cvs-binary directory
Claus Gittinger <cg@exept.de>
parents: 578
diff changeset
   266
        ].
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   267
    ] ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   268
        ok := OperatingSystem canExecuteCommand:(CVSBinDir asFilename constructString:cvsCmd).
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   269
    ].
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   270
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   271
    ok ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   272
        'CVSSourceCodeManager [warning]: disabled since no >> cvs << command found' infoPrintCR.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   273
        ^ self
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   274
    ].
701
8a82b708ddfd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
   275
748
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   276
"/    (OperatingSystem canExecuteCommand:(CVSBinDir , 'co')) ifFalse:[
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   277
"/        'CVSSourceCodeManager [warning]: limited functionality - no >> co << command found' infoPrintCR.
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   278
"/    ].
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   279
"/    (OperatingSystem canExecuteCommand:(CVSBinDir , 'rlog')) ifFalse:[
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   280
"/        'CVSSourceCodeManager [warning]: limited functionality - no >> rlog << command found' infoPrintCR.
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   281
"/    ].
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   282
"/    (OperatingSystem canExecuteCommand:(CVSBinDir , 'patch')) ifFalse:[
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   283
"/        'CVSSourceCodeManager [warning]: limited functionality - no >> patch << command found' infoPrintCR.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   284
"/    ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   285
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   286
    RemoteCVS := true.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   287
    UseWorkTree := false.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   288
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   289
    CacheDirectoryName ifNil:[
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   290
        self initCacheDirPath.
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   291
    ].
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   292
    CachingSources ifNil:[
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   293
        CachingSources := true.
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   294
    ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   295
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   296
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   297
    "/ check if there is an stx directory there
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   298
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   299
    ((f := CVSRoot asFilename) exists 
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   300
    and:[f isDirectory
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   301
    and:[(top := f construct:'stx') exists
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   302
    and:[top isDirectory
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   303
    and:[top isReadable]]]]) ifTrue:[
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   304
        RemoteCVS := false
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   305
    ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   306
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   307
    Smalltalk at:#SourceCodeManager put:self.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   308
    DefaultManager := self.    
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   309
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   310
    ('CVSSourceCodeManager [info]: repository CVSROOT is ''' , CVSRoot , '''.') infoPrintCR.
608
3e40ceddd8d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
   311
    RemoteCVS ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   312
        'CVSSourceCodeManager [info]: assume remote CVS mode (no stx found in CVSROOT)' infoPrintCR.
608
3e40ceddd8d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
   313
        ^ self
3e40ceddd8d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
   314
    ].
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   315
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   316
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   317
    "/ optionally set the WorkTreeDirectoryName from $STX_WORKTREE;
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   318
    "/ if non-nil, a working tree is kept there
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   319
    "/ and updated/commited files are not removed.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   320
    "/ If you use a regular (make-) tree, 
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   321
    "/ set WorkTreeDirectoryName (or the environment variable) to that.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   322
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   323
    "/ this is not yet finished.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   324
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   325
    s := OperatingSystem getEnvironment:'STX_WORKTREE'.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   326
    s notNil ifTrue:[
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   327
        WorkTreeDirectoryName := s.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   328
        UseWorkTree := true.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   329
    ]
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   330
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   331
    "
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 157
diff changeset
   332
     AbstractSourceCodeManager initialize
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   333
     CVSSourceCodeManager initialize
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   334
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   335
527
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   336
    "
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   337
     CVSRoot := '/files/CVS'.
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   338
     AbstractSourceCodeManager initialize.
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   339
     CVSSourceCodeManager initialize.
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   340
    "
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   341
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   342
    "Created: / 4.11.1995 / 19:14:38 / cg"
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   343
    "Modified: / 19.12.1995 / 14:25:46 / stefan"
1124
1336e6ac4749 *** empty log message ***
bg
parents: 1123
diff changeset
   344
    "Modified: / 5.12.2001 / 18:52:00 / cg"
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   345
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   346
602
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   347
initializeForRepository:aDirectoryName
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   348
    "set the global CVSROOT directory (i.e. the repositories name).
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   349
     And reinitialize. 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   350
     Can be used from the launcher to change/configure the repository."
602
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   351
620
084fd1b48952 #cvsRootDirectory replaced by #repositoryName.
Stefan Vogel <sv@exept.de>
parents: 618
diff changeset
   352
    self repositoryName:aDirectoryName.
602
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   353
    AbstractSourceCodeManager initialize.
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   354
    CVSSourceCodeManager initialize.
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   355
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   356
    "
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   357
     CVSSourceCodeManager initializeForRepository:'/files/CVS'
630
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   358
     CVSSourceCodeManager initializeForRepository:'ibm:/files/CVS'
602
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   359
    "
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   360
630
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   361
    "Created: / 13.8.1997 / 17:20:57 / cg"
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   362
    "Modified: / 25.9.1997 / 12:28:05 / stefan"
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   363
    "Modified: / 2.11.1997 / 17:08:27 / cg"
603
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   364
! !
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   365
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   366
!CVSSourceCodeManager class methodsFor:'accessing'!
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   367
1116
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   368
cvsBinDirectory
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   369
    "return the name of the bin repository.
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   370
     Thats the directory, where the cvs / cvs.exe command is found."
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   371
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   372
    ^ CVSBinDir
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   373
!
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   374
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   375
cvsBinDirectory:aString
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   376
    "set the name of the bin repository.
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   377
     Thats the directory, where the cvs / cvs.exe command is found."
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   378
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   379
    CVSBinDir := aString asFilename pathName.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   380
    (CVSBinDir endsWith:Filename separator) ifTrue:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   381
        CVSBinDir := CVSBinDir copyWithoutLast:1.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   382
    ]
1116
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   383
!
70936e07cadd allow for cvsBinDir to be specified
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   384
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   385
repositoryName
1023
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   386
    "return the name of the global repository.
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   387
     This is used, if no per-module repository is defined."
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   388
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   389
    ^ CVSRoot
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   390
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   391
    "Created: 14.9.1996 / 13:22:05 / cg"
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   392
    "Modified: 19.9.1997 / 06:12:02 / cg"
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   393
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   394
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   395
repositoryName:aDirectoryName
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   396
    "set the name of the repository;
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   397
     thats the name of the global CVSROOT directory, which is used 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   398
     if no specific repository was defined for a module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   399
     Can be used from an rc-script, to override the CVSROOT shell 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   400
     variable setting."
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   401
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   402
    DisabledModules := nil.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   403
    CVSRoot := aDirectoryName.
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   404
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   405
    "Created: 14.9.1996 / 13:22:24 / cg"
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   406
    "Modified: 19.9.1997 / 06:10:31 / cg"
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   407
!
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   408
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   409
repositoryName:aRepositoryName forModule:aModuleName
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   410
    "set the CVSROOT directory which provides the sources for all 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   411
     classes in a particular module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   412
     This can be used from an rc-script, to specify a repository
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   413
     for a particular module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   414
     If left unspecified, the global (i.e. fallBack) repository is used."
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   415
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   416
    DisabledModules := nil.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   417
    CVSModuleRoots isNil ifTrue:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   418
        CVSModuleRoots := Dictionary new.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   419
    ].
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   420
    CVSModuleRoots at:aModuleName put:aRepositoryName
866
632da1088521 comment
Claus Gittinger <cg@exept.de>
parents: 856
diff changeset
   421
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   422
    "Modified: 19.9.1997 / 06:09:40 / cg"
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   423
!
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   424
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   425
repositoryNameForModule:aModuleName
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   426
    "return the CVSROOT directory which provides the sources for all 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   427
     classes in a particular module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   428
     Nil is returned for unspecified moduleRoots; in this case, 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   429
     the global (i.e. fallBack) repository will be used for source access."
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   430
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   431
    CVSModuleRoots isNil ifTrue:[^nil].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   432
    ^ CVSModuleRoots at:aModuleName ifAbsent:nil.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   433
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   434
    "Modified: 19.9.1997 / 06:09:40 / cg"
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   435
    "Created: 19.9.1997 / 06:13:06 / cg"
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   436
!
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   437
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   438
repositoryNamesPerModule
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   439
    "return the dictionary, which associates CVSRoots to module names.
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   440
     If no entry is contained in this dictionary for some module,
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   441
     the default cvsRoot (CVSRoot) will be used."
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   442
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   443
    ^ CVSModuleRoots ? (Dictionary new)
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   444
!
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   445
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   446
repositoryNamesPerModule:aDictionary
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   447
    "set the dictionary, which associates CVSRoots to module names.
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   448
     If no entry is contained in this dictionary for some module,
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   449
     the default cvsRoot (CVSRoot) will be used."
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   450
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   451
    CVSModuleRoots := aDictionary
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   452
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   453
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
   454
!CVSSourceCodeManager class methodsFor:'private'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   455
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   456
checkOut:relativeFilename module:moduleDir in:tempdir
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   457
    "checkout realtiveFilename in tempdir"
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   458
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   459
    |cmd|
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   460
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   461
    cmd := 'checkout -l ' , relativeFilename.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   462
    ^ self 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   463
        executeCVSCommand:cmd 
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   464
        module:moduleDir
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   465
        inDirectory:tempdir name
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   466
        log:false
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   467
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   468
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   469
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   470
      self checkOut:'stx/libbasic/Integer.st' asFilename in:'/tmp' asFilename
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   471
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   472
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   473
    "Created: / 18.1.2000 / 20:30:01 / cg"
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   474
    "Modified: / 18.1.2000 / 20:35:06 / cg"
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   475
!
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   476
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   477
checkinTroubleDialog:title message:message log:log abortable:abortable option:optionTitle
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   478
    "trouble checking in - open a dialog"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   479
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   480
    ^ self
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   481
        checkinTroubleDialog:title 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   482
        message:message 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   483
        log:log 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   484
        abortable:abortable 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   485
        option:optionTitle 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   486
        option2:nil
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   487
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   488
    "Created: 10.12.1995 / 17:34:33 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   489
    "Modified: 12.9.1996 / 02:39:06 / cg"
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   490
!
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   491
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   492
checkinTroubleDialog:title message:message log:log abortable:abortable option:optionTitle option2:optionTitle2
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   493
    "trouble checking in - open a dialog"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   494
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
   495
    |l box list listView optionPressed option2Pressed|
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   496
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   497
    l := log collect:[:line | line withTabsExpanded].
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   498
    list := SelectionInList with:l.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   499
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   500
    box := Dialog new.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   501
    box label:(title).
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   502
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   503
    (box addTextLabel:message) borderWidth:0.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   504
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   505
    listView := SelectionInListView on:list.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   506
    listView disable.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   507
    listView height:200.
749
c91f5a3fc9c0 do not make log-list tabbable (in MERGE-dialog)
Claus Gittinger <cg@exept.de>
parents: 748
diff changeset
   508
    box addComponent:(HVScrollableView forView:listView miniScrollerH:true) tabable:false.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   509
    box addVerticalSpace.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   510
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   511
    abortable ifTrue:[
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   512
        box addAbortButton
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   513
    ].
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   514
    optionTitle notNil ifTrue:[
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   515
        box addOkButton:(Button label:optionTitle action:[optionPressed := true. box hide]).
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   516
    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   517
    optionTitle2 notNil ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   518
        box addOkButton:(Button label:optionTitle2 action:[option2Pressed := true. box hide]).
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   519
    ].
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   520
    box addOkButton.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   521
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   522
    box extent:(box preferredExtent).
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   523
    box minExtent:box extent.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   524
    box maxExtent:box extent.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   525
1079
afa524b130f1 dont use explicit showAtPointer
Claus Gittinger <cg@exept.de>
parents: 1074
diff changeset
   526
    box open.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   527
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   528
    box destroy.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   529
    optionPressed == true ifTrue:[^ #option].
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   530
    option2Pressed == true ifTrue:[^ #option2].
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   531
    ^ box accepted
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   532
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   533
    "Created: 9.9.1996 / 19:12:45 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   534
    "Modified: 12.9.1996 / 02:39:10 / cg"
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   535
!
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   536
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   537
createEntryFor:pathInRepository module:aModule in:aDirectory revision:rev date:date special:special overwrite:overwrite
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   538
    "create an CVS/Repository and CVS/Entries entry for filename. 
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   539
     If the path does not exist, it will be created
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   540
     If overwrite is true, an existing Entry will be overwritten.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   541
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   542
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   543
    |filename cvsRoot cvsDir name entries firstPart s path|
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   544
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   545
    filename := pathInRepository asFilename.
167
5ee0797897c5 Fixes for stc.
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   546
    cvsDir := (aDirectory asFilename construct:'CVS') recursiveMakeDirectory.
5ee0797897c5 Fixes for stc.
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   547
    entries := cvsDir construct:'Entries'.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   548
    name := filename baseName.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   549
    firstPart := '/', name, '/'.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   550
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   551
    s := entries readStream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   552
    s isNil ifTrue:[
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   553
        "/
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   554
        "/ no Repository yet, create one
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   555
        "/
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   556
        |index root|
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   557
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   558
        cvsRoot := self getCVSROOTForModule:aModule.
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   559
        "/
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   560
        "/ match for first '/', to get the path portion without :pserver:host:
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   561
        "/
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   562
        index := cvsRoot indexOf:$/.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   563
        index > 0 ifTrue:[
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   564
            root := cvsRoot copyFrom:(index).
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   565
        ] ifFalse:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   566
            root := cvsRoot.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   567
        ].
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   568
        "/ create Repository
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   569
        "/ (notice, contents must be a Unix filename ...
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   570
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   571
        s := (cvsDir construct:'Repository') writeStream.
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   572
        path := Filename components:filename directory name.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   573
        path := path asStringWith:$/.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   574
        s nextPutLine:(root, '/', path).
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   575
        s close.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   576
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   577
        "/ make new Entries file.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   578
        s := entries writeStream.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   579
    ] ifFalse:[
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   580
        |newName newStream line|
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   581
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   582
        newName := Filename newTemporaryIn:cvsDir.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   583
        newStream := newName writeStream.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   584
        [(line := s nextLine) notNil] whileTrue:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   585
            (line findString:firstPart) ~= 1 ifTrue:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   586
                "/ we have found an entry for ourself.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   587
                "/ If we do not want to overwrite it, clean up everything and return.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   588
                overwrite ifFalse:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   589
                    newName remove.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   590
                    newStream close.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   591
                    s close.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   592
                    ^ self
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   593
                ].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   594
                newStream nextPutLine:line
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   595
            ].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   596
        ].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   597
        newName renameTo:entries.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   598
        s close.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   599
        s := newStream.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   600
    ].
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   601
    s nextPutLine:firstPart, rev, '/', date, '/', special, '/'.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   602
    s close.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   603
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   604
    "
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   605
        self createEntryFor:'foo/xxx/yyy' in:'foo/xxx' revision:'1.22' date:'dummy' special:''
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   606
        self createEntryFor:'foo/xxx/yyy' in:'foo/xxx' revision:'3.44' date:'new dummy' special:'special'
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   607
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   608
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   609
    "Created: / 19.9.1997 / 06:21:02 / cg"
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   610
    "Modified: / 7.1.1998 / 14:15:35 / stefan"
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   611
    "Modified: / 20.8.1998 / 00:12:11 / cg"
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   612
!
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   613
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   614
createLocalDirectory:packageDir inModule:moduleDir
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   615
    "create a local working directory for module/package.
806
dacfa8d24dcf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 804
diff changeset
   616
     To speed up things, we checkout a file '__stxCvsDummy__', to create
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   617
     the whole tree. If the file is not present, we will create it.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   618
     Return the name of a temporary directory containing the package"
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   619
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   620
    ^ self
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   621
        createLocalDirectory:packageDir 
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   622
        inModule:moduleDir 
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   623
        with:'.stxCvsDummy'
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   624
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   625
    "
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   626
     self createLocalDirectory:'libbasic' inModule:'stx'
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   627
    "
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   628
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   629
    "Created: / 23.7.1999 / 19:14:28 / stefan"
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   630
    "Modified: / 26.7.1999 / 17:43:35 / stefan"
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   631
    "Modified: / 18.1.2000 / 20:56:19 / cg"
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   632
!
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   633
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   634
createLocalDirectory:packageDir inModule:moduleDir with:fileToCheckout
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   635
    "create a local working directory for module/package, and checkout the
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   636
     given file there.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   637
     Return the name of a temporary directory containing the package, or nil"
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   638
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   639
    |path absolutePath tempdir unixPath|
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   640
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   641
    path := (moduleDir asFilename construct:packageDir) construct:fileToCheckout.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   642
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   643
    tempdir := self createTempDirectory:nil forModule:nil.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   644
    tempdir isNil ifTrue:[
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   645
        ('CVSSourceCodeManager [error]: no tempDir - cannot checkout') errorPrintCR.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   646
        ^ nil
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   647
    ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   648
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   649
    OperatingSystem isUNIXlike ifTrue:[
892
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   650
        unixPath := path name.
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   651
    ] ifFalse:[
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   652
        OperatingSystem isVMSlike ifTrue:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
   653
            self halt:'VMS case not yet implemented'
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   654
        ].
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   655
        unixPath := path name copy replaceAll:$\ with:$/
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   656
    ].
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   657
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   658
    (self checkOut:unixPath module:moduleDir in:tempdir) ifFalse:[
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   659
        "dummy file does not exist, so create it"
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   660
        absolutePath := tempdir construct:path.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   661
        absolutePath directory recursiveMakeDirectory.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   662
        "now create the file"
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   663
        (absolutePath writeStream close) isNil ifTrue:[
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   664
            ('CVSSourceCodeManager [error]: cannot create dummy') errorPrintCR.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   665
            tempdir recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   666
            ^ nil.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   667
        ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   668
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   669
        "now create the dummy file in the repository"
892
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   670
        (self import:moduleDir in:tempdir) ifFalse:[
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   671
            ('CVSSourceCodeManager [error]: cannot import dummy') errorPrintCR.
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   672
        ].
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   673
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   674
        "remove the path, so that checkout works"
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   675
        (tempdir construct:moduleDir) recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   676
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   677
        "checkout the dummy, the intermediate directories will be created"
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   678
        (self checkOut:unixPath module:moduleDir in:tempdir) ifFalse:[
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   679
            ('CVSSourceCodeManager [error]: cannot create working dir') errorPrintCR.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   680
            tempdir recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   681
            ^ nil.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   682
        ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   683
    ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   684
        
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   685
    ^ tempdir.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   686
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   687
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   688
     self createLocalDirectory:'libbasic' inModule:'stx'
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   689
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   690
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   691
    "Modified: / 26.7.1999 / 17:43:35 / stefan"
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   692
    "Created: / 18.1.2000 / 20:55:52 / cg"
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   693
    "Modified: / 18.1.2000 / 20:56:45 / cg"
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   694
!
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   695
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   696
createTempDirectory:packageDir forModule:moduleDir
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   697
    "create a temp directory for checking out"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   698
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   699
    |tempdir dir|
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   700
680
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   701
    "/ if CVSTempDir isNil, use current.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   702
    tempdir := Filename newTemporaryIn:CVSTempDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   703
    tempdir exists ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   704
        tempdir recursiveRemove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   705
    ].
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   706
    OperatingSystem errorSignal handle:[:ex |
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   707
        'SourceCodemanager [error]: cannot create temporary directory' errorPrintCR.
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   708
        ^ nil.
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   709
    ] do:[
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   710
        tempdir makeDirectory.
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   711
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   712
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   713
    moduleDir notNil ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   714
        dir := tempdir construct:moduleDir.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   715
        dir makeDirectory.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
   716
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   717
        packageDir notNil ifTrue:[
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   718
            dir := dir construct:packageDir.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   719
            dir recursiveMakeDirectory.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   720
        ].
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   721
        dir exists ifFalse:[
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   722
            tempdir recursiveRemove.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
   723
            'SourceCodemanager [error]: cannot create temporary directory' errorPrintCR.
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   724
            ^ nil.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   725
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   726
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   727
    ^ tempdir
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   728
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   729
    "self createTempDirectory:'fooPackage' forModule:'fooModule'"
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   730
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   731
    "Created: 9.12.1995 / 19:14:35 / cg"
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   732
    "Modified: 19.12.1995 / 16:13:02 / stefan"
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   733
    "Modified: 18.8.1997 / 19:06:52 / cg"
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   734
!
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   735
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   736
cvsTimeString:absoluteTime
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   737
    "convert an absoluteTime to a string suitable for the CVS/Entries file:
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   738
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   739
                         123456789012345678901234
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   740
                         Tue Dec 19 20:56:26 1995
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   741
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   742
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   743
    |date time stream|
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   744
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   745
    date := absoluteTime asDate.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   746
    time := absoluteTime asTime.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   747
    stream := WriteStream on:(String new:24).
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   748
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   749
    (#('Mon' 'Tue' 'Wed' 'Thu' 'Fri' 'Sat' 'Sun') at:(date dayInWeek)) printOn:stream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   750
    stream space.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   751
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   752
    (#('Jan' 'Feb' 'Mar' 'Apr' 'May' 'Jun' 'Jul' 'Aug' 'Sep' 'Oct' 'Nov' 'Dec') 
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   753
        at:(date month)) printOn:stream.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   754
    stream space.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   755
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   756
    date day printOn:stream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   757
    stream space.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   758
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   759
    time print24HourFormatOn: stream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   760
    stream space.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   761
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   762
    date year printOn:stream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   763
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   764
    ^ stream contents
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   765
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   766
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   767
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   768
     CVSSourceCodeManager cvsTimeString:(AbsoluteTime now)
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   769
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   770
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   771
    "Modified: 20.12.1995 / 11:03:32 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   772
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   773
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   774
executeCVSCommand:cvsCommand module:moduleName inDirectory:dir
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   775
    "execute command and prepend cvs command name and global options.
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   776
     if dir ~= nil, execute command in that directory.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   777
     This also leads to a log-entry to be added to cvs's logfile."
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   778
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   779
    ^ self
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   780
        executeCVSCommand:cvsCommand 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   781
        module:moduleName 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   782
        inDirectory:dir 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   783
        log:true
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   784
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   785
    "Modified: / 20.5.1998 / 16:07:28 / cg"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   786
!
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   787
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   788
executeCVSCommand:cvsCommand module:moduleName inDirectory:dir log:doLog
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   789
    "execute command and prepend cvs command name and global options.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   790
     if dir ~= nil, execute command in that directory.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   791
     The doLog argument, if false supresses a logEntry to be added 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   792
     in the cvs log file (used when reading / extracting history)"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   793
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   794
    ^ self
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   795
        executeCVSCommand:cvsCommand module:moduleName inDirectory:dir log:doLog 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   796
        pipe:false
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   797
!
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   798
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   799
executeCVSCommand:cvsCommand module:moduleName inDirectory:dir log:doLog pipe:doPipe
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   800
    "execute command and prepend cvs command name and global options.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   801
     if dir ~= nil, execute command in that directory.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   802
     The doLog argument, if false supresses a logEntry to be added 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   803
     in the cvs log file (used when reading / extracting history)"
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   804
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   805
    |command cvsRoot rslt ok pathOfDir p|
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   806
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   807
    cvsRoot := self getCVSROOTForModule:moduleName.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   808
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   809
    command := CVSBinDir.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   810
    command size > 0 ifTrue:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   811
        (command endsWith:Filename separator) ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   812
            command := command , (Filename separator asString)
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   813
        ]
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   814
    ].
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   815
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   816
    doLog ifFalse:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   817
        command := command , 'cvs -l -d "', cvsRoot, '" ', cvsCommand.
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   818
    ] ifTrue:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   819
        command := command , 'cvs -d "', cvsRoot, '" ', cvsCommand.
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   820
    ].
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   821
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   822
    Verbose == true ifTrue:[
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   823
        ('CVSSourceCodeManager [info]: executing: ' , command , '[in ' , dir , ']') infoPrintCR.
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   824
    ].
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   825
767
1402401e8aec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
   826
    pathOfDir := dir asFilename pathName.
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   827
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   828
    doPipe ifTrue:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   829
        rslt := PipeStream readingFrom:command inDirectory:pathOfDir.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   830
        ok := rslt notNil.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   831
    ] ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   832
        Processor isDispatching ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   833
            rslt := ok := OperatingSystem executeCommand:command inDirectory:pathOfDir.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   834
        ] ifTrue:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   835
            p := [
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   836
                rslt := ok := OperatingSystem executeCommand:command inDirectory:pathOfDir.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   837
            ] fork.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   838
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   839
            (p waitUntilTerminatedWithTimeout:300) ifTrue:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   840
                ('CVSSourceCodeManager [info]: command timeout: ' , command) errorPrintCR.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   841
                ^ false
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   842
            ]. 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   843
        ].
929
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   844
    ].
831
9f359f49fbf1 time watchdog added to cvs command execution
Claus Gittinger <cg@exept.de>
parents: 830
diff changeset
   845
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   846
    ok ifFalse:[
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
   847
        ('CVSSourceCodeManager [info]: command failed: ' , command) errorPrintCR.
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   848
    ].
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   849
    ^ rslt
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   850
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   851
    "Modified: / 23.4.1996 / 15:24:00 / stefan"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   852
    "Created: / 20.5.1998 / 16:06:34 / cg"
767
1402401e8aec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
   853
    "Modified: / 19.5.1999 / 10:43:57 / cg"
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   854
!
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   855
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   856
getCVSROOTForModule:aModuleName
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   857
    "internal: used when accessing a source repository.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   858
     Return the CVSROOT which provides the sources for a particular module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   859
     If no specific root was defined for that module, return the value of
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   860
     the global (fallBack) CVSRoot.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   861
     Nil is returned if no repository is available." 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   862
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   863
    |root|
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   864
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   865
    CVSModuleRoots isNil ifTrue:[^ CVSRoot].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   866
    aModuleName isNil ifTrue:[^ CVSRoot].
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   867
    root := CVSModuleRoots at:aModuleName ifAbsent:nil.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   868
    ^ root ? CVSRoot
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   869
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   870
    "Created: / 19.9.1997 / 06:18:07 / cg"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   871
    "Modified: / 20.5.1998 / 16:30:12 / cg"
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   872
!
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   873
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   874
getCVSROOTsPerModule
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   875
    "return a dictionary, which associates CVSRoots to modules" 
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   876
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   877
    ^ CVSModuleRoots ? #()
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   878
!
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   879
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   880
import:moduleDir in:tempdir
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   881
    "import the existing tree in tempdir as repository"
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   882
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   883
    |cmd|
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   884
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   885
    cmd := 'import -m "checkin from stx browser" . initialV initialR'.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   886
    ^ self 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   887
        executeCVSCommand:cmd 
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   888
        module:moduleDir
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   889
        inDirectory:tempdir name
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   890
        log:false
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   891
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   892
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   893
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   894
      |f d|
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   895
      f := 'stefan/dummy/fasel'.
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   896
      d := '/tmp/tt' asFilename construct:f.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   897
      d directory recursiveMakeDirectory.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   898
      d writeStream close.
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   899
      self import:'stefan' in:'/tmp/tt/stefan' asFilename
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   900
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   901
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   902
    "Created: / 23.7.1999 / 19:19:34 / stefan"
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   903
    "Modified: / 26.7.1999 / 17:46:29 / stefan"
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   904
    "Modified: / 18.1.2000 / 20:21:32 / cg"
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   905
!
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   906
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   907
releaseAndRemove:tempdir module:moduleDir outputTo:outputFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   908
    "cleanup; release tree towards cvs and remove the temporary tree"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   909
136
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   910
    |cmd redirect|
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   911
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   912
    outputFilename isNil ifTrue:[
822
256ba484c777 NUL device
ps
parents: 818
diff changeset
   913
        OperatingSystem isMSDOSlike ifTrue:[
256ba484c777 NUL device
ps
parents: 818
diff changeset
   914
            redirect := 'NUL'
256ba484c777 NUL device
ps
parents: 818
diff changeset
   915
        ] ifFalse:[
256ba484c777 NUL device
ps
parents: 818
diff changeset
   916
            redirect := '/dev/null'
256ba484c777 NUL device
ps
parents: 818
diff changeset
   917
        ]
136
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   918
    ] ifFalse:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   919
        redirect := outputFilename name
136
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   920
    ].
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   921
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   922
    "/
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   923
    "/ release it towards cvs
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   924
    "/
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   925
    cmd := '-l release > ' , redirect.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   926
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   927
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   928
        module:moduleDir
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   929
        inDirectory:tempdir name
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   930
        log:false
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   931
    ) ifFalse:[
136
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   932
"/        'CVSMGR: failed to release: ' errorPrint. cmd errorPrintNL.
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   933
    ].
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   934
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   935
    tempdir recursiveRemove.
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   936
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   937
    "Modified: / 23.4.1996 / 14:29:49 / stefan"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   938
    "Created: / 19.9.1997 / 06:28:02 / cg"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   939
    "Modified: / 20.5.1998 / 16:44:07 / cg"
822
256ba484c777 NUL device
ps
parents: 818
diff changeset
   940
    "Modified: / 3.9.1999 / 14:51:29 / ps"
136
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   941
!
81d824f327d8 -l flag added to all cvs commands which do not update the repository (no one is interrested in this)
Claus Gittinger <cg@exept.de>
parents: 134
diff changeset
   942
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   943
repositoryTopDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   944
    "return the top of the repository. This handles remote CVS connections
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   945
     as well"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   946
758
14b304ca1d73 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 756
diff changeset
   947
    CVSRoot isNil ifTrue:[^ nil].
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   948
    ^ self repositoryTopDirectory:CVSRoot.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   949
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   950
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   951
     CVSSourceCodeManager repositoryTopDirectory
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   952
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   953
640
9a3fb7645218 More fixes for :pserver:.
Stefan Vogel <sv@exept.de>
parents: 639
diff changeset
   954
    "Created: / 25.11.1995 / 18:39:19 / cg"
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   955
    "Modified: / 16.1.1998 / 17:33:31 / stefan"
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   956
!
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   957
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   958
repositoryTopDirectory:aString
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   959
    "return the top of the repository (without remote prefix)"
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   960
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   961
    |idx|
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   962
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   963
    idx := aString indexOf:$/.
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   964
    idx <= 1 ifTrue:[
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   965
        ^ aString.
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   966
    ].
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   967
    ^ aString copyFrom:idx.
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   968
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   969
    "
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   970
     CVSSourceCodeManager repositoryTopDirectory:':pserver:stefan@ibm.exept.de:/archiv/cvs'
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   971
     CVSSourceCodeManager repositoryTopDirectory:'exept:/files/CVS'
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   972
     CVSSourceCodeManager repositoryTopDirectory:'/archiv/cvs'
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   973
    "
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   974
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   975
    "Modified: / 16.1.1998 / 17:32:03 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   976
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   977
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   978
revisionStringFromLog:log entry:entry forClass:aClass
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   979
    "given a log entry, extract a revision string"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   980
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   981
    |oldRev idx special|
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   982
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   983
    oldRev := aClass revisionString.
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   984
    special := ''.
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   985
554
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   986
    oldRev notNil ifTrue:[
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   987
        idx := oldRev lastIndexOf:$[.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   988
        idx ~~ 0 ifTrue:[
554
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   989
            idx := oldRev indexOf:$[ startingAt:idx+1.
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   990
            idx ~~ 0 ifTrue:[
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   991
                special := ' ' , (oldRev copyFrom:idx).
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   992
            ]
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   993
        ].
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   994
    ].
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   995
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   996
    ^ '$Header: ' , (log at:#container) ,
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   997
      ' ' , (entry at:#revision) ,
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   998
      ' ' , (entry at:#date) , 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   999
      ' ' , (entry at:#author) , 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1000
      ' ' , (entry at:#state) ,
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1001
      ' $' ,
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1002
      special
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1003
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1004
    "Created: 16.9.1996 / 20:24:14 / cg"
554
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
  1005
    "Modified: 3.3.1997 / 22:31:51 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1006
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1007
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1008
updatedRevisionStringOf:aClass forRevision:newRevision with:originalVersionString
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1009
    "update a revision string"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1010
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1011
    |idx leftPart rightPart vsnString newVsn|
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1012
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1013
    "/ search for ,v
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1014
    idx := originalVersionString indexOfSubCollection:'.st,v'.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1015
    idx == 0 ifTrue:[^ nil].
485
ced03221d6e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1016
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1017
    leftPart := originalVersionString copyTo:(idx - 1 + 5).
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1018
    rightPart := (originalVersionString copyFrom:(idx + 5)) withoutSpaces.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1019
    idx := rightPart indexOfSeparator.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1020
    idx == 0 ifTrue:[^ nil].
485
ced03221d6e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
  1021
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1022
    vsnString := rightPart copyTo:idx - 1.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1023
    rightPart := rightPart copyFrom:idx + 1.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1024
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1025
    newRevision isNil ifTrue:[
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1026
        (vsnString endsWith:'m') ifTrue:[
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1027
             "/ alread a modified class
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1028
"/            ('already modified: ' , vsnString) printNL.
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1029
            ^ nil
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1030
        ].
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1031
        newVsn := vsnString , 'm'
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1032
    ] ifFalse:[
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  1033
        newVsn := newRevision
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1034
    ].
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1035
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1036
    ^ leftPart , ' ' , newVsn , ' ' , rightPart
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1037
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1038
    "Created: 7.12.1995 / 20:23:38 / cg"
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1039
    "Modified: 16.9.1996 / 20:24:28 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1040
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1041
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
  1042
!CVSSourceCodeManager class methodsFor:'source code access'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1043
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1044
checkin:containerFilename text:someText directory:packageDir module:moduleDir logMessage:logMessage force:force
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1045
    "enter some (source) code (which is someText)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1046
     into the source repository. If the force argument is true, no merge is done;
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1047
     instead, the code is checked in as given (Dangerous).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1048
     Return true if ok, false if not."
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1049
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1050
    |tempdir cmd checkoutName logMsg revision logTmp 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1051
     cmdOut whatHappened s  idx changeLog changesAsLogged l 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1052
     newRevision newString binRevision  msg answer didMerge
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1053
     mySource mergedSource modulePath time 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1054
     editor checkInRepaired didAccept emphasizedText repairedText out 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1055
     emSep comment how|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1056
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1057
    revision := self newestRevisionInFile:containerFilename directory:packageDir module:moduleDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1058
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1059
    logMsg := logMessage.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1060
    (logMsg isNil or:[logMsg isEmpty]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1061
        logMsg := 'checkin from browser'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1062
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1063
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1064
    cmdOut := Filename newTemporary.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1065
    cmdOut exists ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1066
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1067
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1068
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1069
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1070
    "/ in CVS, we have to checkout the file first, in order
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1071
    "/ to get up-to-date CVS entries, and also to be able to merge in
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1072
    "/ other users changes.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1073
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1074
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1075
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1076
    "/ first, create a temporary work tree
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1077
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1078
    tempdir := self createTempDirectory:nil forModule:nil.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1079
    tempdir isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1080
        ('CVSSourceCodeManager [error]: no tempDir - cannot checkin ' , containerFilename) errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1081
        ^ false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1082
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1083
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1084
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1085
    "/ next, create CVS/Entries and CVS/Repository with version information of current version
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1086
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1087
    modulePath :=  moduleDir , '/' , packageDir. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1088
    checkoutName :=  modulePath , '/' , containerFilename.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1089
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1090
    revision isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1091
        "/ a new file ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1092
        ^ self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1093
            createContainerForText:someText inModule:moduleDir package:packageDir container:containerFilename
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1094
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1095
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1096
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1097
    "/ correct our current time, so that converting it will give us UTC
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1098
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1099
    time := AbsoluteTime now subtractSeconds:1.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1100
    time := time addSeconds:(time utcOffset).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1101
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1102
    self createEntryFor:checkoutName 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1103
         module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1104
         in:(tempdir construct:modulePath) 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1105
         revision:revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1106
         date:(self cvsTimeString:time)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1107
         special:''
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1108
         overwrite:true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1109
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1110
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1111
    "/ copy-over our current version
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1112
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1113
    Stream errorSignal handle:[:ex|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1114
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1115
        'CVSSourceCodeManager [error]: cannot copy-over filedOut class source' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1116
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1117
    ] do:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1118
        s := (tempdir construct:checkoutName) writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1119
        s nextPutAll:someText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1120
        s close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1121
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1122
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1123
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1124
    "/ synchronize i.e. merge in any changes
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1125
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1126
    self activityNotification:'merging ' , containerFilename , ' with repository version ...'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1127
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1128
    cmd := 'update ', containerFilename, ' >', cmdOut name.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1129
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1130
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1131
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1132
        inDirectory:((tempdir construct:moduleDir) constructString:packageDir)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1133
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1134
        force ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1135
            'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1136
            tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1137
            cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1138
            'CVSSourceCodeManager [error]: cannot merge current source with repository version' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1139
            ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1140
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1141
    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1142
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1143
        "/ check what happened - the contents of the cmdOut file may be:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1144
        "/   empty   -> nothing changed
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1145
        "/   M xxx   -> merged-in changes from other users
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1146
        "/   C xxx   -> a conflict occured and the differences have been merged into the source
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1147
        "/              needs special action
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1148
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1149
        (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1150
            whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1151
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1152
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1153
    cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1154
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1155
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1156
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1157
        "/ no change
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1158
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1159
"/        Transcript showCR:'no change in ' , containerFilename , ' (repository unchanged)'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1160
        force ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1161
            self information:'nothing changed in ' , containerFilename , ' (repository unchanged)'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1162
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1163
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1164
        ^ true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1165
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1166
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1167
    Verbose == true ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1168
        ('CVSMGR: result is: ' , whatHappened) infoPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1169
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1170
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1171
    force ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1172
        revision isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1173
            changeLog := self revisionLogOfContainer:containerFilename directory:packageDir module:moduleDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1174
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1175
            changeLog := self revisionLogOfContainer:containerFilename module:moduleDir package:packageDir fromRevision:(self revisionAfter:revision) toRevision:nil.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1176
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1177
        changeLog notNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1178
            s := WriteStream on:String new.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1179
            self writeRevisionLogMessagesFrom:changeLog withHeader:false to:s.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1180
            changesAsLogged := s contents.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1181
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1182
            "/ mhmh - that should not happen
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1183
            changesAsLogged := ''.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1184
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1185
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1186
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1187
    didMerge := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1188
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1189
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1190
    "/ cvs above rel10 returns a multiline info ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1191
    "/ we have to extract the one line which states what happened.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1192
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1193
    whatHappened := whatHappened asCollectionOfLines asStringCollection.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1194
    whatHappened := whatHappened select:[:line |
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1195
                        (line startsWith:'RCS file') not
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1196
                        and:[(line startsWith:'retrieving') not
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1197
                        and:[(line startsWith:'Merging') not
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1198
                        and:[line size > 0]]]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1199
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1200
    whatHappened := whatHappened asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1201
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1202
    (force or:[whatHappened startsWith:'M ']) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1203
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1204
        "/ merged in changes
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1205
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1206
        (force 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1207
        or:[changeLog isNil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1208
        or:[(changeLog at:#revisions) isEmpty]]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1209
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1210
            "/ pretty good - nothing has changed in the meanwhile
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1211
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1212
            Transcript showCR:'checking in ' , containerFilename , ' ...'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1213
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1214
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1215
            "/ someone else has changed things in the meanwhile, but there is no conflict
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1216
            "/ and version have been merged.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1217
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1218
            didMerge := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1219
            changesAsLogged := changesAsLogged asCollectionOfLines.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1220
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1221
            s := WriteStream on:String new.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1222
            s nextPutAll:someText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1223
            mySource := s contents asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1224
            mergedSource := (tempdir construct:checkoutName) readStream contents asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1225
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1226
            mySource = mergedSource ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1227
                msg := 'The source of ' , containerFilename , ' has been changed in the meanwhile as listed below.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1228
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1229
I have merged your version with the newest repository version, 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1230
and found no differences between the result and your current version
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1231
(i.e. your version seemed up-to-date).'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1232
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1233
                self checkinTroubleDialog:'Merging versions'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1234
                               message:msg 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1235
                               log:changesAsLogged
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1236
                               abortable:false 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1237
                               option:nil.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1238
                didMerge := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1239
            ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1240
                msg := 'The source of ' , containerFilename , ' has been changed in the meanwhile as listed below.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1241
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1242
If you continue, your new changes (based upon rev. ' , revision printString , ') will be MERGED
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1243
into the newest revision. This will combine the other version with your changes
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1244
into a new common revision which may be different from both. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1245
Although this is a nice feature, it may fail to create the expected result in certain situations. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1246
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1247
You should carefully check the result - by comparing the current version with the
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1248
most recent version in the repository. If that does not contain an acceptable version,
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1249
change methods as required and check in again. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1250
Be aware, that after that, the actual repository version is different from your current classes,
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1251
and you should update your class from the repository.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1252
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1253
Continue ?'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1254
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1255
                answer := self checkinTroubleDialog:'Merging versions'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1256
                               message:msg 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1257
                               log:changesAsLogged
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1258
                               abortable:true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1259
                               option:'stop - see first'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1260
                answer ~~ true ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1261
                    answer == #option ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1262
                        DiffTextView 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1263
                            openOn:mySource
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1264
                            label:'current version'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1265
                            and:mergedSource
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1266
                            label:'merged version'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1267
                            
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1268
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1269
                    Transcript showCR:'checkin aborted - (no merge; repository unchanged)'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1270
                    tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1271
                    ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1272
                ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1273
            ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1274
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1275
"/                changesAsLogged := (changesAsLogged asStringCollection collect:[:line | line withTabsExpanded]) asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1276
"/                msg := 'The source of ' , containerFilename , ' has been changed in the meanwhile as follows:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1277
"/' , changesAsLogged , '
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1278
"/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1279
"/If you continue, your new changes (based upon rev. ' , revision , ') will be MERGED
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1280
"/into the newest revision. This will combine the other version with your changes
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1281
"/into a new common revision which is different from both. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1282
"/Although convenient, it may fail to create the expected result in certain situations. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1283
"/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1284
"/You should carefully check the result - by comparing the current version with the
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1285
"/most recent version in the repository. If that does not contain an acceptable version,
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1286
"/change methods as required and check in again. Be aware, that the actual repository version
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1287
"/is different from your current classes.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1288
"/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1289
"/Continue ?'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1290
"/                (self confirm:msg) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1291
"/                    Transcript showCR:'checkin aborted - (no merge; repository unchanged)'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1292
"/                    tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1293
"/                    ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1294
"/                ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1295
            Transcript showCR:'checking in ' , containerFilename , ' (merged other changes) ...'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1296
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1297
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1298
        (whatHappened startsWith:'C ') ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1299
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1300
            "/ conflict; someone else checked in something in the meanwhile,
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1301
            "/ and there is a conflict between this version and the checked in version.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1302
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1303
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1304
            changesAsLogged := changesAsLogged asCollectionOfLines.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1305
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1306
            msg := 'The source of ' , containerFilename , ' has been changed in the meanwhile as listed below.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1307
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1308
Your new changes (based upon rev. ' , revision printString , ') CONFLICT with those changes.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1309
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1310
You should fix things by comparing your class with the most recent repository version
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1311
and change your methods avoiding conflicts. The checkin again.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1312
'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1313
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1314
            answer := self checkinTroubleDialog:'Version conflict'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1315
                 message:msg 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1316
                 log:changesAsLogged
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1317
                 abortable:false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1318
                 option:'show conflicts'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1319
                 option2:'resolve conflicts'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1320
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1321
            answer == #option ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1322
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1323
                "/ show conflicts in a 3-way DiffTextView ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1324
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1325
                Diff3TextView
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1326
                    openOnMergedText:(tempdir construct:checkoutName) readStream contents 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1327
                    label:'your version (checkin attempt)' 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1328
                    label:'original (base version)' 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1329
                    label:'newest repository version'. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1330
            ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1331
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1332
            checkInRepaired := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1333
            answer == #option2 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1334
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1335
                "/ allow checkin of repair version
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1336
                "/ this is error prone ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1337
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1338
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1339
                "/ show merged version in an editor ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1340
                "/ ... accept will check it in.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1341
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1342
                emphasizedText := (tempdir construct:checkoutName) readStream contents.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1343
                emSep := (Array with:(#color->Color black)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1344
                             with:(#backgroundColor->Color green)).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1345
                emphasizedText := Diff3TextView 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1346
                            emphasizeMergedDiff3Text:emphasizedText 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1347
                            emphasize1:(Array with:(#color->Color white)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1348
                                              with:(#backgroundColor->Color blue))
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1349
                            emphasize2:(Array with:(#color->Color white)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1350
                                              with:(#backgroundColor->Color red))
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1351
                            emphasizeSep:emSep.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1352
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1353
                comment := 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1354
'"/ ***************************************************************
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1355
"/ This text contains your current versions code (blue)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1356
"/ merged with the conflicting code as found in the repository (red) which resulted
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1357
"/ from some other checkin.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1358
"/ Each such conflict is surrounded by green text (like this paragraph).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1359
"/ 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1360
"/ Please have a look at ALL the conflicts and fix things as appropriate.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1361
"/ Delete the green lines as a confirmation - I will not checkin the changed text,
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1362
"/ unless no more green parts are present. This includes this comment at the top.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1363
"/ ***************************************************************
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1364
'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1365
                comment := (Text string:comment emphasis:emSep) asStringCollection.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1366
                emphasizedText := comment , emphasizedText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1367
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1368
                didAccept := false. checkInRepaired := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1369
                [didAccept not and:[checkInRepaired]] whileTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1370
                    editor := RCSConflictEditTextView 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1371
                                setupWith:emphasizedText
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1372
                                title:'Resolve conflicts in ' , containerFilename , ', then accept & close to checkin'.    
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1373
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1374
                    editor acceptAction:[:dummy |
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1375
                        repairedText := editor list.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1376
                        didAccept := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1377
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1378
                    didAccept := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1379
                    editor topView openModal.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1380
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1381
                    didAccept ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1382
                        (Dialog confirm:'You did not accept the new text. Edit again ?')
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1383
                        ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1384
                            checkInRepaired := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1385
                        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1386
                    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1387
                        "/ check if all green-stuff (separators) have been removed
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1388
                        (repairedText findFirst:[:line | line notNil and:[line notEmpty and:[(line emphasisAt:1) = emSep]]]) ~~ 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1389
                            self warn:'You have to look at ALL conflicts, and remove ALL green lines as a confirmation !!'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1390
                            didAccept := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1391
                        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1392
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1393
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1394
                ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1395
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1396
                checkInRepaired ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1397
                    out := (tempdir construct:checkoutName) writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1398
                    out isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1399
                        self warn:'could not write file ' , (tempdir constructString:checkoutName).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1400
                        checkInRepaired := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1401
                    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1402
                        out nextPutAll:(repairedText asString string).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1403
                        didAccept := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1404
                        out close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1405
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1406
                ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1407
            ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1408
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1409
            checkInRepaired ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1410
                Transcript showCR:'checking in ' , containerFilename , ' (manually repaired version) ...'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1411
            ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1412
                'CVSSourceCodeManager [warning]: cannot (for now) checkin; conflicts found' infoPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1413
                Transcript showCR:'checkin of ' , containerFilename , ' aborted (conflicting changes; repository unchanged)'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1414
                tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1415
                ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1416
            ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1417
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1418
            (whatHappened startsWith:'U ') ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1419
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1420
                "/ nothing changed here, but the repository already contains
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1421
                "/ a newer version.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1422
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1423
                tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1424
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1425
                self information:'nothing changed in your ''' , containerFilename , ''';
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1426
but repository already contains a newer version (repository unchanged).'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1427
                ^ true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1428
            ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1429
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1430
                "/ unexpected
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1431
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1432
                self warn:'unexpected message from CVS:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1433
' , whatHappened , '
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1434
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1435
No checkin performed.'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1436
                Transcript showCR:'*** cannot checkin ' , containerFilename , ' (unexpected CVS response; repository unchanged)'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1437
                tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1438
                ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1439
            ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1440
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1441
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1442
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1443
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1444
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1445
    "/ now check it in again
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1446
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1447
    self activityNotification:'saving ' , containerFilename , ' in repository ...'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1448
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1449
    logMsg := logMsg replChar:$"  withString:'\"'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1450
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1451
    OperatingSystem isUNIXlike ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1452
        "/ save the log message into another tempFile ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1453
        logTmp := Filename newTemporaryIn:tempdir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1454
        s := logTmp writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1455
        s nextPutAll:logMsg.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1456
        s close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1457
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1458
        cmd := 'commit -F "', logTmp baseName, '" ', checkoutName, ' >', cmdOut name.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1459
    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1460
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1461
        "/ CVS up to V1.9.14 prints the 'new revision' to stderr,
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1462
        "/ CVS V1.9.16 to stdout.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1463
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1464
        cmd := 'commit -m "', logMsg, '" ', checkoutName, ' >', cmdOut name , ' 2>&1'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1465
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1466
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1467
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1468
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1469
        inDirectory:tempdir name
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1470
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1471
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1472
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1473
        (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1474
            whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1475
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1476
            whatHappened := '<< no message >>'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1477
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1478
        self warn:'The following problem was reported by cvs:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1479
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1480
' , whatHappened , '
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1481
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1482
The class has NOT been checked into the repository.'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1483
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1484
       'CVSSourceCodeManager [error]: cannot checkin modified class source' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1485
        logTmp notNil ifTrue:[logTmp remove].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1486
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1487
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1488
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1489
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1490
    logTmp notNil ifTrue:[logTmp remove].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1491
    (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1492
        whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1493
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1494
        whatHappened := nil
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1495
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1496
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1497
    tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1498
    cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1499
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1500
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1501
    "/ fetch the new revision nr as found in the commit commands output
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1502
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1503
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1504
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1505
        'CVSSourceCodeManager [error]: unexpected empty checkin command output' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1506
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1507
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1508
        idx := whatHappened indexOfLineStartingWith:'new revision:'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1509
        idx == 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1510
            'CVSSourceCodeManager [error]: unexpected checkin command output (no new-revision info)' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1511
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1512
            l := whatHappened at:idx.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1513
            newRevision := (l copyFrom:14 to:(l indexOf:$; startingAt:14)-1) withoutSpaces.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1514
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1515
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1516
    ^ true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1517
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1518
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1519
checkinClass:cls fileName:classFileName directory:packageDir module:moduleDir source:sourceFileName logMessage:logMessage force:force
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1520
    "enter a classes source code (which has been already filed out into sourceFileName)
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1521
     into the source repository. If the force argument is true, no merge is done;
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1522
     instead, the code is checked in as given (Dangerous).
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1523
     Return true if ok, false if not."
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1524
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1525
    |tempdir cmd checkoutName logMsg revision logTmp 
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
  1526
     cmdOut whatHappened s entry idx changeLog changesAsLogged l 
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1527
     newRevision newString binRevision className msg answer didMerge
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1528
     mySource mergedSource modulePath time 
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  1529
     editor checkInRepaired didAccept emphasizedText repairedText out 
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  1530
     emSep comment how|
814
58fbd75117a2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 811
diff changeset
  1531
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1532
    className := cls name.
938
e6fef2babac9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1533
    cls isPrivate ifTrue:[
e6fef2babac9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1534
        self error:'refuse to check in private classes.'.
e6fef2babac9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1535
    ].
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1536
    revision := cls revision.
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1537
    revision isNil ifTrue:[ 
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1538
        force ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1539
            ('CVSSourceCodeManager [warning]: class ' , className, ' has no revision string') errorPrintCR.
1138
aa7687ec256f implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  1540
            (cls theMetaclass includesSelector:#version) ifTrue:[
1074
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1541
                answer := Dialog 
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1542
                            confirm:('Class %1 has no (usable) revision string.\\Check in as newest ?' bindWith:className) withCRs
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1543
                            noLabel:'Cancel'.
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1544
            ] ifFalse:[
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1545
                answer := OptionBox 
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1546
                            request:('Class %1 has no revision string.\\Check in as newest ?' bindWith:className) withCRs
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1547
                            label:'Confirm'
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1548
                            buttonLabels:#('Cancel' 'CheckIn' 'Create & CheckIn') 
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1549
                            values:#(false #checkIn #create)
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1550
                            default:#create.
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1551
            ].
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1552
            answer == false ifTrue:[ ^ false ].
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1553
            answer == #create ifTrue:[ 
69c3722f7238 ask if version method should be created (when checking in new ones)
Claus Gittinger <cg@exept.de>
parents: 1069
diff changeset
  1554
                cls theNonMetaclass updateVersionMethodFor:'$' , 'Header' , '$'.  "/ concatenated to avoid RCS expansion
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1555
            ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1556
        ]
995
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1557
    ] ifFalse:[
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1558
        (revision endsWith:$m) ifTrue:[
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1559
            "/ this class has already been checked in with a merge,
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1560
            "/ but not reloaded from the repository.
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1561
            "/ must use the original revision string.
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1562
            revision := revision copyWithoutLast:1.
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1563
        ]
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1564
    ].
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1565
    (binRevision := cls binaryRevision) notNil ifTrue:[
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1566
        revision ~= binRevision ifTrue:[
1126
692db45edbf4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1124
diff changeset
  1567
            ('CVSSourceCodeManager [info]: class ' , className , ' is based upon ' , binRevision , ' but has revision ' , (revision ? '?')) infoPrintCR
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1568
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1569
    ].
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1570
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1571
    revision isNil ifTrue:[
208
943b0ed2fa1d use newestRevision if checking into an existing container AND class has no valid info
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
  1572
        revision := self newestRevisionOf:cls.
943b0ed2fa1d use newestRevision if checking into an existing container AND class has no valid info
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
  1573
        revision isNil ifTrue:[
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1574
            force ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1575
                revision := self newestRevisionInFile:classFileName directory:packageDir module:moduleDir.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1576
            ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1577
                revision := '1.0'
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1578
            ]
208
943b0ed2fa1d use newestRevision if checking into an existing container AND class has no valid info
Claus Gittinger <cg@exept.de>
parents: 195
diff changeset
  1579
        ]
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1580
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1581
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1582
    logMsg := logMessage.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1583
    (logMsg isNil or:[logMsg isEmpty]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1584
        logMsg := 'checkin from browser'.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1585
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1586
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1587
    cmdOut := Filename newTemporary.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1588
    cmdOut exists ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1589
        cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1590
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1591
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1592
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1593
    "/ in CVS, we have to checkout the file first, in order
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1594
    "/ to get up-to-date CVS entries, and also to be able to merge in
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1595
    "/ other users changes.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1596
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1597
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1598
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1599
    "/ first, create a temporary work tree
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1600
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1601
    tempdir := self createTempDirectory:nil forModule:nil.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  1602
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1603
        ('CVSSourceCodeManager [error]: no tempDir - cannot checkin ' , className) errorPrintCR.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  1604
        ^ false
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  1605
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1606
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1607
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1608
    "/ next, create CVS/Entries and CVS/Repository with version information of current version
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1609
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1610
    modulePath :=  moduleDir , '/' , packageDir. 
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1611
    checkoutName :=  modulePath , '/' , classFileName.
166
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1612
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1613
    "/
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1614
    "/ correct our current time, so that converting it will give us UTC
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1615
    "/
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1616
    time := AbsoluteTime now subtractSeconds:1.
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1617
    time := time addSeconds:(time utcOffset).
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1618
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1619
    self createEntryFor:checkoutName 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1620
         module:moduleDir
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1621
         in:(tempdir construct:modulePath) 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1622
         revision:revision
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1623
         date:(self cvsTimeString:time)
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1624
         special:''
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1625
         overwrite:true.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1626
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1627
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1628
    "/ copy-over our current version
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1629
    "/
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  1630
    Object errorSignal handle:[:ex|
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1631
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1632
        'CVSSourceCodeManager [error]: cannot copy-over filedOut class source' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1633
        ^ false.
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  1634
    ] do:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1635
        sourceFileName asFilename copyTo:(tempdir construct:checkoutName).
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1636
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1637
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1638
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1639
    "/ synchronize i.e. merge in any changes
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1640
    "/
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1641
    self activityNotification:'merging ' , cls name , ' with repository version ...'.
159
b66f0e62b312 activity notifications added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1642
738
f4e54d4f3ea5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1643
    cmd := 'update ', classFileName, ' >', cmdOut name.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1644
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1645
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1646
        module:moduleDir
738
f4e54d4f3ea5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1647
        inDirectory:((tempdir construct:moduleDir) constructString:packageDir)
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1648
    ) ifFalse:[
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1649
        force ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1650
            'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1651
            tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1652
            cmdOut remove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1653
            'CVSSourceCodeManager [error]: cannot merge current source with repository version' errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1654
            ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1655
        ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1656
    ] ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1657
        "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1658
        "/ check what happened - the contents of the cmdOut file may be:
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1659
        "/   empty   -> nothing changed
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1660
        "/   M xxx   -> merged-in changes from other users
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1661
        "/   C xxx   -> a conflict occured and the differences have been merged into the source
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1662
        "/              needs special action
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1663
        "/
719
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  1664
        (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1665
            whatHappened := cmdOut contentsOfEntireFile asString.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1666
        ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1667
    ].
380
b339513da159 ignore short files in cache;
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
  1668
    cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1669
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1670
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1671
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1672
        "/ no change
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1673
        "/
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1674
"/        Transcript showCR:'no change in ' , className , ' (repository unchanged)'.
188
191e0970f405 copy file for mod-time
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
  1675
        tempdir recursiveRemove.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1676
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1677
        force ifFalse:[
1094
40729be38885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1678
"/            (ChangeSet current includesChangeForClass:cls) ifTrue:[
40729be38885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1679
"/                (self confirm:('Nothing changed in %1 (repository unchanged).\\Remove entries from changeSet ?' bindWith:className) withCRs) ifTrue:[
40729be38885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1680
"/                    ChangeSet current condenseChangesForClass:cls.
40729be38885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1681
"/                ].
40729be38885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1682
"/            ] ifFalse:[
40729be38885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1683
                self information:('Nothing changed in %1 (repository unchanged)' bindWith:className).
40729be38885 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1091
diff changeset
  1684
"/            ].
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1079
diff changeset
  1685
            self postCheckInClass:cls.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1686
        ] ifTrue:[
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1687
            changeLog := self revisionLogOfContainerclassFileName directory:packageDir module:moduleDir.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1688
            (changeLog isNil or:[(changeLog at:#revisions) size ~~ 1]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1689
                'CVSSourceCodeManager [error]: failed to update revisionString (no log)' errorPrintCR.
522
2eab45532246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
  1690
                cls updateVersionMethodFor:'$' , 'Header' , '$'.  "/ concatenated to avoid RCS expansion
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1691
            ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1692
                entry := (changeLog at:#revisions) first.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1693
                newString := self revisionStringFromLog:changeLog entry:entry forClass:cls.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1694
                cls updateVersionMethodFor:newString.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1695
                cls revision ~= newRevision ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1696
                    'CVSSourceCodeManager [error]: failed to update revisionString' errorPrintCR
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1697
                ]
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1698
            ]
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1699
        ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1700
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1701
        ^ true
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1702
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1703
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1704
    Verbose == true ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
  1705
        ('CVSMGR: result is: ' , whatHappened) infoPrintCR.
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1706
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1707
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1708
    force ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1709
        revision isNil ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1710
            changeLog := self revisionLogOf:cls.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1711
        ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1712
            changeLog := self revisionLogOf:cls fromRevision:(self revisionAfter:revision) toRevision:nil.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1713
        ].
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1714
        changeLog notNil ifTrue:[
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1715
            s := WriteStream on:String new.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1716
            self writeRevisionLogMessagesFrom:changeLog withHeader:false to:s.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1717
            changesAsLogged := s contents.
725
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1718
        ] ifFalse:[
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1719
            "/ mhmh - that should not happen
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1720
            changesAsLogged := ''.
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1721
        ].
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1722
    ].
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1723
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1724
    didMerge := false.
1002
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  1725
    checkInRepaired := false.
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1726
726
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1727
    "/
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1728
    "/ cvs above rel10 returns a multiline info ...
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1729
    "/ we have to extract the one line which states what happened.
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1730
    "/
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1731
    whatHappened := whatHappened asCollectionOfLines asStringCollection.
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1732
    whatHappened := whatHappened select:[:line |
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1733
                        (line startsWith:'RCS file') not
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1734
                        and:[(line startsWith:'retrieving') not
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1735
                        and:[(line startsWith:'Merging') not
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1736
                        and:[line size > 0]]]
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1737
                    ].
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1738
    whatHappened := whatHappened asString.
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1739
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1740
    (force or:[whatHappened startsWith:'M ']) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1741
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1742
        "/ merged in changes
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1743
        "/
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1744
        (force 
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1745
        or:[changeLog isNil 
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1746
        or:[(changeLog at:#revisions) isEmpty]]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1747
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1748
            "/ pretty good - nothing has changed in the meanwhile
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1749
            "/
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1750
            Transcript showCR:'checking in ' , className , ' ...'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1751
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1752
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1753
            "/ someone else has changed things in the meanwhile, but there is no conflict
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1754
            "/ and version have been merged.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1755
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1756
            didMerge := true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1757
            changesAsLogged := changesAsLogged asCollectionOfLines.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1758
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1759
            s := WriteStream on:String new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1760
            cls fileOutOn:s withTimeStamp:false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1761
            mySource := s contents asString.
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1762
            mergedSource := (tempdir construct:checkoutName) readStream contents asString.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1763
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1764
            mySource = mergedSource ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1765
                msg := 'The source of ' , className , ' has been changed in the meanwhile as listed below.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1766
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1767
I have merged your version with the newest repository version, 
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1768
and found no differences between the result and your current version
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1769
(i.e. your version seemed up-to-date).'.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1770
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1771
                self checkinTroubleDialog:'Merging versions'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1772
                               message:msg 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1773
                               log:changesAsLogged
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1774
                               abortable:false 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1775
                               option:nil.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1776
                didMerge := false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1777
            ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1778
                msg := 'The source of ' , className , ' has been changed in the meanwhile as listed below.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1779
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1780
If you continue, your new changes (based upon rev. ' , revision printString , ') will be MERGED
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1781
into the newest revision. This will combine the other version with your changes
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1782
into a new common revision which may be different from both. 
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1783
Although this is a nice feature, it may fail to create the expected result in certain situations. 
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1784
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1785
You should carefully check the result - by comparing the current version with the
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1786
most recent version in the repository. If that does not contain an acceptable version,
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1787
change methods as required and check in again. 
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1788
Be aware, that after that, the actual repository version is different from your current classes,
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1789
and you should update your class from the repository.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1790
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1791
Continue ?'.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1792
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1793
                answer := self checkinTroubleDialog:'Merging versions'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1794
                               message:msg 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1795
                               log:changesAsLogged
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1796
                               abortable:true
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1797
                               option:'stop - see first'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1798
                answer ~~ true ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1799
                    answer == #option ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1800
                        DiffTextView 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1801
                            openOn:mySource
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1802
                            label:'current version'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1803
                            and:mergedSource
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1804
                            label:'merged version'.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1805
                            
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1806
                    ].
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1807
                    Transcript showCR:'checkin aborted - (no merge; repository unchanged)'.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1808
                    tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1809
                    ^ false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1810
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1811
            ].
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1812
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1813
"/                changesAsLogged := (changesAsLogged asStringCollection collect:[:line | line withTabsExpanded]) asString.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1814
"/                msg := 'The source of ' , className , ' has been changed in the meanwhile as follows:
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1815
"/' , changesAsLogged , '
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1816
"/
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1817
"/If you continue, your new changes (based upon rev. ' , revision , ') will be MERGED
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1818
"/into the newest revision. This will combine the other version with your changes
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1819
"/into a new common revision which is different from both. 
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1820
"/Although convenient, it may fail to create the expected result in certain situations. 
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1821
"/
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1822
"/You should carefully check the result - by comparing the current version with the
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1823
"/most recent version in the repository. If that does not contain an acceptable version,
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1824
"/change methods as required and check in again. Be aware, that the actual repository version
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1825
"/is different from your current classes.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1826
"/
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1827
"/Continue ?'.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1828
"/                (self confirm:msg) ifFalse:[
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1829
"/                    Transcript showCR:'checkin aborted - (no merge; repository unchanged)'.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1830
"/                    tempdir recursiveRemove.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1831
"/                    ^ false.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1832
"/                ].
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1833
            Transcript showCR:'checking in ' , className , ' (merged other changes) ...'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1834
        ]
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1835
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1836
        (whatHappened startsWith:'C ') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1837
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1838
            "/ conflict; someone else checked in something in the meanwhile,
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1839
            "/ and there is a conflict between this version and the checked in version.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1840
            "/
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1841
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1842
            changesAsLogged := changesAsLogged asCollectionOfLines.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1843
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1844
            msg := 'The source of ' , className , ' has been changed in the meanwhile as listed below.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1845
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1846
Your new changes (based upon rev. ' , revision printString , ') CONFLICT with those changes.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1847
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1848
You should fix things by comparing your class with the most recent repository version
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1849
and change your methods avoiding conflicts. The checkin again.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1850
'.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1851
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1852
            answer := self checkinTroubleDialog:'Version conflict'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1853
                 message:msg 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1854
                 log:changesAsLogged
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1855
                 abortable:false
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1856
                 option:'show conflicts'
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1857
                 option2:'resolve conflicts'.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1858
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1859
            answer == #option ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1860
                "/
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1861
                "/ show conflicts in a 3-way DiffTextView ...
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1862
                "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1863
                Diff3TextView
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1864
                    openOnMergedText:(tempdir construct:checkoutName) readStream contents 
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1865
                    label:'your version (checkin attempt)' 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1866
                    label:'original (base version)' 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1867
                    label:'newest repository version'. 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1868
            ].
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1869
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1870
            answer == #option2 ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1871
                "/
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1872
                "/ allow checkin of repair version
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1873
                "/ this is error prone ...
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1874
                "/
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1875
                "/
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1876
                "/ show merged version in an editor ...
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1877
                "/ ... accept will check it in.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1878
                "/
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1879
                emphasizedText := (tempdir construct:checkoutName) readStream contents.
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1880
                emSep := (Array with:(#color->Color black)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1881
                             with:(#backgroundColor->Color green)).
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1882
                emphasizedText := Diff3TextView 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1883
                            emphasizeMergedDiff3Text:emphasizedText 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1884
                            emphasize1:(Array with:(#color->Color white)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1885
                                              with:(#backgroundColor->Color blue))
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1886
                            emphasize2:(Array with:(#color->Color white)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1887
                                              with:(#backgroundColor->Color red))
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1888
                            emphasizeSep:emSep.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1889
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1890
                comment := 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1891
'"/ ***************************************************************
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1892
"/ This text contains your current versions code (blue)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1893
"/ merged with the conflicting code as found in the repository (red) which resulted
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1894
"/ from some other checkin.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1895
"/ Each such conflict is surrounded by green text (like this paragraph).
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1896
"/ 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1897
"/ Please have a look at ALL the conflicts and fix things as appropriate.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1898
"/ Delete the green lines as a confirmation - I will not checkin the changed text,
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1899
"/ unless no more green parts are present. This includes this comment at the top.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1900
"/ ***************************************************************
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1901
'.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1902
                comment := (Text string:comment emphasis:emSep) asStringCollection.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1903
                emphasizedText := comment , emphasizedText.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1904
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1905
                didAccept := false. checkInRepaired := true.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1906
                [didAccept not and:[checkInRepaired]] whileTrue:[
692
61505992de88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1907
                    editor := RCSConflictEditTextView 
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1908
                                setupWith:emphasizedText
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1909
                                title:'Resolve conflicts in ' , className , ', then accept & close to checkin'.    
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1910
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1911
                    editor acceptAction:[:dummy |
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1912
                        repairedText := editor list.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1913
                        didAccept := true.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1914
                    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1915
                    didAccept := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1916
                    editor topView openModal.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1917
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1918
                    didAccept ifFalse:[
854
36ce711b8568 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 847
diff changeset
  1919
                        (Dialog confirm:'You did not accept the new text. Edit again ?')
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1920
                        ifFalse:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1921
                            checkInRepaired := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1922
                        ]
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1923
                    ] ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1924
                        "/ check if all green-stuff (separators) have been removed
578
e1fe2e232555 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
  1925
                        (repairedText findFirst:[:line | line notNil and:[line notEmpty and:[(line emphasisAt:1) = emSep]]]) ~~ 0 ifTrue:[
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1926
                            self warn:'You have to look at ALL conflicts, and remove ALL green lines as a confirmation !!'.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1927
                            didAccept := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1928
                        ]
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1929
                    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1930
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1931
                ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1932
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1933
                checkInRepaired ifTrue:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1934
                    out := (tempdir construct:checkoutName) writeStream.
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1935
                    out isNil ifTrue:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1936
                        self warn:'could not write file ' , (tempdir constructString:checkoutName).
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1937
                        checkInRepaired := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1938
                    ] ifFalse:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1939
                        out nextPutAll:(repairedText asString string).
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1940
                        didAccept := true.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1941
                        out close.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1942
                    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1943
                ]
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1944
            ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1945
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1946
            checkInRepaired ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1947
                Transcript showCR:'checking in ' , className , ' (manually repaired version) ...'
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1948
            ] ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1949
                'CVSSourceCodeManager [warning]: cannot (for now) checkin; conflicts found' infoPrintCR.
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1950
                Transcript showCR:'checkin of ' , className , ' aborted (conflicting changes; repository unchanged)'.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1951
                tempdir recursiveRemove.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1952
                ^ false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1953
            ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1954
        ] ifFalse:[
1047
e78a6ee0e77c treat P(atch)-rsponse from cvs like U(pdate)-response
ps
parents: 1037
diff changeset
  1955
            ((whatHappened startsWith:'U ') 
e78a6ee0e77c treat P(atch)-rsponse from cvs like U(pdate)-response
ps
parents: 1037
diff changeset
  1956
            or:[ (whatHappened startsWith:'P ') ]) ifTrue:[
629
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1957
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1958
                "/ nothing changed here, but the repository already contains
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1959
                "/ a newer version.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1960
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1961
                tempdir recursiveRemove.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1962
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1963
                self information:'nothing changed in your ''' , className , ''';
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1964
but repository already contains a newer version (repository unchanged).'.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1965
                ^ true.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1966
            ] ifFalse:[
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1967
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1968
                "/ unexpected
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1969
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1970
                self warn:'unexpected message from CVS:
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1971
' , whatHappened , '
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1972
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1973
No checkin performed.'.
629
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1974
                Transcript showCR:'*** cannot checkin ' , className , ' (unexpected CVS response; repository unchanged)'.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1975
                tempdir recursiveRemove.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1976
                ^ false.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1977
            ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1978
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1979
    ].
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1980
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1981
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1982
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1983
    "/ now check it in again
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1984
    "/
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1985
    self activityNotification:'saving ' , cls name , ' in repository ...'.
159
b66f0e62b312 activity notifications added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1986
152
56747cda83bd escape doubleQuote with backslash in log message
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
  1987
    logMsg := logMsg replChar:$"  withString:'\"'.
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  1988
711
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1989
    OperatingSystem isUNIXlike ifFalse:[
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1990
        "/ save the log message into another tempFile ...
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1991
        logTmp := Filename newTemporaryIn:tempdir.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1992
        s := logTmp writeStream.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1993
        s nextPutAll:logMsg.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1994
        s close.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1995
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1996
        cmd := 'commit -F "', logTmp baseName, '" ', checkoutName, ' >', cmdOut name.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1997
    ] ifTrue:[
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1998
        "/
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1999
        "/ CVS up to V1.9.14 prints the 'new revision' to stderr,
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  2000
        "/ CVS V1.9.16 to stdout.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  2001
        "/
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  2002
        cmd := 'commit -m "', logMsg, '" ', checkoutName, ' >', cmdOut name , ' 2>&1'.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  2003
    ].
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2004
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2005
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2006
        module:moduleDir
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2007
        inDirectory:tempdir name
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2008
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2009
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2010
719
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  2011
        (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2012
            whatHappened := cmdOut contentsOfEntireFile asString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2013
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2014
            whatHappened := '<< no message >>'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2015
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2016
        self warn:'The following problem was reported by cvs:
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2017
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2018
' , whatHappened , '
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2019
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2020
The class has NOT been checked into the repository.'.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2021
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2022
       'CVSSourceCodeManager [error]: cannot checkin modified class source' errorPrintCR.
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  2023
        logTmp notNil ifTrue:[logTmp remove].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2024
        cmdOut remove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2025
        tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2026
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2027
    ].
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  2028
    logTmp notNil ifTrue:[logTmp remove].
719
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  2029
    (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2030
        whatHappened := cmdOut contentsOfEntireFile asString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2031
    ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2032
        whatHappened := nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2033
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2034
166
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  2035
    tempdir recursiveRemove.
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  2036
    cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2037
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2038
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2039
    "/ fetch the new revision nr as found in the commit commands output
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2040
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2041
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2042
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2043
        'CVSSourceCodeManager [error]: unexpected empty checkin command output' errorPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2044
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2045
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2046
        idx := whatHappened indexOfLineStartingWith:'new revision:'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2047
        idx == 0 ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2048
            'CVSSourceCodeManager [error]: unexpected checkin command output (no new-revision info)' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2049
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2050
            l := whatHappened at:idx.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2051
            newRevision := (l copyFrom:14 to:(l indexOf:$; startingAt:14)-1) withoutSpaces.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2052
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2053
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2054
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2055
    "/
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2056
    "/ if there was no merge (i.e. the current version has been checked in unchanged):
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2057
    "/   patch the classes revisionInfo (but keep binaryRevision unchanged) to the new revision
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2058
    "/   this makes everyone here believe, that the incore version of the class is based upon
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2059
    "/   the newly checked in version.
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2060
    "/   (however, the binaryRevision must remain as it is - we will need it to fetch the sourceCode
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2061
    "/    correctly for all unchanged methodss)
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2062
    "/
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2063
    "/ if there was a merge (i.e. the repository now contains a merge of the current and some
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2064
    "/ other version):
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2065
    "/    patch the classes revisionInfo (again, keep the binaryRevision) to the old revision
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2066
    "/    and add a 'm' (for merged).
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  2067
    "/    If we later checkin again, the new checkin will be again based on the current revision
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2068
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2069
    newRevision notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2070
        didMerge ifFalse:[
211
da3daf8c87d7 show class name in activity notification
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
  2071
            self activityNotification:'fetch new revision number of ', cls name.
159
b66f0e62b312 activity notifications added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  2072
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2073
            changeLog := self revisionLogOf:cls fromRevision:newRevision toRevision:newRevision.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2074
            (changeLog isNil or:[(changeLog at:#revisions) size ~~ 1]) ifTrue:[
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2075
                force ifTrue:[
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2076
                    changeLog := self revisionLogOfContainer:classFileName directory:packageDir module:moduleDir.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2077
                ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2078
            ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2079
            (changeLog isNil or:[(changeLog at:#revisions) size ~~ 1]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2080
                'CVSSourceCodeManager [error]: failed to update revisionString (no log)' errorPrintCR.
522
2eab45532246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
  2081
                cls updateVersionMethodFor:'$' , 'Header' , '$'.  "/ concatenated to avoid RCS expansion
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2082
            ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2083
                entry := (changeLog at:#revisions) first.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  2084
                newString := self revisionStringFromLog:changeLog entry:entry forClass:cls.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2085
                cls updateVersionMethodFor:newString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2086
                cls revision ~= newRevision ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2087
                    'CVSSourceCodeManager [error]: failed to update revisionString' errorPrintCR
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2088
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2089
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2090
        ] ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2091
            newString := self updatedRevisionStringOf:cls forRevision:nil with:cls revisionString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2092
            cls updateVersionMethodFor:newString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2093
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2094
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2095
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2096
    Class addChangeRecordForClassCheckIn:cls.
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1079
diff changeset
  2097
    self postCheckInClass:cls.
1002
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2098
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2099
    checkInRepaired ifTrue:[
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2100
        self information:'Now the repository contains a merge between your and the other changes.
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2101
However, the class in your image does NOT contain the other changes.
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2102
This will lead to more conflict-resolving whenever you check this class in again later,
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2103
unless you load the newest (merged) version of the class from the repository.
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2104
1003
4f1191f69a45 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1002
diff changeset
  2105
I recomment doing this as soon as possible via your browsers checkout function.'
1002
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2106
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2107
    ^ true
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2108
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2109
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2110
     SourceCodeManager checkinClass:Array logMessage:'testing only'
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2111
    "
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2112
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  2113
    "Created: / 11.9.1996 / 16:16:11 / cg"
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  2114
    "Modified: / 26.2.1998 / 17:34:16 / stefan"
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1079
diff changeset
  2115
    "Modified: / 5.11.2001 / 14:35:38 / cg"
115
b37d7975d9e2 fully update revisionMethod when checking in
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
  2116
!
b37d7975d9e2 fully update revisionMethod when checking in
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
  2117
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2118
checkoutModule:aModule package:aPackage andDo:aBlock
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2119
    "check out everything from a package into a temporary directory.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2120
     Then evaluate aBlock, passing the name of that temp-directory.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2121
     Afterwards, the tempDir is removed.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2122
     Return true, if OK, false if any error occurred."
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2123
1136
6ebfad528813 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  2124
    |cvsRoot containers moduleDir packageDir tempdir cmdOut cmd dirName listOfFiles|
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2125
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2126
    cvsRoot := self getCVSROOTForModule:aModule.
1136
6ebfad528813 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  2127
    cvsRoot isNil ifTrue:[^ false ].
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2128
1049
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2129
    aPackage notNil ifTrue:[
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2130
        dirName := aModule , '/' , aPackage.
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2131
    ] ifFalse:[
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2132
        dirName := aModule.
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2133
    ].
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2134
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2135
    self activityNotification:'checking out everything in ' , dirName , ' ...'.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2136
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2137
    tempdir := self createTempDirectory:nil forModule:nil.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2138
    tempdir isNil ifTrue:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2139
        ('CVSSourceCodeManager [error]: no tempDir - cannot checkout') errorPrintCR.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2140
        ^ false
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2141
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2142
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2143
    cmd := '-l checkout ', dirName.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2144
    OperatingSystem isUNIXlike ifTrue:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2145
        "/ can redirect output
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2146
        cmdOut := Filename newTemporary.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2147
        cmdOut exists ifTrue:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2148
            cmdOut remove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2149
        ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2150
        cmd := cmd , ' > ' , cmdOut name.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2151
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2152
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2153
    (self 
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2154
        executeCVSCommand:cmd 
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2155
        module:aModule
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2156
        inDirectory:tempdir name
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2157
    ) ifFalse:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2158
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2159
        cmdOut notNil ifTrue:[cmdOut remove].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2160
        tempdir recursiveRemove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2161
        ^ false
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2162
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2163
1136
6ebfad528813 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  2164
    cmdOut notNil ifTrue:[
6ebfad528813 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  2165
"/        listOfFiles := cmdOut contents.
6ebfad528813 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  2166
        cmdOut remove
6ebfad528813 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  2167
    ].
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2168
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2169
    packageDir := (tempdir construct:dirName).
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2170
    (packageDir exists 
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2171
    and:[packageDir isDirectory]) ifFalse:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2172
        'CVSSourceCodeManager [error]: checkout failed (no dir)' errorPrintCR.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2173
        tempdir recursiveRemove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2174
        ^ false
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2175
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2176
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2177
    "/ now, invoke the block ...
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2178
    [
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2179
        aBlock value:packageDir
761
1501e74c5791 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 760
diff changeset
  2180
    ] valueNowOrOnUnwindDo:[
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2181
        tempdir recursiveRemove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2182
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2183
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2184
    ^ true
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2185
761
1501e74c5791 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 760
diff changeset
  2186
    "Modified: / 28.4.1999 / 12:21:10 / cg"
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2187
!
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2188
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2189
streamForClass:cls fileName:fileName revision:revision directory:packageDir module:moduleDir cache:cacheIt
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2190
    "extract a source file and return an open readStream on it,
477
3c3871b54d57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
  2191
     or nil if the extract failed. If revision is nil or (#newest), take
3c3871b54d57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
  2192
     the latest; otherwise, a specific revisions source is extracted.
3c3871b54d57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
  2193
     The cls argument is currently ignored, but may be used in future versions,
3c3871b54d57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
  2194
     to validate the correct container against the class."
107
2042ff680821 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 106
diff changeset
  2195
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
  2196
    |dir cachedSourceFilename cachedFile cmd fullName revisionArg stream
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2197
     checkoutDir checkoutName checkoutNameLocal fullTempName fullCachedName tempdir cmdOut
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2198
     classFileName cvsRoot tempFile|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2199
1130
5b3efe826dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
  2200
    (DisabledModules notNil and:[DisabledModules includes:moduleDir]) ifTrue:[
5b3efe826dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
  2201
        Transcript showCR:'cvs access for module ' , moduleDir , ' has been disabled (due to previous failure)'.
5b3efe826dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
  2202
        Transcript showCR:'reenable using the launchers source&debugger dialog'.
5b3efe826dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
  2203
5b3efe826dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
  2204
        ^ nil
5b3efe826dd4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1126
diff changeset
  2205
    ].
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2206
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2207
    cvsRoot := self getCVSROOTForModule:moduleDir.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2208
    cvsRoot isNil ifTrue:[^ nil].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2209
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2210
    "/ if not already existing, create a cache directory
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2211
    "/ where we deposit sources.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2212
    "/ this is used as a cache for further requests, since
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2213
    "/ accessing the repository may be slow.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2214
    "/ (if cvs uses a remote connection via ppp, for example)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2215
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2216
836
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2217
    revision ~~ #newest ifTrue:[
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2218
        (dir := self sourceCacheDirectory) isNil ifTrue:[
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2219
            'CVSSourceCodeManager [warning]: no source cache directory' errorPrintCR.
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2220
        ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2221
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2222
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2223
    classFileName := fileName.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2224
    (classFileName endsWith:',v') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2225
        classFileName := classFileName copyWithoutLast:2.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2226
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2227
    (classFileName endsWith:'.st') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2228
        classFileName := classFileName copyWithoutLast:3.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2229
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2230
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2231
    fullName := moduleDir , '/' , packageDir , '/' , classFileName , '.st'.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2232
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2233
    (revision isNil or:[revision == #newest]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2234
        cachedSourceFilename := classFileName.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2235
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2236
        cachedSourceFilename := classFileName , '_' , revision.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2237
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2238
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2239
    dir notNil ifTrue:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  2240
        cachedFile := dir construct:cachedSourceFilename.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2241
        cachedFile exists ifTrue:[
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2242
            cachedFile fileSize < 10 ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2243
                ('CVSSourceCodeManager [warning]: existing: ', cachedFile name , ' seems corrupted.') errorPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2244
                cachedFile remove
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2245
            ] ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2246
"/            ('CVSSourceCodeManager [info]: found existing: ', cachedFile name) infoPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2247
                ^ cachedFile readStream
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2248
            ]
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2249
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2250
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2251
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2252
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2253
    "/ first, create a temporary work tree
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  2254
    "/ Do not make module and package directories, their existence cause cvs checkout to fail in server mode
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2255
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  2256
    tempdir := self createTempDirectory:nil forModule:nil.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2257
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2258
        ('CVSSourceCodeManager [error]: no tempDir - cannot checkout ' , classFileName) errorPrintCR.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2259
        ^ nil
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2260
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2261
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2262
"/    tempdir := Filename newTemporaryIn:nil.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2263
"/    tempdir exists ifTrue:[
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2264
"/        tempdir recursiveRemove.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2265
"/    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2266
"/    tempdir makeDirectory.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2267
"/    dir := tempdir construct:moduleDir.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2268
"/    dir makeDirectory.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2269
"/    dir := dir construct:packageDir.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2270
"/    dir recursiveMakeDirectory.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2271
"/    dir exists ifFalse:[
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2272
"/        tempdir recursiveRemove.
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
  2273
"/        'CVSMGR: cannot create temporary directory' infoPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2274
"/        ^ nil.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2275
"/    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2276
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2277
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2278
    "/ check it out there
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2279
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2280
    checkoutDir :=  moduleDir , '/' , packageDir.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2281
    checkoutName :=  checkoutDir , '/' , classFileName , '.st'.
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2282
    checkoutNameLocal := (moduleDir asFilename construct:packageDir) constructString:(classFileName , '.st').
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2283
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2284
    (revision isNil or:[revision == #newest]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2285
        cachedSourceFilename := classFileName.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2286
        revisionArg := ''.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2287
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2288
        cachedSourceFilename := classFileName , '_' , revision.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2289
        revisionArg := ' -r ' , revision.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2290
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2291
175
5eeed09f625c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 171
diff changeset
  2292
    self activityNotification:'checking out source ' , checkoutName.
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2293
    OperatingSystem isUNIXlike ifTrue:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2294
        "/ can redirect output
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2295
        cmdOut := Filename newTemporary.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2296
        cmdOut exists ifTrue:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2297
            cmdOut remove.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2298
        ].
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2299
        cmd := '-l checkout' , revisionArg , ' ', checkoutName , ' > ' , cmdOut name.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2300
    ] ifFalse:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2301
        cmd := '-l checkout' , revisionArg , ' ', checkoutName.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2302
    ].
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2303
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2304
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2305
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2306
        module:moduleDir
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2307
        inDirectory:tempdir name
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2308
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2309
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2310
        cmdOut notNil ifTrue:[cmdOut remove].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2311
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2312
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2313
        "/ see if there is CVS access at all ...
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2314
        (self checkForExistingModule:moduleDir) ifFalse:[
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2315
            "/ disable
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2316
            DisabledModules isNil ifTrue:[
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2317
                DisabledModules := Set new.
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2318
            ].
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2319
            DisabledModules add:moduleDir.
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2320
            ('CVSSourceCodeManager [warning]: disabled repository access for module ' , moduleDir) errorPrintCR.
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2321
        ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2322
        ^ nil.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2323
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2324
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2325
    cmdOut notNil ifTrue:[cmdOut remove].
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2326
    fullTempName := tempdir construct:checkoutNameLocal.
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2327
    fullCachedName := CacheDirectoryName asFilename constructString:cachedSourceFilename.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2328
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2329
    fullTempName exists ifFalse:[
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2330
        ('CVSSourceCodeManager [error]: failed to checkout ', fullTempName pathName, ' (file does not exists after cvs co)') errorPrintCR.
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2331
        tempdir recursiveRemove.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2332
        ^ nil
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2333
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2334
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2335
    (cacheIt 
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2336
    and:[cachedFile notNil
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2337
    and:[fullTempName exists]])
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2338
    ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2339
        (OperatingSystem errorSignal catch:[
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2340
            fullTempName moveTo:fullCachedName
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2341
        ]) ifTrue:[
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2342
            ('CVSSourceCodeManager [error]: failed to rename ', fullTempName pathName, ' to ', cachedSourceFilename) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2343
            tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2344
            ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2345
        ].
1067
35bc8c428c14 oops - cached stream
Claus Gittinger <cg@exept.de>
parents: 1064
diff changeset
  2346
        fullCachedName asFilename exists ifTrue:[
35bc8c428c14 oops - cached stream
Claus Gittinger <cg@exept.de>
parents: 1064
diff changeset
  2347
            stream := fullCachedName asFilename readStream.
35bc8c428c14 oops - cached stream
Claus Gittinger <cg@exept.de>
parents: 1064
diff changeset
  2348
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2349
    ] ifFalse:[
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2350
        OperatingSystem isUNIXlike ifFalse:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2351
            "/ cannot remove files which are still open ...
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2352
            "/ sigh - need a delete-on-close flag in FileStream.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2353
            "/
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2354
            tempFile := Filename newTemporary.
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2355
            fullTempName copyTo:tempFile.
706
5149cb0621bd use removeOnClose feature on non-unix systems.
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  2356
            stream := tempFile readStream.
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2357
            stream notNil ifTrue:[
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2358
                stream removeOnClose:true.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2359
            ].
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2360
        ] ifTrue:[
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2361
            stream := fullTempName readStream.
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2362
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2363
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2364
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2365
    self releaseAndRemove:tempdir module:moduleDir outputTo:nil. 
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2366
    ^ stream
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2367
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2368
    "Created: / 4.11.1995 / 19:46:20 / cg"
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2369
    "Modified: / 20.8.1997 / 16:37:11 / stefan"
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  2370
    "Modified: / 23.8.2001 / 12:28:59 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2371
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2372
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
  2373
!CVSSourceCodeManager class methodsFor:'source code administration'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2374
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2375
checkForExistingContainerInModule:moduleDir package:packageDir container:fileName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2376
    "check for a container to exist"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2377
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2378
    |fullName ret cvsRoot cmd tempDir|
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2379
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2380
    cvsRoot := self getCVSROOTForModule:moduleDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2381
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2382
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2383
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2384
    RemoteCVS ifFalse:[
1133
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2385
        cvsRoot asFilename exists ifTrue:[
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2386
            "/
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2387
            "/ with local CVS - simply check if that file exists
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2388
            "/
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2389
            (fullName endsWith:',v') ifFalse:[
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2390
                fullName := fullName , ',v'.
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2391
            ].
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2392
            ^ (cvsRoot , '/' , fullName) asFilename exists.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2393
        ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2394
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2395
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2396
    tempDir := self createTempDirectory:nil forModule:nil.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2397
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2398
    "With remote CVS, do a no-op rtag command, which doesn't
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2399
     need a working directory, but reports missing files"
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2400
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2401
    (fullName endsWith:',v') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2402
        fullName := fullName copyWithoutLast:2.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2403
    ].
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2404
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2405
    cmd := '-n rtag -l -F dummy '.
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2406
    [
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2407
        ret := self 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2408
                    executeCVSCommand:cmd , fullName 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2409
                    module:moduleDir 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2410
                    "/ cg; cannot do it in current dir, in case it contains a CVS subDirectory,
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2411
                    "/ with a different CVSRoot in its CVS/Root file ...
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2412
                    "/ cvs would complain then.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2413
                    inDirectory:(tempDir pathName) 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2414
                    log:false.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2415
    ] valueNowOrOnUnwindDo:[
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2416
        tempDir recursiveRemove.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2417
    ].
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2418
    ^ ret
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2419
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2420
    "
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2421
     CVSSourceCodeManager 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2422
        checkForExistingContainerInModule:'stx' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2423
        package:'libbasic' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2424
        container:'Integer.st'     
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2425
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2426
     CVSSourceCodeManager 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2427
        checkForExistingContainerInModule:'stx' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2428
        package:'libtool' 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2429
        container:'AboutBox.st'  
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2430
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2431
     CVSSourceCodeManager 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2432
        checkForExistingContainerInModule:'stx' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2433
        package:'libtool' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2434
        container:'AboutBox.st,v'     
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2435
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2436
     CVSSourceCodeManager 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2437
        checkForExistingContainerInModule:'stx' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2438
        package:'libtool' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2439
        container:'FooBar.st'  
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2440
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2441
     CVSSourceCodeManager 
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2442
        checkForExistingContainerInModule:'DPU' 
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2443
        package:'test' 
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2444
        container:'marks'  
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2445
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2446
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2447
    "Created: / 9.12.1995 / 19:13:37 / cg"
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2448
    "Modified: / 1.3.1999 / 19:32:55 / cg"
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2449
    "Modified: / 23.7.1999 / 17:36:58 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2450
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2451
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2452
checkForExistingModule:moduleDir
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2453
    "check for a module to exist"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2454
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2455
    |ret cvsRoot cmd tempDir|
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2456
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2457
    self activityNotification:'checking for existing module ' , moduleDir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2458
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2459
    cvsRoot := self getCVSROOTForModule:moduleDir.
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  2460
    cvsRoot isNil ifTrue:[^ false].
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2461
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2462
    RemoteCVS ifFalse:[
1133
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2463
        cvsRoot asFilename exists ifTrue:[
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2464
            "/
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2465
            "/ with local CVS - simply check if that directory exists
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2466
            "/
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2467
            ^ (cvsRoot , '/' , moduleDir) asFilename isDirectory.
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2468
        ]
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2469
    ].
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2470
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2471
    tempDir := self createTempDirectory:nil forModule:nil.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2472
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2473
    "With remote CVS, do a no-op rtag command, which doesn't
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2474
     need a working directory, but reports missing files"
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2475
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2476
    cmd := '-n rtag -l dummy '.
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2477
    [
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2478
        ret := self 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2479
                    executeCVSCommand:cmd , moduleDir 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2480
                    module:moduleDir
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2481
                    "/ cg; cannot do it in current dir, in case it contains a CVS subDirectory,
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2482
                    "/ with a different CVSRoot in its CVS/Root file ...
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2483
                    "/ cvs would complain then.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2484
                    inDirectory:(tempDir pathName) 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2485
                    log:false.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2486
    ] valueNowOrOnUnwindDo:[
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2487
        tempDir recursiveRemove.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2488
    ].
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2489
    ^ ret
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2490
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2491
    "
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2492
     CVSSourceCodeManager checkForExistingModule:'stx'
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2493
     CVSSourceCodeManager checkForExistingModule:'DPU'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2494
     CVSSourceCodeManager checkForExistingModule:'cg'  
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2495
     CVSSourceCodeManager checkForExistingModule:'aeg' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2496
     CVSSourceCodeManager checkForExistingModule:'foo'   
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2497
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2498
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2499
    "Created: / 9.12.1995 / 19:13:37 / cg"
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2500
    "Modified: / 1.3.1999 / 19:32:59 / cg"
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2501
    "Modified: / 23.7.1999 / 17:38:59 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2502
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2503
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2504
checkForExistingModule:moduleDir package:packageDir
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2505
    "check for a package to exist"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2506
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2507
    |fullName ret cvsRoot cmd tempDir|
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  2508
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2509
    self activityNotification:'checking for existing package ' , packageDir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2510
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  2511
    fullName := moduleDir , '/' , packageDir.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2512
    cvsRoot := self getCVSROOTForModule:moduleDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2513
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2514
    RemoteCVS ifFalse:[
1133
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2515
        cvsRoot asFilename exists ifTrue:[
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2516
            "/
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2517
            "/ with local CVS - simply check if that directory exists
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2518
            "/
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2519
            ^ (cvsRoot , '/' , fullName) asFilename isDirectory.
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  2520
        ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2521
    ].
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2522
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2523
    tempDir := self createTempDirectory:nil forModule:nil.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2524
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2525
    "With remote CVS, do a no-op rtag command, which doesn't
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2526
     need a working directory, but reports missing files"
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2527
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2528
    cmd := '-n rtag -l -F dummy '.
1117
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2529
    [
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2530
        ret := self 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2531
                    executeCVSCommand:cmd, fullName 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2532
                    module:moduleDir
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2533
                    "/ cg; cannot do it in current dir, in case it contains a CVS subDirectory,
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2534
                    "/ with a different CVSRoot in its CVS/Root file ...
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2535
                    "/ cvs would complain then.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2536
                    inDirectory:(tempDir pathName) 
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2537
                    log:false.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2538
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2539
    ] valueNowOrOnUnwindDo:[
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2540
        tempDir recursiveRemove.
403504d4d8d0 checkForExisting* fixed for WIN32.
Claus Gittinger <cg@exept.de>
parents: 1116
diff changeset
  2541
    ].
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2542
    ^ ret
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2543
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2544
    "
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2545
     CVSSourceCodeManager checkForExistingModule:'stx' package:'libbasic' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2546
     CVSSourceCodeManager checkForExistingModule:'aeg' package:'libProgram'  
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2547
     CVSSourceCodeManager checkForExistingModule:'foo' package:'libbasic' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2548
     CVSSourceCodeManager checkForExistingModule:'foo' package:'bar'   
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2549
     CVSSourceCodeManager checkForExistingModule:'cg' package:'private'   
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2550
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2551
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2552
    "Created: / 9.12.1995 / 19:13:37 / cg"
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2553
    "Modified: / 1.3.1999 / 19:33:04 / cg"
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2554
    "Modified: / 23.7.1999 / 17:39:21 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2555
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2556
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2557
createContainerFor:aClass inModule:moduleDir package:packageDir container:fileName
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2558
    "create a container - this does an initial checkin
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2559
     (i.e. cvs add & cvs commit)"
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2560
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2561
    |fullName tempdir checkoutName cmdOut cmd tempFile idx aStream whatHappened l newRevision
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2562
     changeLog entry newString startIdx endIdx checkInDir logTmp s|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2563
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2564
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2565
    cmdOut := Filename newTemporary.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2566
    cmdOut exists ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2567
        cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2568
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2569
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2570
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2571
    checkoutName :=  moduleDir , '/' , packageDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2572
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2573
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2574
    "/ first, check out everything there - this creates the CVS helpfiles
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2575
    "/ required later.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2576
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2577
193
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2578
    self activityNotification:'checking for directory ' , checkoutName.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2579
    tempdir := self createLocalDirectory:packageDir inModule:moduleDir.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2580
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2581
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2582
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2583
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2584
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2585
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2586
    "/ create the source there
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2587
    "/
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  2588
    tempFile := (tempdir construct:checkoutName) construct:fileName.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2589
    aStream := tempFile writeStream.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2590
    aStream isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2591
        ('CVSSourceCodeManager [error]: temporary fileout failed -> ', tempFile name) errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2592
        tempdir recursiveRemove.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2593
        ^ false
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2594
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2595
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2596
    Class fileOutErrorSignal handle:[:ex |
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2597
        'CVSSourceCodeManager [error]: fileout failed' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2598
        aStream close.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2599
        tempdir recursiveRemove.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2600
        ^ false
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2601
    ] do:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2602
        aClass fileOutOn:aStream withTimeStamp:false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2603
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2604
    aStream close.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2605
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2606
    tempFile exists ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2607
        'CVSSourceCodeManager [error]: temporary fileout failed' errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2608
        tempdir recursiveRemove.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2609
        ^ false
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2610
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2611
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2612
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2613
    "/ and add it to the repository
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2614
    "/
193
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2615
    self activityNotification:'adding ' , fileName.
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2616
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2617
    OperatingSystem isUNIXlike ifTrue:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2618
        checkInDir := tempdir constructString:checkoutName.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2619
    ] ifFalse:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2620
        OperatingSystem isMSDOSlike ifTrue:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2621
            checkInDir := tempdir constructString:(checkoutName copyReplaceAll:$/ with:$\).
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2622
        ] ifFalse:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
  2623
            self halt:'VMS case not yet implemented'. "/ add code for VMS ...
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2624
        ]
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2625
    ].
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2626
    cmd := 'add ' , fileName , ' > ' , cmdOut name.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2627
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2628
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2629
        module:moduleDir
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2630
        inDirectory:checkInDir
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2631
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2632
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2633
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2634
        cmdOut remove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2635
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2636
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2637
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2638
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2639
    cmdOut remove.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2640
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2641
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2642
    "/ commit
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2643
    "/
211
da3daf8c87d7 show class name in activity notification
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
  2644
    self activityNotification:'comitting ' , fileName.
193
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2645
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2646
    OperatingSystem isUNIXlike ifFalse:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2647
        "/ save the log message into another tempFile ...
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2648
        logTmp := Filename newTemporaryIn:checkInDir.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2649
        s := logTmp writeStream.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2650
        s nextPutAll:'initial checkin'.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2651
        s close.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2652
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2653
        cmd := 'commit -F "', logTmp baseName, '" ', fileName, ' >', cmdOut name.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2654
    ] ifTrue:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2655
        "/
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2656
        "/ CVS up to V1.9.14 prints the 'new revision' to stderr,
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2657
        "/ CVS V1.9.16 to stdout.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2658
        "/
841
a026be83dc21 output a message to the transcript, when adding a new container.
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  2659
        cmd := 'commit -m "initial checkin" ' , fileName , ' > ' , cmdOut name, ' 2>&1'.
719
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  2660
    ].
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  2661
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2662
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2663
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2664
        module:moduleDir
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2665
        inDirectory:checkInDir "tempdir name"
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2666
    ) ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2667
        Verbose == true ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
  2668
            'CVSMGR: failed to execute: ' infoPrint. cmd infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2669
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2670
        cmdOut fileSize > 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2671
            whatHappened := cmdOut contentsOfEntireFile asString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2672
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2673
            whatHappened := '<< no message >>'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2674
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2675
        self warn:'The following problem was reported by cvs:
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2676
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2677
' , whatHappened , '
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2678
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2679
The class has NOT been checked into the repository.'.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2680
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2681
       'CVSSourceCodeManager [error]: cannot checkin modified class source' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2682
        cmdOut remove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2683
        tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2684
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2685
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2686
    whatHappened := cmdOut contentsOfEntireFile asString.
605
db13f9acfdc3 oops - temporary file was not removed in createContainer
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
  2687
    cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2688
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2689
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2690
    "/ release it towards cvs
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2691
    "/
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2692
    self releaseAndRemove:tempdir module:moduleDir outputTo:nil. 
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2693
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2694
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2695
    "/ good - its in the CVS repository; now, we need the updated RCS header
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2696
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2697
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2698
        'CVSSourceCodeManager [warning]: unexpected empty commit command output' errorPrintCR.
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2699
        "/ TODO: scan the file for $Header ...
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2700
        "/ and extract the revision manually
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2701
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2702
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2703
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2704
        idx := whatHappened indexOfLineStartingWith:'initial revision:'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2705
        idx ~~ 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2706
            startIdx := 18
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2707
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2708
            idx := whatHappened indexOfLineStartingWith:'new revision:'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2709
            idx ~~ 0 ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2710
                'CVSSourceCodeManager [warning]: container existed before' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2711
                startIdx := 14.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2712
            ] ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2713
                'CVSSourceCodeManager [warning]: unexpected commit command output (no new-revision info)' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2714
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2715
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2716
        idx ~~ 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2717
            l := whatHappened at:idx.
628
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2718
            endIdx := (l indexOf:$; startingAt:startIdx) - 1.
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2719
            endIdx < 0 ifTrue:[
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2720
                endIdx := l size
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2721
            ].
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2722
            newRevision := (l copyFrom:startIdx to:endIdx) withoutSpaces.
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2723
            (Number fromString:newRevision onError:nil) isNil ifTrue:[
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2724
                newRevision := '1.1'
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2725
            ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2726
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2727
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2728
847
d2800baef050 checkin from browser
ca
parents: 841
diff changeset
  2729
    Transcript showCR:'created new sourceContainer for ' , aClass name , '.'.
841
a026be83dc21 output a message to the transcript, when adding a new container.
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  2730
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2731
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2732
    "/ patch the classes revisionInfo (but keep binaryRevision unchanged)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2733
    "/ this makes everyone here believe, that the incore version of the class is based upon
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2734
    "/ the newly checked in version.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2735
    "/ (however, the binaryRevision must remain as it is - we will need it to fetch the sourceCode
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2736
    "/  correctly for all unchanged methodss)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2737
    "/
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
  2738
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2739
    newRevision notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2740
        changeLog := self 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2741
                        revisionLogOf:aClass 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2742
                        fromRevision:newRevision 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2743
                        toRevision:newRevision
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2744
                        fileName:fileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2745
                        directory:packageDir
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2746
                        module:moduleDir.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
  2747
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2748
        (changeLog isNil or:[(changeLog at:#revisions) size ~~ 1]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2749
            'CVSSourceCodeManager [error]: failed to update revisionString (no log)' errorPrintCR
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2750
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2751
            entry := (changeLog at:#revisions) first.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  2752
            newString := self revisionStringFromLog:changeLog entry:entry forClass:aClass.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2753
            aClass updateVersionMethodFor:newString.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2754
            ('CVSSourceCodeManager [info]: updated revisionString to:',newString) infoPrintCR
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2755
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2756
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2757
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2758
    tempdir recursiveRemove.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  2759
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  2760
    Class addChangeRecordForClassCheckIn:aClass.
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1079
diff changeset
  2761
    self postCheckInClass:aClass.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2762
    ^ true
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2763
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  2764
    "Created: / 9.12.1995 / 19:13:37 / cg"
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2765
    "Modified: / 23.7.1999 / 19:47:59 / stefan"
1091
577e196eb240 condense changeSet after checking in an extensions container
Claus Gittinger <cg@exept.de>
parents: 1079
diff changeset
  2766
    "Modified: / 5.11.2001 / 14:22:56 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2767
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2768
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2769
createContainerForText:someText inModule:moduleDir package:packageDir container:fileName
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2770
    "create a container - this does an initial checkin
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2771
     (i.e. cvs add & cvs commit)"
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2772
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2773
    |fullName tempdir checkoutName cmdOut cmd tempFile idx aStream whatHappened l newRevision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2774
     changeLog entry newString startIdx endIdx checkInDir logTmp s|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2775
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2776
    cmdOut := Filename newTemporary.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2777
    cmdOut exists ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2778
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2779
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2780
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2781
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2782
    checkoutName :=  moduleDir , '/' , packageDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2783
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2784
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2785
    "/ first, check out everything there - this creates the CVS helpfiles
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2786
    "/ required later.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2787
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2788
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2789
    self activityNotification:'checking for directory ' , checkoutName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2790
    tempdir := self createLocalDirectory:packageDir inModule:moduleDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2791
    tempdir isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2792
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2793
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2794
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2795
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2796
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2797
    "/ create the source there
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2798
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2799
    tempFile := (tempdir construct:checkoutName) construct:fileName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2800
    aStream := tempFile writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2801
    aStream isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2802
        ('CVSSourceCodeManager [error]: temporary fileout failed -> ', tempFile name) errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2803
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2804
        ^ false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2805
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2806
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2807
    aStream nextPutAll:someText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2808
    aStream close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2809
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2810
    tempFile exists ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2811
        'CVSSourceCodeManager [error]: temporary fileout failed' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2812
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2813
        ^ false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2814
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2815
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2816
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2817
    "/ and add it to the repository
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2818
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2819
    self activityNotification:'adding ' , fileName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2820
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2821
    OperatingSystem isUNIXlike ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2822
        checkInDir := tempdir constructString:checkoutName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2823
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2824
        OperatingSystem isMSDOSlike ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2825
            checkInDir := tempdir constructString:(checkoutName copyReplaceAll:$/ with:$\).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2826
        ] ifFalse:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
  2827
            self halt:'VMS case not yet implemented'. "/ add code for VMS ...
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2828
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2829
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2830
    cmd := 'add ' , fileName , ' > ' , cmdOut name.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2831
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2832
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2833
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2834
        inDirectory:checkInDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2835
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2836
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2837
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2838
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2839
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2840
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2841
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2842
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2843
    cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2844
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2845
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2846
    "/ commit
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2847
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2848
    self activityNotification:'comitting ' , fileName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2849
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2850
    OperatingSystem isUNIXlike ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2851
        "/ save the log message into another tempFile ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2852
        logTmp := Filename newTemporaryIn:checkInDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2853
        s := logTmp writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2854
        s nextPutAll:'initial checkin'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2855
        s close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2856
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2857
        cmd := 'commit -F "', logTmp baseName, '" ', fileName, ' >', cmdOut name.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2858
    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2859
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2860
        "/ CVS up to V1.9.14 prints the 'new revision' to stderr,
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2861
        "/ CVS V1.9.16 to stdout.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2862
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2863
        cmd := 'commit -m "initial checkin" ' , fileName , ' > ' , cmdOut name, ' 2>&1'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2864
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2865
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2866
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2867
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2868
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2869
        inDirectory:checkInDir "tempdir name"
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2870
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2871
        Verbose == true ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2872
            'CVSMGR: failed to execute: ' infoPrint. cmd infoPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2873
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2874
        cmdOut fileSize > 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2875
            whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2876
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2877
            whatHappened := '<< no message >>'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2878
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2879
        self warn:'The following problem was reported by cvs:
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2880
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2881
' , whatHappened , '
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2882
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2883
The class has NOT been checked into the repository.'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2884
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2885
       'CVSSourceCodeManager [error]: cannot checkin modified class source' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2886
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2887
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2888
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2889
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2890
    whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2891
    cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2892
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2893
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2894
    "/ release it towards cvs
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2895
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2896
    self releaseAndRemove:tempdir module:moduleDir outputTo:nil. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2897
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2898
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2899
    "/ good - its in the CVS repository; now, we need the updated RCS header
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2900
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2901
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2902
        'CVSSourceCodeManager [warning]: unexpected empty commit command output' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2903
        "/ TODO: scan the file for $Header ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2904
        "/ and extract the revision manually
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2905
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2906
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2907
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2908
        idx := whatHappened indexOfLineStartingWith:'initial revision:'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2909
        idx ~~ 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2910
            startIdx := 18
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2911
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2912
            idx := whatHappened indexOfLineStartingWith:'new revision:'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2913
            idx ~~ 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2914
                'CVSSourceCodeManager [warning]: container existed before' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2915
                startIdx := 14.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2916
            ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2917
                'CVSSourceCodeManager [warning]: unexpected commit command output (no new-revision info)' errorPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2918
            ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2919
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2920
        idx ~~ 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2921
            l := whatHappened at:idx.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2922
            endIdx := (l indexOf:$; startingAt:startIdx) - 1.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2923
            endIdx < 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2924
                endIdx := l size
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2925
            ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2926
            newRevision := (l copyFrom:startIdx to:endIdx) withoutSpaces.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2927
            (Number fromString:newRevision onError:nil) isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2928
                newRevision := '1.1'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2929
            ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2930
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2931
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2932
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2933
    Transcript showCR:'created new sourceContainer for ' , fileName , '.'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2934
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2935
    tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2936
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2937
    ^ true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2938
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2939
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2940
createModule:moduleName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2941
    "create a module directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2942
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2943
    |tempdir moduleDir cmdOut cmd|
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2944
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2945
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2946
    "/ first, create a temporary work tree
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2947
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2948
    tempdir := self createTempDirectory:nil forModule:moduleName.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2949
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2950
        ('CVSSourceCodeManager [error]: no tempDir - cannot create moduleDirectory') errorPrintCR.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2951
        ^ false
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2952
    ].
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2953
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2954
    cmdOut := Filename newTemporary.
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2955
    cmdOut exists ifTrue:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2956
        cmdOut remove.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2957
    ].
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2958
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2959
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2960
    "/ create the module directory 
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2961
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2962
    moduleDir := tempdir construct:moduleName.
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2963
    moduleDir exists ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2964
        'CVSSourceCodeManager [error]: failed to create: ' errorPrint.  moduleDir name errorPrintCR.
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2965
        tempdir recursiveRemove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2966
        ^ false.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2967
    ].     
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2968
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2969
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2970
    "/ then import it into CVS
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2971
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2972
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
  2973
    cmd := 'import -m "created from browser" ' , moduleName , ' initialV initialR > ' , cmdOut name.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2974
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2975
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2976
        module:moduleName
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2977
        inDirectory:tempdir name
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2978
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2979
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2980
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2981
        cmdOut remove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2982
        tempdir recursiveRemove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2983
        ^ false.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2984
    ].
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2985
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2986
    'CVSSourceCodeManager [info]: created new module: ' infoPrint. moduleName infoPrintCR.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2987
    tempdir recursiveRemove.
605
db13f9acfdc3 oops - temporary file was not removed in createContainer
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
  2988
    cmdOut remove.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2989
    ^ true
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2990
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
  2991
    "Created: / 9.12.1995 / 19:53:51 / cg"
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
  2992
    "Modified: / 7.1.1998 / 14:18:57 / stefan"
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2993
    "Modified: / 6.6.1998 / 16:15:34 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2994
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2995
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2996
createModule:moduleDirName package:packageDirName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2997
    "create a package directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2998
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2999
    |tempdir cmdOut cmd packageDir moduleDir where relativePath|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3000
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3001
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3002
    "/ first, create a temporary work tree
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3003
    "/
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3004
    tempdir := self createTempDirectory:packageDirName forModule:moduleDirName.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3005
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3006
        ('CVSSourceCodeManager [error]: no tempDir - cannot create moduleDirectory') errorPrintCR.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3007
        ^ false
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3008
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3009
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3010
    cmdOut := Filename newTemporary.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3011
    cmdOut exists ifTrue:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  3012
        cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3013
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3014
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3015
    moduleDir := tempdir construct:moduleDirName.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3016
    moduleDir isDirectory ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3017
        'CVSSourceCodeManager [error]: command failed: ' errorPrint. cmd errorPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3018
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  3019
        tempdir recursiveRemove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  3020
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3021
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3022
        
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3023
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3024
    "/ create the package directory there
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3025
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3026
    packageDir := moduleDir construct:packageDirName.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3027
    OperatingSystem errorSignal catch:[
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
  3028
        packageDir recursiveMakeDirectory.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3029
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3030
    packageDir isDirectory ifFalse:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  3031
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3032
        ('CVSSourceCodeManager [error]: cannot create new directory: ' , packageDir pathName) errorPrintCR.
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  3033
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3034
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3035
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3036
    "/
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3037
    "/ then import it into CVS
574
a3c4ee494a46 when creating new packageDir: walk over directory components,
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  3038
    "/
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3039
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3040
    relativePath := moduleDirName asFilename constructString:packageDirName.
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3041
    cmd := 'import -m "created from browser" . initialV initialR > ' , cmdOut name.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3042
    (self 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3043
        executeCVSCommand:cmd 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3044
        module:moduleDirName
892
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
  3045
        inDirectory:tempdir name
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3046
    ) ifFalse:[
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3047
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3048
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3049
        cmdOut remove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3050
        tempdir recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3051
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3052
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3053
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3054
    tempdir recursiveRemove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3055
    cmdOut remove.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  3056
    ^ true
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3057
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3058
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3059
      self createModule:'stefan' package:'dummy1'
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3060
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3061
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
  3062
    "Created: / 9.12.1995 / 20:09:33 / cg"
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  3063
    "Modified: / 23.7.1999 / 18:40:49 / stefan"
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3064
    "Modified: / 18.1.2000 / 20:14:01 / cg"
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3065
!
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3066
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3067
getExistingContainersInModule:aModule package:aPackage
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3068
    "return a list of existing containers.
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3069
     This does not work with remote-CVS"
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3070
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3071
    |cvsRoot containers moduleDir packageDir tempdir cmdOut cmd dirName|
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3072
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3073
    cvsRoot := self getCVSROOTForModule:aModule.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3074
    cvsRoot isNil ifTrue:[^ #() ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3075
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3076
    dirName := aModule , '/' , aPackage.
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3077
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3078
    self activityNotification:'getting list of containers in ' , dirName , ' ...'.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3079
1133
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  3080
    (RemoteCVS 
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  3081
    or:[cvsRoot asFilename exists not]) ifTrue:[
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3082
        "/ remote CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3083
        "/ filter the output of the history command
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3084
        "/ (sigh - there ought to be some cvs-command for that)
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3085
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3086
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3087
        tempdir := self createTempDirectory:nil forModule:nil.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3088
        tempdir isNil ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3089
            ('CVSSourceCodeManager [error]: no tempDir - cannot checkout') errorPrintCR.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3090
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3091
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3092
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3093
        cmd := '-l checkout ', dirName.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3094
        OperatingSystem isUNIXlike ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3095
            "/ can redirect output
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3096
            cmdOut := Filename newTemporary.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3097
            cmdOut exists ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3098
                cmdOut remove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3099
            ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3100
            cmd := cmd , ' > ' , cmdOut name.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3101
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3102
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3103
        (self 
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3104
            executeCVSCommand:cmd 
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3105
            module:aModule
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3106
            inDirectory:tempdir name
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3107
        ) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3108
            'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3109
            cmdOut notNil ifTrue:[cmdOut remove].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3110
            tempdir recursiveRemove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3111
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3112
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3113
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3114
        cmdOut notNil ifTrue:[cmdOut remove].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3115
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3116
        packageDir := (tempdir construct:dirName).
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3117
        (packageDir exists 
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3118
        and:[packageDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3119
            'CVSSourceCodeManager [error]: checkout failed (no dir)' errorPrintCR.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3120
            tempdir recursiveRemove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3121
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3122
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3123
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3124
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3125
        "/ enumerate the checkedOut directory, looking for plain files
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3126
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3127
        containers := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3128
        packageDir directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3129
            |fn|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3130
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3131
            (packageDir construct:aFilenameString) isDirectory ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3132
                containers add:aFilenameString
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3133
            ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3134
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3135
        tempdir recursiveRemove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3136
    ] ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3137
        (cvsRoot := cvsRoot asFilename) exists ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3138
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3139
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3140
        ((moduleDir := cvsRoot construct:aModule) exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3141
        and:[moduleDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3142
            self warn:'No such module'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3143
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3144
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3145
        ((packageDir := moduleDir construct:aPackage) exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3146
        and:[packageDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3147
            self warn:'No such package'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3148
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3149
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3150
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3151
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3152
        "/ enumerate the package directory, looking for container files
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3153
        "/ strip off the ,v ending.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3154
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3155
        containers := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3156
        packageDir directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3157
            |fn|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3158
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3159
            (aFilenameString endsWith:',v') ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3160
                containers add:(aFilenameString copyWithoutLast:2)
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3161
            ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3162
        ].
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3163
    ].
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3164
    ^ containers sort
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3165
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3166
    "
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3167
     CVSSourceCodeManager getExistingContainersInModule:'stx' package:'libhtml'
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3168
     CVSSourceCodeManager getExistingContainersInModule:'cg'  package:'java'
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3169
     CVSSourceCodeManager getExistingContainersInModule:'sel' package:'bmti'
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3170
    "
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3171
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3172
    "Created: / 20.5.1998 / 19:48:59 / cg"
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3173
    "Modified: / 20.5.1998 / 22:08:29 / cg"
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3174
!
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3175
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3176
getExistingModules
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3177
    "return a list of existing modules.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3178
     This does not work with remote-CVS"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3179
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3180
    |cvsRoot modules inStream list|
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3181
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3182
    cvsRoot := self getCVSROOTForModule:nil.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3183
    cvsRoot isNil ifTrue:[^ #() ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3184
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3185
    self activityNotification:'getting list of modules...'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3186
1133
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  3187
    (RemoteCVS 
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  3188
    or:[cvsRoot asFilename exists not]) ifTrue:[
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3189
        "/ remote CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3190
        "/ filter the output of the history command
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3191
        "/ (sigh - there ought to be some cvs-command for that)
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3192
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3193
        inStream := PipeStream readingFrom:'cvs -d ' , cvsRoot , ' history -x A'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3194
        inStream isNil ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3195
            self warn:'This operation is not possible with this remoteCVS server'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3196
            ^ #().
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3197
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3198
        list := inStream contents asStringCollection.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3199
        inStream close.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3200
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3201
        modules := Set new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3202
        list do:[:line |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3203
            |idx items entry|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3204
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3205
            items := line asCollectionOfWords.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3206
            "/ #( 'A' '10/29' '17:47' '+0000' 'cg' '1.1' '.cvsignore' 'stx' '==' '~/work/stx' )
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3207
            "/ fetch the word before '=='
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3208
        
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3209
            idx := items indexOf:'=='.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3210
            idx > 1 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3211
                entry := items at:idx-1.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3212
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3213
                "/ extract the first directory component ...
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3214
                idx := entry indexOf:$/.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3215
                idx ~~ 0 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3216
                    entry := entry copyTo:idx-1
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3217
                ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3218
                modules add:entry.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3219
            ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3220
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3221
        modules := modules asArray
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3222
    ] ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3223
        "/ local CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3224
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3225
        "/ enumerate the root directory, looking for subdirs
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3226
        "/ which contain a CVS subdir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3227
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3228
        (cvsRoot := cvsRoot asFilename) exists ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3229
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3230
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3231
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3232
        modules := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3233
        cvsRoot directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3234
            |fn|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3235
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3236
            (aFilenameString endsWith:',v') ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3237
                (#('CVS' 'CVSROOT' 'Attic') includes:aFilenameString) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3238
                    (fn := (cvsRoot construct:aFilenameString)) isDirectory ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3239
                        modules add:aFilenameString
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3240
                    ]
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3241
                ]
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3242
            ]
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3243
        ].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3244
    ].
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3245
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3246
    ^ modules sort
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3247
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3248
    "
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3249
     CVSSourceCodeManager getExistingModules
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3250
    "
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3251
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3252
    "Created: / 20.5.1998 / 19:28:43 / cg"
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3253
    "Modified: / 20.5.1998 / 22:07:07 / cg"
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3254
!
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3255
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3256
getExistingPackagesInModule:aModule
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3257
    "return a list of existing packages.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3258
     This does not work with remote-CVS"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3259
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3260
    |cvsRoot packages moduleDir inStream list|
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3261
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3262
    cvsRoot := self getCVSROOTForModule:aModule.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3263
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3264
    self activityNotification:'getting list of packages in ' , aModule , ' ...'.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3265
1133
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  3266
    (RemoteCVS 
9ff43ad49dbd oops - RemoteCVS flag is only valid for the default module
james
parents: 1130
diff changeset
  3267
    or:[cvsRoot asFilename exists not]) ifTrue:[
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3268
        "/ remote CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3269
        "/ filter the output of the history command
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3270
        "/ (sigh - there ought to be some cvs-command for that)
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3271
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3272
        inStream := PipeStream readingFrom:'cvs -d ' , cvsRoot , ' history -x A'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3273
        inStream isNil ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3274
            self warn:'This operation is not possible with this remoteCVS server'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3275
            ^ #().
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3276
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3277
        list := inStream contents asStringCollection.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3278
        inStream close.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3279
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3280
        packages := Set new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3281
        list do:[:line |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3282
            |items idx entry|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3283
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3284
            items := line asCollectionOfWords.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3285
            "/ #( 'A' '10/29' '17:47' '+0000' 'cg' '1.1' '.cvsignore' 'stx' '==' '~/work/stx' )
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3286
            "/ fetch the word before '=='
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3287
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3288
            idx := items indexOf:'=='.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3289
            idx > 1 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3290
                entry := items at:idx-1.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3291
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3292
                "/ extract the first directory component ...
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3293
                (entry startsWith:aModule) ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3294
                    idx := entry indexOf:$/.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3295
                    idx ~~ 0 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3296
                        (entry copyTo:idx-1) = aModule ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3297
                            packages add:(entry copyFrom:idx+1).
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3298
                        ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3299
                    ].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3300
                ]
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3301
            ]
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3302
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3303
        packages := packages asArray
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3304
    ] ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3305
        "/ local CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3306
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3307
        "/ enumerate the module directory, looking for subdirs
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3308
        "/ which contain a CVS subdir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3309
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3310
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3311
        (cvsRoot := cvsRoot asFilename) exists ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3312
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3313
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3314
        ((moduleDir := cvsRoot construct:aModule) exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3315
        and:[moduleDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3316
            self warn:'No such module'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3317
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3318
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3319
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3320
        packages := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3321
        moduleDir directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3322
            |fn|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3323
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3324
            (aFilenameString endsWith:',v') ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3325
                (#('CVS' 'CVSROOT' 'Attic') includes:aFilenameString) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3326
                    (fn := (moduleDir construct:aFilenameString)) isDirectory ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3327
                        packages add:aFilenameString
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3328
                    ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3329
                ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3330
            ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3331
        ].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3332
    ].
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3333
    ^ packages sort
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3334
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3335
    "
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3336
     CVSSourceCodeManager getExistingPackagesInModule:'stx'
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3337
     CVSSourceCodeManager getExistingPackagesInModule:'cg'
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3338
     CVSSourceCodeManager getExistingPackagesInModule:'sel'
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3339
    "
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3340
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3341
    "Created: / 20.5.1998 / 19:28:43 / cg"
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3342
    "Modified: / 20.5.1998 / 22:07:13 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3343
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3344
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3345
initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3346
    "return a string usable as initial revision string"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3347
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3348
    |cvsRoot|
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3349
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3350
    cvsRoot := self getCVSROOTForModule:moduleDir.
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
  3351
    cvsRoot := self repositoryTopDirectory:cvsRoot.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3352
    ^ self
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3353
        initialRCSRevisionStringFor:aClass 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3354
        in:(cvsRoot , '/' , moduleDir , '/' , packageDir)
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3355
        container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3356
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
  3357
    "Modified: / 19.9.1997 / 06:34:10 / cg"
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
  3358
    "Modified: / 16.1.1998 / 17:34:13 / stefan"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3359
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3360
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3361
newestRevisionInFile:classFileName directory:packageDir module:moduleDir
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3362
    "return the newest revision found in a container.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3363
     Return nil on failure.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3364
     Uses 'cvs status', which is much faster than 'cvs log'"
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3365
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3366
    |info|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3367
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3368
    info := self
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3369
            statusOf:nil 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3370
            fileName:classFileName 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3371
            directory:packageDir 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3372
            module:moduleDir.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3373
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3374
    info isNil ifTrue:[^ nil].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3375
    ^ info at:#newestRevision ifAbsent:nil
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3376
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3377
    "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3378
     SourceCodeManager newestRevisionInFile:'Array.st' directory:'libbasic' module:'stx'       
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3379
    "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3380
!
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3381
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3382
readRevisionLogEntryFromStream:inStream
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3383
    "read and parse a single revision info-entry from the cvs log output.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3384
     Return nil on end.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3385
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3386
     The returned information is a structure (IdentityDictionary)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3387
     filled with:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3388
              #revision              -> the revision string
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3389
              #author                -> who checked that revision into the repository
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3390
              #date                  -> when was it checked in
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3391
              #state                 -> the RCS state
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3392
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3393
              #logMessage            -> the checkIn log message
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3394
    "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3395
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3396
    |revLine1 revLine2 record s line atEnd|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3397
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3398
    atEnd := false.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3399
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3400
    revLine1 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3401
    [revLine1 notNil and:[(revLine1 startsWith:'revision ') not]]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3402
        whileTrue:[inStream atEnd ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3403
                    revLine1 := nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3404
                   ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3405
                    revLine1 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3406
                  ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3407
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3408
    revLine2 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3409
    (revLine1 notNil and:[revLine2 notNil]) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3410
        record := IdentityDictionary new.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3411
        record at:#revision put:(revLine1 asCollectionOfWords at:2).
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3412
        "/ decompose date/author/state etc.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3413
        (revLine2 asCollectionOfSubstringsSeparatedBy:$;) do:[:info |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3414
            |subEntry|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3415
            subEntry := info withoutSeparators.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3416
            #('date:'   #date
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3417
              'author:' #author 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3418
              'state:'  #state 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3419
              'lines:'  #numberOfChangedLines
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3420
             ) pairWiseDo:[:word :key |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3421
                s := subEntry restAfter:word withoutSeparators:true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3422
                s notNil ifTrue:[record at:key put:s.].                        
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3423
            ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3424
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3425
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3426
        "first revision does not hav a 'lines:' entry"
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3427
        (record includesKey:#numberOfChangedLines) ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3428
            record at:#numberOfChangedLines put:''
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3429
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3430
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3431
        s := nil.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3432
        line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3433
        [atEnd or:[line isNil or:[line startsWith:'--------']]] whileFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3434
            (line startsWith:'==========') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3435
                atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3436
            ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3437
                (line withoutSpaces = '.') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3438
                    line := '*** empty log message ***'
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3439
                ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3440
                s isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3441
                    s := line
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3442
                ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3443
                    s := s , Character cr asString , line.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3444
                ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3445
                line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3446
            ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3447
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3448
        record at:#logMessage put:s.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3449
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3450
    ^record.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3451
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3452
!
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3453
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3454
removeContainerFor:aClass inModule:moduleDir package:packageDir container:fileName
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3455
    "remove a container"
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3456
818
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3457
    (self removeContainerInModule:moduleDir package:packageDir container:fileName) ifFalse:[
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3458
        ^ false
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3459
    ].
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3460
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3461
    "/
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3462
    "/ patch the classes revisionInfo (but keep binaryRevision unchanged)
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3463
    "/ this makes everyone here believe, that the incore version of the class is based upon
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3464
    "/ some container-less class.
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3465
    "/ (however, the binaryRevision must remain as it is - we will need it to fetch the sourceCode
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3466
    "/  correctly for all unchanged methodss)
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3467
    "/
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3468
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3469
    aClass updateVersionMethodFor:'no longer in repository'.
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3470
    Class addChangeRecordForClassContainerRemove:aClass.
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3471
    ^ true
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3472
!
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3473
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3474
removeContainerInModule:moduleDir package:packageDir container:fileName
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3475
    "remove a container"
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3476
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
  3477
    |fullName tempdir checkoutName cmdOut cmd tempFile whatHappened|
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3478
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3479
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3480
    checkoutName :=  moduleDir , '/' , packageDir.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3481
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3482
    (tempdir := self createLocalDirectory:packageDir inModule:moduleDir with:fileName) isNil ifTrue:[
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3483
        'CVSSourceCodeManager [error]: failed to checkout: ' errorPrint. checkoutName errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3484
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3485
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3486
        ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3487
    ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3488
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3489
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3490
    "/ and remove it to the repository
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3491
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3492
    self activityNotification:'removing ' , fileName.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3493
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3494
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3495
    "/ check presence of source there
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3496
    "/
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  3497
    tempFile := (tempdir construct:checkoutName) construct:fileName.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3498
    tempFile exists ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3499
        'CVSSourceCodeManager [error]: temporary fileout failed' errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3500
        tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3501
        ^ false
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3502
    ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3503
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3504
    tempFile exists ifTrue:[
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3505
        tempFile remove.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3506
    ].
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3507
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3508
    cmdOut := Filename newTemporary.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3509
    cmdOut exists ifTrue:[
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3510
        cmdOut remove.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3511
    ].
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3512
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3513
    cmd := 'remove ' , fileName , ' > ' , cmdOut name.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3514
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3515
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3516
        module:moduleDir
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  3517
        inDirectory:(tempdir constructString:checkoutName)
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3518
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3519
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3520
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3521
        cmdOut remove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3522
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3523
        ('CVSSourceCodeManager [error]: cannot remove ' , checkoutName) errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3524
        ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3525
    ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3526
    cmdOut remove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3527
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3528
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3529
    "/ commit
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3530
    "/
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  3531
    self activityNotification:'comitting removal of ' , fileName.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3532
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3533
    cmd := 'commit -m "removed container" -l ' , fileName , ' 2> ' , cmdOut name.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3534
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3535
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3536
        module:moduleDir
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  3537
        inDirectory:(tempdir constructString:checkoutName)
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3538
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3539
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
539
017889159bcd newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
  3540
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3541
        cmdOut fileSize > 0 ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3542
            whatHappened := cmdOut contentsOfEntireFile asString.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3543
        ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3544
            whatHappened := '<< no message >>'
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3545
        ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3546
        self warn:'The following problem was reported by cvs:
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3547
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3548
' , whatHappened , '
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3549
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3550
The container has NOT been removed into the repository.'.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3551
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3552
       'CVSSourceCodeManager [error]: cannot remove container' errorPrintCR.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3553
        cmdOut remove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3554
        tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3555
        ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3556
    ].
605
db13f9acfdc3 oops - temporary file was not removed in createContainer
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
  3557
    cmdOut remove.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3558
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3559
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3560
    "/ release the temporary tree towards cvs
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3561
    "/
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3562
    self releaseAndRemove:tempdir module:moduleDir outputTo:nil. 
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3563
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3564
    tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3565
    ^ true
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3566
818
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3567
    "
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3568
     CVSSourceCodeManager removeContainerInModule:'stx' package:'private' container:'WorldPO.st'
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3569
    "
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3570
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  3571
    "Modified: / 26.2.1998 / 17:33:57 / stefan"
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3572
    "Modified: / 18.1.2000 / 21:02:30 / cg"
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3573
!
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3574
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3575
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:filterRep filterModules:filterModules inTo:aBlock
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3576
    "process a full historyLog, evaluate aBlock for each entry, passing 
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3577
     the logs info in a dictionary.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3578
     This walks over all possible repositories.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3579
     filterRep may be a collection of repository names 
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3580
     (i.e. 'stc', 'exept', 'phx' etc.) to only report changes made to one
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3581
     of those repositories.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3582
     filterUser, if non-nil, will filter only changes made by that user."
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3583
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3584
    |inStream line words recordType fileName user date time rev pkgDir module idx
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3585
     clsName cls clsRev roots info tempDir endReached|
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3586
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3587
    CVSRoot isNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3588
        'CVSSourceCodeManager [info]: CVSROOT not set' infoPrintCR.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3589
        ^ nil
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3590
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3591
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3592
    CVSModuleRoots notNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3593
        roots := Set withAll:(CVSModuleRoots values)
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3594
    ] ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3595
        roots := Set new.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3596
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3597
    roots add:CVSRoot.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3598
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3599
    "/ must do it in a tempDir, to avoid cvs validating the -D arg
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3600
    "/ against any info found in CVS/Root
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3601
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3602
    tempDir := self createTempDirectory:nil forModule:nil.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3603
    tempDir isNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3604
        ('CVSSourceCodeManager [error]: no tempDir - cannot extract log') errorPrintCR.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3605
        ^ nil.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3606
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3607
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3608
    roots do:[:aCVSRoot |
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3609
        |root host cmd|
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3610
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3611
        cmd := 'cvs -d ' , aCVSRoot.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3612
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3613
        "/ workaround a CVS bug ...
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3614
        "/ cvs crashes with:
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3615
        "/   cvs -d exept:/files/CVS history -x WARM -a -D "yesterday"
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3616
        "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3617
        "/ but works ok, when doing:
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3618
        "/   rsh exept cvs -d /files/CVS history -x WARM -a -D "yesterday"
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3619
        "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3620
        (aCVSRoot startsWith:':') ifFalse:[
905
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3621
            OperatingSystem isUNIXlike ifTrue:[
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3622
                host := aCVSRoot copyTo:(aCVSRoot indexOf:$:)-1.
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3623
                (host size > 0 and:[(host includes:Character space) not]) ifTrue:[
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3624
                    root := aCVSRoot copyFrom:(aCVSRoot indexOf:$:)+1.
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3625
                    cmd := 'rsh ' , host , ' cvs -d ' , root    
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3626
                ]
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3627
            ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3628
        ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3629
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3630
        cmd := cmd , ' history -x WARM -a'.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3631
        (timeGoal notNil and:[timeGoal notEmpty]) ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3632
            cmd := cmd , ' -D "' , timeGoal , '"'.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3633
        ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3634
        filterRep notNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3635
            filterRep do:[:aRepository |
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3636
                cmd := cmd , ' -p "' , aRepository , '"'.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3637
            ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3638
        ].
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3639
"/ either I dont understand CVS, or it does not work correctly...
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3640
"/ in any case, the -m option does NOT filter modules. (sigh)
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3641
"/
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3642
"/        filterModules notNil ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3643
"/            filterModules do:[:aModule |
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3644
"/                cmd := cmd , ' -m "' , aModule , '"'.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3645
"/            ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3646
"/        ].
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3647
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3648
        Transcript showCR:cmd.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3649
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3650
        inStream := PipeStream readingFrom:cmd inDirectory:tempDir.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3651
        inStream isNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3652
            ('CVSSourceCodeManager [error]: cannot open pipe to ''cvs history''') errorPrintCR.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3653
        ] ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3654
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3655
            inStream class streamErrorSignal handle:[:ex |
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3656
                ('CVSSourceCodeManager [error]: pipe read error (''cvs history'')') errorPrintCR.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3657
                ex return.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3658
            ] do:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3659
                "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3660
                "/ read the commands pipe output and reformat the lines
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3661
                "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3662
                endReached := false.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3663
                [endReached] whileFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3664
                    inStream readWait.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3665
                    line := inStream nextLine.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3666
                    (endReached := line isNil) ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3667
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3668
                        "/ cvs history line is of the following format:
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3669
                        "/ [Ma] date time +xxx user rev name module/package ....
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3670
                        words := line asCollectionOfWords.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3671
                        words size >= 8 ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3672
                            "/ something like 'No records selected' ...
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3673
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3674
                        ] ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3675
                            recordType := words at:1.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3676
                            fileName := words at:7.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3677
                            user := words at:5.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3678
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3679
                            (filter not 
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3680
                            or:[fileName endsWith:'.st']) ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3681
                                (userFilter isNil
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3682
                                or:[userFilter = user]) ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3683
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3684
                                    date := words at:2.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3685
                                    time := words at:3.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3686
                                    rev := words at:6.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3687
                                    pkgDir := words at:8.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3688
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3689
                                    module := pkgDir copy.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3690
                                    (module startsWith:'./') ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3691
                                        module := module copyFrom:3.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3692
                                    ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3693
                                    idx := module indexOf:$/.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3694
                                    idx ~~ 0 ifTrue:[    
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3695
                                        module at:idx put:$:
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3696
                                    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3697
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3698
                                    (filterModules isNil 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3699
                                    or:[filterModules includes:module]) ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3700
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3701
                                        recordType = 'M' ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3702
                                            recordType := ' '
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3703
                                        ] ifFalse:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3704
                                            recordType = 'A' ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3705
                                                recordType := '+'
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3706
                                            ] ifFalse:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3707
                                                (recordType = 'R' or:[recordType = 'W']) ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3708
                                                    recordType := '-'
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3709
                                                ]
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3710
                                            ]
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3711
                                        ].
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3712
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3713
                                        info := Dictionary new.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3714
                                        info at:#cvsRecordType       put:recordType.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3715
                                        info at:#date                put:date.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3716
                                        info at:#time                put:time.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3717
                                        info at:#user                put:user.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3718
                                        info at:#fileName            put:fileName.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3719
                                        info at:#revision            put:rev.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3720
                                        info at:#directory           put:pkgDir.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3721
                                        info at:#className           put:(Smalltalk classNameForFile:fileName).
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3722
                                    
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3723
                                        "/
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3724
                                        "/ for your convenience:
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3725
                                        "/  check what the actual version is in the image
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3726
                                        "/
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3727
                                        clsName := Smalltalk classNameForFile:fileName.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3728
                                        clsName notNil ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3729
                                            cls := Smalltalk classNamed:clsName.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3730
                                            (cls notNil and:[(clsRev := cls revision) notNil]) ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3731
                                                info at:#classesRevision     put:clsRev.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3732
                                            ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3733
                                        ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3734
                                        aBlock value:info
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3735
                                    ]
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3736
                                ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3737
                            ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3738
                        ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3739
                    ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3740
                ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3741
            ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3742
            inStream close.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3743
        ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3744
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3745
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3746
    tempDir recursiveRemove.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3747
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3748
    "Created: / 17.1.2001 / 13:11:20 / cg"
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3749
    "Modified: / 17.1.2001 / 13:41:22 / cg"
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3750
!
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3751
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3752
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:filterRep inTo:aBlock
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3753
    "process a full historyLog, evaluate aBlock for each entry, passing 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3754
     the logs info in a dictionary.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3755
     This walks over all possible repositories.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3756
     filterRep may be a collection of repository names 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3757
     (i.e. 'stc', 'exept', 'phx' etc.) to only report changes made to one
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3758
     of those repositories.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3759
     filterUser, if non-nil, will filter only changes made by that user."
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3760
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3761
    ^self
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3762
        reportHistoryLogSince:timeGoal 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3763
        filterSTSources:filter 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3764
        filterUser:userFilter 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3765
        filterRepository:filterRep 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3766
        filterModules:nil
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3767
        inTo:aBlock
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3768
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3769
    "Modified: / 17.1.2001 / 13:12:15 / cg"
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3770
!
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3771
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3772
revisionInfoFromString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3773
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3774
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3775
    "return a dictionary filled with revision info.
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3776
     This extracts the relevant info from aString."
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3777
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3778
    ^ self revisionInfoFromRCSString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3779
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3780
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3781
     self revisionInfoFromString:(Array version)   
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3782
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3783
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3784
    "Modified: 29.1.1997 / 19:00:35 / cg"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3785
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3786
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  3787
revisionLogOf:clsOrNil fromRevision:rev1 toRevision:rev2 fileName:classFileName directory:packageDir module:moduleDir
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3788
    "return info about the repository container and
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3789
     (part of) the revisionlog as a collection of revision entries.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3790
     Return nil on failure.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3791
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3792
     The returned information is a structure (IdentityDictionary)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3793
     filled with:
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
  3794
            #container          -> the RCS/CVS container file name 
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
  3795
            #cvsRoot            -> the CVS root (repository) 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3796
            #filename           -> the actual source file name
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3797
            #newestRevision     -> the revisionString of the newest revision
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
  3798
            #numberOfRevisions  -> the number of revisions in the container (nil for all)
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3799
            #revisions          -> collection of per-revision info (see below)
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3800
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3801
            rev1 / rev2 specify from which revisions a logEntry is wanted:
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3802
             -If rev1 is nil, the first revision is the initial revision
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3803
              otherwise, the log starts with that revision.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3804
             -If rev2 is nil, the last revision is the newest revision
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3805
              otherwise, the log ends with that revision.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3806
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3807
             -If both are nil, all logEntries are extracted.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3808
             -If both are 0 (not nil), no logEntries are extracted (i.e. only the header).
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3809
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3810
            per revision info consists of one record per revision:
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3811
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3812
              #revision              -> the revision string
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3813
              #author                -> who checked that revision into the repository
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3814
              #date                  -> when was it checked in
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3815
              #state                 -> the RCS state
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3816
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3817
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3818
            revisions are ordered newest first 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3819
            (i.e. the last entry is for the initial revision; the first for the most recent one)
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3820
        "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3821
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3822
    |tempDir fullName modulePath inStream inHeaderInfo atEnd line revArg idx
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3823
     info record revisionRecords s headerOnly msg |
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3824
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3825
    modulePath :=  moduleDir , '/' , packageDir. 
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3826
    fullName :=  modulePath , '/' , classFileName.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3827
    tempDir := self createTempDirectory:nil forModule:nil.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3828
    tempDir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3829
        ('CVSSourceCodeManager [error]: no tempDir - cannot extract log') errorPrintCR.
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3830
        ^ nil.
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3831
    ].
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3832
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3833
    [
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3834
        self createEntryFor:fullName 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3835
             module:moduleDir
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3836
             in:(tempDir construct:modulePath) 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3837
             revision:'1.1' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3838
             date:'dummy' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3839
             special:''
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3840
             overwrite:false.
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  3841
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3842
        revArg := ''.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3843
        headerOnly := false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3844
        (rev1 notNil or:[rev2 notNil]) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3845
            (rev1 == 0 and:[rev2 == 0]) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3846
                revArg := '-h'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3847
                headerOnly := true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3848
            ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3849
                revArg := '-r'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3850
                rev1 notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3851
                    revArg := revArg , rev1
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3852
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3853
                revArg := revArg , ':'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3854
                rev2 notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3855
                    revArg := revArg , rev2
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3856
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3857
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3858
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3859
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3860
        headerOnly ifTrue:[
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3861
            msg := 'fetching revision info '
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3862
        ] ifFalse:[
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3863
            msg := 'reading revision log '
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3864
        ].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  3865
        clsOrNil isNil ifTrue:[
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3866
            msg := msg , 'in ' , fullName.
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3867
        ] ifFalse:[
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  3868
            msg := msg , 'of ', clsOrNil name.
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3869
        ].
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3870
        self activityNotification:msg.
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3871
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3872
        inStream := self 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3873
                        executeCVSCommand:('log ' , revArg , ' ' , fullName) 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3874
                        module:moduleDir 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3875
                        inDirectory:tempDir 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3876
                        log:true 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3877
                        pipe:true.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  3878
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3879
        inStream isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3880
            ('CVSSourceCodeManager [error]: cannot open pipe to cvs log ', fullName) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3881
            ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3882
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3883
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3884
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3885
        "/ read the commands pipe output and extract the container info
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3886
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3887
        info := IdentityDictionary new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3888
        inHeaderInfo := true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3889
        [inHeaderInfo and:[inStream atEnd not]] whileTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3890
            line:= inStream nextLine.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3891
            line notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3892
                |gotIt|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3893
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3894
                gotIt := false.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3895
                #('RCS file:'        #container
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3896
                  'Working file:'    #filename
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3897
                  'head:'            #newestRevision
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3898
                  'total revisions:' #numberOfRevisions
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3899
                 ) pairWiseDo:[:word :key |
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3900
                    gotIt ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3901
                        s := line restAfter:word withoutSeparators:true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3902
                        s notNil ifTrue:[info at:key put:s. gotIt := true].                        
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3903
                    ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3904
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3905
                gotIt ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3906
                    (line startsWith:'description:') ifTrue:[inHeaderInfo := false].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3907
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3908
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3909
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3910
        inStream nextLine. "/ skip separating line after description.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3911
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3912
        info isEmpty ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3913
            ('CVSSourceCodeManager [warning]: no log for ', fullName) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3914
            ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3915
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3916
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3917
        "/ strip selected revisions from the total-revisions entry
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3918
        s := info at:#numberOfRevisions.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3919
        (idx := s indexOf:$;) ~~ 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3920
            info at:#numberOfRevisions put:(Integer readFrom:(s copyTo:idx - 1))
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3921
        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3922
            info at:#numberOfRevisions put:(Integer readFrom:s onError:[1])
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3923
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3924
        headerOnly ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3925
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3926
            "/ continue to read the commands pipe output 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3927
            "/ and extract revision info records
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3928
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3929
            revisionRecords := OrderedCollection new:(info at:#numberOfRevisions).
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3930
            info at:#revisions put:revisionRecords.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3931
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3932
            atEnd := false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3933
            [atEnd or:[inStream atEnd]] whileFalse:[
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3934
                record := self readRevisionLogEntryFromStream:inStream.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3936
"/                revLine1 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3937
"/                [revLine1 notNil and:[(revLine1 startsWith:'revision ') not]]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3938
"/                    whileTrue:[inStream atEnd ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3939
"/                                revLine1 := nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3940
"/                               ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3941
"/                                revLine1 := inStream nextLine.]].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3942
"/                revLine2 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3943
"/                (revLine1 notNil and:[revLine2 notNil]) ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3944
"/                    record := IdentityDictionary new.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3945
"/                    record at:#revision put:(revLine1 asCollectionOfWords at:2).
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3946
"/                    "/ decompose date/author/state etc.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3947
"/                    (revLine2 asCollectionOfSubstringsSeparatedBy:$;) do:[:info |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3948
"/                        |subEntry|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3949
"/                        subEntry := info withoutSeparators.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3950
"/                        #('date:'   #date
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3951
"/                          'author:' #author 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3952
"/                          'state:'  #state 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3953
"/                          'lines:'  #numberOfChangedLines
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3954
"/                         ) pairWiseDo:[:word :key |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3955
"/                            s := subEntry restAfter:word withoutSeparators:true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3956
"/                            s notNil ifTrue:[record at:key put:s.].                        
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3957
"/                        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3958
"/                    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3959
"/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3960
"/                    "first revision does not hav a 'lines:' entry"
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3961
"/                    (record includesKey:#numberOfChangedLines) ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3962
"/                        record at:#numberOfChangedLines put:''
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3963
"/                    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3964
"/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3965
"/                    s := nil.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3966
"/                    line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3967
"/                    [atEnd or:[line isNil or:[line startsWith:'--------']]] whileFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3968
"/                        (line startsWith:'==========') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3969
"/                            atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3970
"/                        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3971
"/                            (line withoutSpaces = '.') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3972
"/                                line := '*** empty log message ***'
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3973
"/                            ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3974
"/                            s isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3975
"/                                s := line
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3976
"/                            ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3977
"/                                s := s , Character cr asString , line.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3978
"/                            ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3979
"/                            line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3980
"/                        ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3981
"/                    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3982
"/                    record at:#logMessage put:s.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3983
"/                    revisionRecords add:record.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3984
"/                ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3985
                record isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3986
                    atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3987
                ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3988
                    revisionRecords add:record.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3989
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3990
            ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3991
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3992
    ] valueNowOrOnUnwindDo:[
529
3fcaac638b26 always close the log-stream
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  3993
        inStream notNil ifTrue:[inStream close].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3994
        tempDir recursiveRemove
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3995
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3996
    ^ info
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3997
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3998
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3999
     SourceCodeManager revisionLogOf:Array 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4000
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4001
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:nil  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4002
     SourceCodeManager revisionLogOf:Array fromRevision:nil toRevision:'1.3'  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4003
     SourceCodeManager revisionLogOf:Array fromRevision:nil toRevision:nil  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4004
     SourceCodeManager revisionLogOf:Array fromRevision:0 toRevision:0  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4005
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4006
669
f6606693a1be care for CVSBinDir when reading revisionLog
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4007
    "Created: / 16.11.1995 / 13:25:30 / cg"
f6606693a1be care for CVSBinDir when reading revisionLog
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  4008
    "Modified: / 29.1.1997 / 16:51:30 / stefan"
715
c656fcf2af04 check for EOF while skipping log entry lines (req'd for win32)
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  4009
    "Modified: / 27.8.1998 / 12:40:59 / cg"
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4010
!
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4011
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4012
revisionLogOf:clsOrNil numberOfRevisions:numRevisions fileName:classFileName directory:packageDir module:moduleDir
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4013
    "return info about the repository container and
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4014
     (part of) the revisionlog (numRevisions newest revisions)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4015
     as a collection of revision entries.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4016
     Return nil on failure.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4017
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4018
     The returned information is a structure (IdentityDictionary)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4019
     filled with:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4020
            #container          -> the RCS container file name 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4021
            #filename           -> the actual source file name
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4022
            #newestRevision     -> the revisionString of the newest revision
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
  4023
            #numberOfRevisions  -> the number of revisions in the container (nil for all)
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4024
            #revisions          -> collection of per-revision info (see below)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4025
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4026
            rev1 / rev2 specify from which revisions a logEntry is wanted:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4027
             -If rev1 is nil, the first revision is the initial revision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4028
              otherwise, the log starts with that revision.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4029
             -If rev2 is nil, the last revision is the newest revision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4030
              otherwise, the log ends with that revision.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4031
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4032
             -If both are nil, all logEntries are extracted.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4033
             -If both are 0 (not nil), no logEntries are extracted (i.e. only the header).
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4034
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4035
            per revision info consists of one record per revision:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4036
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4037
              #revision              -> the revision string
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4038
              #author                -> who checked that revision into the repository
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4039
              #date                  -> when was it checked in
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4040
              #state                 -> the RCS state
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4041
              #numberOfChangedLines  -> the number of changed line w.r.t the previous
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4042
              #logMessage            -> the checkIn log message
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4043
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4044
            revisions are ordered newest first 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4045
            (i.e. the last entry is for the initial revision; the first for the most recent one)
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4046
        "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4047
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4048
    |tempDir fullName modulePath inStream inHeaderInfo atEnd line revArg idx
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4049
     info record revisionRecords s msg|
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4050
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4051
    modulePath :=  moduleDir , '/' , packageDir. 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4052
    fullName :=  modulePath , '/' , classFileName.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4053
    tempDir := self createTempDirectory:nil forModule:nil.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4054
    tempDir isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4055
        ('CVSSourceCodeManager [error]: no tempDir - cannot extract log') errorPrintCR.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4056
        ^ nil.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4057
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4058
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4059
    [
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4060
        self createEntryFor:fullName 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4061
             module:moduleDir
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4062
             in:(tempDir construct:modulePath) 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4063
             revision:'1.1' 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4064
             date:'dummy' 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4065
             special:''
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4066
             overwrite:false.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4067
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4068
        revArg := ''.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4069
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4070
        msg := 'reading revision log '.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4071
        clsOrNil isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4072
            msg := msg , 'in ' , fullName.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4073
        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4074
            msg := msg , 'of ', clsOrNil name.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4075
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4076
        self activityNotification:msg.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4077
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4078
        inStream := self 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4079
                        executeCVSCommand:('log ' , revArg , ' ' , fullName) 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4080
                        module:moduleDir 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4081
                        inDirectory:tempDir 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4082
                        log:true 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4083
                        pipe:true.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4084
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4085
        inStream isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4086
            ('CVSSourceCodeManager [error]: cannot open pipe to cvs log ', fullName) errorPrintCR.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4087
            ^ nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4088
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4089
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4090
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4091
        "/ read the commands pipe output and extract the container info
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4092
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4093
        info := IdentityDictionary new.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4094
        inHeaderInfo := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4095
        [inHeaderInfo and:[inStream atEnd not]] whileTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4096
            line:= inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4097
            line notNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4098
                |gotIt|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4099
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4100
                gotIt := false.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4101
                #('RCS file:'        #container
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4102
                  'Working file:'    #filename
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4103
                  'head:'            #newestRevision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4104
                  'total revisions:' #numberOfRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4105
                 ) pairWiseDo:[:word :key |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4106
                    gotIt ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4107
                        s := line restAfter:word withoutSeparators:true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4108
                        s notNil ifTrue:[info at:key put:s. gotIt := true].                        
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4109
                    ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4110
                ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4111
                gotIt ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4112
                    (line startsWith:'description:') ifTrue:[inHeaderInfo := false].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4113
                ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4114
            ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4115
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4116
        inStream nextLine. "/ skip separating line after description.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4117
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4118
        info isEmpty ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4119
            ('CVSSourceCodeManager [warning]: no log for ', fullName) errorPrintCR.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4120
            ^ nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4121
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4122
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4123
        "/ strip selected revisions from the total-revisions entry
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4124
        s := info at:#numberOfRevisions.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4125
        (idx := s indexOf:$;) ~~ 0 ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4126
            info at:#numberOfRevisions put:(Integer readFrom:(s copyTo:idx - 1))
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4127
        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4128
            info at:#numberOfRevisions put:(Integer readFrom:s onError:[1])
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4129
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4130
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4131
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4132
        "/ continue to read the commands pipe output 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4133
        "/ and extract revision-info records
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4134
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4135
        revisionRecords := OrderedCollection new:(info at:#numberOfRevisions).
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4136
        info at:#revisions put:revisionRecords.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4137
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4138
        atEnd := false.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4139
        [atEnd or:[inStream atEnd]] whileFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4140
            record := self readRevisionLogEntryFromStream:inStream.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4141
            record isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4142
                atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4143
            ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4144
                revisionRecords add:record.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4145
            ].
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
  4146
            (numRevisions notNil and:[revisionRecords size >= numRevisions]) ifTrue:[
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4147
                atEnd := true
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4148
            ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4149
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4150
    ] valueNowOrOnUnwindDo:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4151
        inStream notNil ifTrue:[inStream close].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4152
        tempDir recursiveRemove
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4153
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4154
    ^ info
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4155
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4156
    "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4157
     SourceCodeManager revisionLogOf:Array 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4158
     SourceCodeManager revisionLogOf:Array numberOfRevisions:5
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4159
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4160
    "
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4161
!
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4162
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4163
statusOf:clsOrNil fileName:classFileName directory:packageDir module:moduleDir
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4164
    "return info about the status repository container.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4165
     Return nil on failure.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4166
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4167
     The returned information is a structure (IdentityDictionary)
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4168
     filled with:
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4169
            #newestRevision     -> the revisionString of the newest revision
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4170
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4171
     This is much faster than revisionLog info (especially, if there are many revisions),
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4172
     and all we need is a classes newest version number.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4173
        "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4174
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4175
    |tempDir fullName modulePath inStream line   
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4176
     info s msg|
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4177
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4178
    modulePath :=  moduleDir , '/' , packageDir. 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4179
    fullName :=  modulePath , '/' , classFileName.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4180
    tempDir := self createTempDirectory:nil forModule:nil.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4181
    tempDir isNil ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4182
        ('CVSSourceCodeManager [error]: no tempDir - cannot extract log') errorPrintCR.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4183
        ^ nil.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4184
    ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4185
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4186
    [
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4187
        self createEntryFor:fullName 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4188
             module:moduleDir
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4189
             in:(tempDir construct:modulePath) 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4190
             revision:'1.1' 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4191
             date:'dummy' 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4192
             special:''
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4193
             overwrite:false.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4194
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4195
        msg := 'fetching status info of '.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4196
        clsOrNil isNil ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4197
            msg := msg , fullName.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4198
        ] ifFalse:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4199
            msg := msg , clsOrNil name.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4200
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4201
        self activityNotification:msg.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4202
1119
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4203
        inStream := self 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4204
                        executeCVSCommand:('status ' , fullName) 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4205
                        module:moduleDir 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4206
                        inDirectory:tempDir 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4207
                        log:true 
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4208
                        pipe:true.
737c6901762c binDir fixes (for WIN32)
Claus Gittinger <cg@exept.de>
parents: 1117
diff changeset
  4209
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4210
        inStream isNil ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4211
            ('CVSSourceCodeManager [error]: cannot open pipe to cvs log ', fullName) errorPrintCR.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4212
            ^ nil
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4213
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4214
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4215
        "/
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4216
        "/ read the commands pipe output and extract the container info
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4217
        "/
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4218
        info := IdentityDictionary new.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4219
        [inStream atEnd] whileFalse:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4220
            line:= inStream nextLine.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4221
            line notNil ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4222
                line := line withoutSeparators.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4223
            ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4224
            line size > 0 ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4225
                |gotIt i|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4226
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4227
                gotIt := false.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4228
                #(
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4229
                  'Repository revision:'  #newestRevision
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4230
                 ) pairWiseDo:[:word :key |
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4231
                    gotIt ifFalse:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4232
                        s := line restAfter:word withoutSeparators:true.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4233
                        s notNil ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4234
                            i := s indexOfSeparator.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4235
                            i ~~ 0 ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4236
                                s := s copyTo:i-1
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4237
                            ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4238
                            info at:key put:s.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4239
                            gotIt := true.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4240
                        ].                        
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4241
                    ]
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4242
                ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4243
            ]
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4244
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4245
        info isEmpty ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4246
            ('CVSSourceCodeManager [warning]: no status for ', fullName) errorPrintCR.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4247
            ^ nil
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4248
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4249
    ] valueNowOrOnUnwindDo:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4250
        inStream notNil ifTrue:[inStream close].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4251
        tempDir recursiveRemove
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4252
    ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4253
    ^ info
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4254
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4255
    "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4256
     SourceCodeManager statusOf:Array 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4257
     SourceCodeManager statusOf:Array fileName:'Array.st' directory:'libbasic' module:'stx'  
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4258
     SourceCodeManager statusOf:Filename fileName:'Filename.st' directory:'libbasic' module:'stx'  
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4259
     SourceCodeManager statusOf:NewSystemBrowser fileName:'NewSystemBrowser.st' directory:'libtool' module:'stx'  
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4260
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4261
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4262
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
  4263
!CVSSourceCodeManager class methodsFor:'documentation'!
89
a6730f6832b6 log bug fix (synchronize on first revision line)
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  4264
a6730f6832b6 log bug fix (synchronize on first revision line)
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  4265
version
1138
aa7687ec256f implements -> includesSelector
Claus Gittinger <cg@exept.de>
parents: 1136
diff changeset
  4266
    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.249 2002-02-25 19:58:35 cg Exp $'
117
882343f83624 minor bug
Claus Gittinger <cg@exept.de>
parents: 116
diff changeset
  4267
! !
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4268
CVSSourceCodeManager initialize!