CVSSourceCodeManager.st
author Claus Gittinger <cg@exept.de>
Fri, 07 Sep 2001 16:35:56 +0200
changeset 1069 860c5e37c282
parent 1067 35bc8c428c14
child 1074 69c3722f7238
permissions -rw-r--r--
checkin from browser
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
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   200
    |os s f top ok binDirPath|
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
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   224
    CVSBinDir size > 0 ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   225
        (OperatingSystem canExecuteCommand:(CVSBinDir , 'cvs.exe')) ifFalse:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   226
            CVSBinDir := ''.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   227
        ]
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   228
    ].
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   229
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   230
    CVSBinDir size == 0 ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   231
        CVSBinDir := ''.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   232
        (OperatingSystem canExecuteCommand:'cvs') ifFalse:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   233
            "/ mhmh - no cvs along path;
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   234
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   235
            ok := false.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   236
            OperatingSystem isUNIXlike ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   237
                (OperatingSystem canExecuteCommand:'/usr/local/bin/cvs') ifTrue:[
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   238
                    ok := true.
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   239
                    CVSBinDir := '/usr/local/bin/'.
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
            ] ifFalse:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   242
                OperatingSystem isMSDOSlike ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   243
                    (OperatingSystem canExecuteCommand:'c:\bin\cvs.exe') ifTrue:[
811
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
   244
                        ok := true.
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   245
                        CVSBinDir := '\bin\'.
811
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
   246
                    ] ifFalse:[
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   247
                        (OperatingSystem canExecuteCommand:(Filename currentDirectory pathName , '\cvs.exe')) ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   248
                            ok := true.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   249
                            CVSBinDir := Filename currentDirectory pathName , '\'.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   250
                        ] ifFalse:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   251
                            (binDirPath := OperatingSystem stxBinDirPath) notNil ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   252
                                (OperatingSystem canExecuteCommand:(binDirPath , '\cvs.exe')) ifTrue:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   253
                                    ok := true.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   254
                                    CVSBinDir := binDirPath , '\'.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   255
                                ]
811
bc8dc317173b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 807
diff changeset
   256
                            ]
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   257
                        ]
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   258
                    ].
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   259
                ].
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   260
            ].
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   261
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   262
            ok ifFalse:[
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   263
                'CVSSourceCodeManager [warning]: disabled since no >> cvs << command found' infoPrintCR.
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   264
                ^ self
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
        ].
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   267
    ].
701
8a82b708ddfd checkin from browser
Claus Gittinger <cg@exept.de>
parents: 692
diff changeset
   268
748
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   269
"/    (OperatingSystem canExecuteCommand:(CVSBinDir , 'co')) ifFalse:[
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   270
"/        '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
   271
"/    ].
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   272
"/    (OperatingSystem canExecuteCommand:(CVSBinDir , 'rlog')) ifFalse:[
96180f5613ae dont check for 'co' and 'rlog' commands.
Claus Gittinger <cg@exept.de>
parents: 747
diff changeset
   273
"/        '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
   274
"/    ].
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   275
"/    (OperatingSystem canExecuteCommand:(CVSBinDir , 'patch')) ifFalse:[
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   276
"/        'CVSSourceCodeManager [warning]: limited functionality - no >> patch << command found' infoPrintCR.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
   277
"/    ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   278
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   279
    RemoteCVS := true.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   280
    UseWorkTree := false.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   281
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   282
    CacheDirectoryName ifNil:[
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   283
        self initCacheDirPath.
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   284
    ].
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   285
    CachingSources ifNil:[
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   286
        CachingSources := true.
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
   287
    ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   288
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   289
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   290
    "/ check if there is an stx directory there
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   291
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   292
    ((f := CVSRoot asFilename) exists 
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   293
    and:[f isDirectory
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   294
    and:[(top := f construct:'stx') exists
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   295
    and:[top isDirectory
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   296
    and:[top isReadable]]]]) ifTrue:[
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   297
        RemoteCVS := false
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   298
    ].
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   299
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   300
    Smalltalk at:#SourceCodeManager put:self.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   301
    DefaultManager := self.    
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
   302
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   303
    ('CVSSourceCodeManager [info]: repository CVSROOT is ''' , CVSRoot , '''.') infoPrintCR.
608
3e40ceddd8d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
   304
    RemoteCVS ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   305
        '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
   306
        ^ self
3e40ceddd8d3 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 607
diff changeset
   307
    ].
526
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   308
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   309
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   310
    "/ optionally set the WorkTreeDirectoryName from $STX_WORKTREE;
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   311
    "/ if non-nil, a working tree is kept there
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   312
    "/ and updated/commited files are not removed.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   313
    "/ If you use a regular (make-) tree, 
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   314
    "/ set WorkTreeDirectoryName (or the environment variable) to that.
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
    "/ this is not yet finished.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   317
    "/
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   318
    s := OperatingSystem getEnvironment:'STX_WORKTREE'.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   319
    s notNil ifTrue:[
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   320
        WorkTreeDirectoryName := s.
255316af8f8a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 522
diff changeset
   321
        UseWorkTree := true.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   322
    ]
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   323
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   324
    "
158
27f76f9d8a25 preparations of workTree-stuff
Claus Gittinger <cg@exept.de>
parents: 157
diff changeset
   325
     AbstractSourceCodeManager initialize
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   326
     CVSSourceCodeManager initialize
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   327
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   328
527
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   329
    "
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   330
     CVSRoot := '/files/CVS'.
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   331
     AbstractSourceCodeManager initialize.
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   332
     CVSSourceCodeManager initialize.
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   333
    "
4843ae488fdb commentary
Claus Gittinger <cg@exept.de>
parents: 526
diff changeset
   334
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   335
    "Created: / 4.11.1995 / 19:14:38 / cg"
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
   336
    "Modified: / 19.12.1995 / 14:25:46 / stefan"
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
   337
    "Modified: / 23.8.2001 / 12:18:55 / cg"
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   338
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   339
602
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   340
initializeForRepository:aDirectoryName
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   341
    "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
   342
     And reinitialize. 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   343
     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
   344
620
084fd1b48952 #cvsRootDirectory replaced by #repositoryName.
Stefan Vogel <sv@exept.de>
parents: 618
diff changeset
   345
    self repositoryName:aDirectoryName.
602
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   346
    AbstractSourceCodeManager initialize.
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   347
    CVSSourceCodeManager initialize.
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   348
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   349
    "
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   350
     CVSSourceCodeManager initializeForRepository:'/files/CVS'
630
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   351
     CVSSourceCodeManager initializeForRepository:'ibm:/files/CVS'
602
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   352
    "
96b978fdca85 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 595
diff changeset
   353
630
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   354
    "Created: / 13.8.1997 / 17:20:57 / cg"
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   355
    "Modified: / 25.9.1997 / 12:28:05 / stefan"
578986281052 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 629
diff changeset
   356
    "Modified: / 2.11.1997 / 17:08:27 / cg"
603
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   357
! !
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   358
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   359
!CVSSourceCodeManager class methodsFor:'accessing'!
55767434a58c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 602
diff changeset
   360
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   361
repositoryName
1023
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   362
    "return the name of the global repository.
59c182b03b6e comments
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   363
     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
   364
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   365
    ^ CVSRoot
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   366
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   367
    "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
   368
    "Modified: 19.9.1997 / 06:12:02 / cg"
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   369
!
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   370
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   371
repositoryName:aDirectoryName
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   372
    "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
   373
     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
   374
     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
   375
     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
   376
     variable setting."
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   377
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   378
    DisabledModules := nil.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   379
    CVSRoot := aDirectoryName.
482
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   380
ab073539c01e allow change of the repository
Claus Gittinger <cg@exept.de>
parents: 477
diff changeset
   381
    "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
   382
    "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
   383
!
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   384
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   385
repositoryName:aRepositoryName forModule:aModuleName
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   386
    "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
   387
     classes in a particular module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   388
     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
   389
     for a particular module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   390
     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
   391
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
   392
    DisabledModules := nil.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   393
    CVSModuleRoots isNil ifTrue:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   394
        CVSModuleRoots := Dictionary new.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   395
    ].
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   396
    CVSModuleRoots at:aModuleName put:aRepositoryName
866
632da1088521 comment
Claus Gittinger <cg@exept.de>
parents: 856
diff changeset
   397
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   398
    "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
   399
!
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   400
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   401
repositoryNameForModule:aModuleName
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   402
    "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
   403
     classes in a particular module.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   404
     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
   405
     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
   406
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   407
    CVSModuleRoots isNil ifTrue:[^nil].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   408
    ^ CVSModuleRoots at:aModuleName ifAbsent:nil.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   409
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   410
    "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
   411
    "Created: 19.9.1997 / 06:13:06 / cg"
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   412
!
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   413
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   414
repositoryNamesPerModule
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   415
    "return the dictionary, which associates CVSRoots to module names.
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   416
     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
   417
     the default cvsRoot (CVSRoot) will be used."
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   418
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   419
    ^ CVSModuleRoots ? (Dictionary new)
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   420
!
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   421
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   422
repositoryNamesPerModule:aDictionary
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   423
    "set the dictionary, which associates CVSRoots to module names.
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   424
     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
   425
     the default cvsRoot (CVSRoot) will be used."
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   426
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   427
    CVSModuleRoots := aDictionary
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   428
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   429
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
   430
!CVSSourceCodeManager class methodsFor:'private'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   431
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   432
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
   433
    "checkout realtiveFilename in tempdir"
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   434
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   435
    |cmd|
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   436
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   437
    cmd := 'checkout -l ' , relativeFilename.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   438
    ^ self 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   439
        executeCVSCommand:cmd 
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   440
        module:moduleDir
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   441
        inDirectory:tempdir name
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   442
        log:false
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   443
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   444
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   445
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   446
      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
   447
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   448
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   449
    "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
   450
    "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
   451
!
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   452
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   453
checkinTroubleDialog:title message:message log:log abortable:abortable option:optionTitle
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   454
    "trouble checking in - open a dialog"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   455
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   456
    ^ self
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   457
        checkinTroubleDialog:title 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   458
        message:message 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   459
        log:log 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   460
        abortable:abortable 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   461
        option:optionTitle 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   462
        option2:nil
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   463
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   464
    "Created: 10.12.1995 / 17:34:33 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   465
    "Modified: 12.9.1996 / 02:39:06 / cg"
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   466
!
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   467
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   468
checkinTroubleDialog:title message:message log:log abortable:abortable option:optionTitle option2:optionTitle2
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   469
    "trouble checking in - open a dialog"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   470
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
   471
    |l box list listView optionPressed option2Pressed|
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   472
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   473
    l := log collect:[:line | line withTabsExpanded].
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   474
    list := SelectionInList with:l.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   475
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   476
    box := Dialog new.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   477
    box label:(title).
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   478
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   479
    (box addTextLabel:message) borderWidth:0.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   480
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   481
    listView := SelectionInListView on:list.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   482
    listView disable.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   483
    listView height:200.
749
c91f5a3fc9c0 do not make log-list tabbable (in MERGE-dialog)
Claus Gittinger <cg@exept.de>
parents: 748
diff changeset
   484
    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
   485
    box addVerticalSpace.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   486
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   487
    abortable ifTrue:[
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   488
        box addAbortButton
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   489
    ].
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   490
    optionTitle notNil ifTrue:[
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   491
        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
   492
    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   493
    optionTitle2 notNil ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   494
        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
   495
    ].
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   496
    box addOkButton.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   497
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   498
    box extent:(box preferredExtent).
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   499
    box minExtent:box extent.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   500
    box maxExtent:box extent.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   501
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   502
    box showAtPointer.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   503
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   504
    box destroy.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   505
    optionPressed == true ifTrue:[^ #option].
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   506
    option2Pressed == true ifTrue:[^ #option2].
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   507
    ^ box accepted
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   508
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
   509
    "Created: 9.9.1996 / 19:12:45 / cg"
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   510
    "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
   511
!
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
   512
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   513
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
   514
    "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
   515
     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
   516
     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
   517
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   518
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   519
    |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
   520
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   521
    filename := pathInRepository asFilename.
167
5ee0797897c5 Fixes for stc.
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   522
    cvsDir := (aDirectory asFilename construct:'CVS') recursiveMakeDirectory.
5ee0797897c5 Fixes for stc.
Stefan Vogel <sv@exept.de>
parents: 166
diff changeset
   523
    entries := cvsDir construct:'Entries'.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   524
    name := filename baseName.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   525
    firstPart := '/', name, '/'.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   526
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   527
    s := entries readStream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   528
    s isNil ifTrue:[
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   529
        "/
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   530
        "/ no Repository yet, create one
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   531
        "/
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   532
        |index root|
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   533
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   534
        cvsRoot := self getCVSROOTForModule:aModule.
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   535
        "/
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   536
        "/ 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
   537
        "/
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   538
        index := cvsRoot indexOf:$/.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   539
        index > 0 ifTrue:[
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   540
            root := cvsRoot copyFrom:(index).
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   541
        ] ifFalse:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   542
            root := cvsRoot.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   543
        ].
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   544
        "/ create Repository
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   545
        "/ (notice, contents must be a Unix filename ...
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   546
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   547
        s := (cvsDir construct:'Repository') writeStream.
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   548
        path := Filename components:filename directory name.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   549
        path := path asStringWith:$/.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   550
        s nextPutLine:(root, '/', path).
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   551
        s close.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   552
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   553
        "/ make new Entries file.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   554
        s := entries writeStream.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   555
    ] ifFalse:[
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   556
        |newName newStream line|
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
        newName := Filename newTemporaryIn:cvsDir.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   559
        newStream := newName writeStream.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   560
        [(line := s nextLine) notNil] whileTrue:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   561
            (line findString:firstPart) ~= 1 ifTrue:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   562
                "/ 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
   563
                "/ 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
   564
                overwrite ifFalse:[
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   565
                    newName remove.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   566
                    newStream close.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   567
                    s close.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   568
                    ^ self
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   569
                ].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   570
                newStream nextPutLine:line
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   571
            ].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   572
        ].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   573
        newName renameTo:entries.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   574
        s close.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   575
        s := newStream.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   576
    ].
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   577
    s nextPutLine:firstPart, rev, '/', date, '/', special, '/'.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   578
    s close.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   579
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   580
    "
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   581
        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
   582
        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
   583
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   584
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
   585
    "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
   586
    "Modified: / 7.1.1998 / 14:15:35 / stefan"
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   587
    "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
   588
!
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   589
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   590
createLocalDirectory:packageDir inModule:moduleDir
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   591
    "create a local working directory for module/package.
806
dacfa8d24dcf checkin from browser
Claus Gittinger <cg@exept.de>
parents: 804
diff changeset
   592
     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
   593
     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
   594
     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
   595
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   596
    ^ self
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   597
        createLocalDirectory:packageDir 
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   598
        inModule:moduleDir 
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   599
        with:'.stxCvsDummy'
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   600
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   601
    "
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   602
     self createLocalDirectory:'libbasic' inModule:'stx'
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   603
    "
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   604
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   605
    "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
   606
    "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
   607
    "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
   608
!
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   609
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   610
createLocalDirectory:packageDir inModule:moduleDir with:fileToCheckout
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   611
    "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
   612
     given file there.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   613
     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
   614
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   615
    |path absolutePath tempdir unixPath|
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   616
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   617
    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
   618
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   619
    tempdir := self createTempDirectory:nil forModule:nil.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   620
    tempdir isNil ifTrue:[
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   621
        ('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
   622
        ^ nil
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   623
    ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   624
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   625
    OperatingSystem isUNIXlike ifTrue:[
892
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   626
        unixPath := path name.
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   627
    ] ifFalse:[
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   628
        OperatingSystem isVMSlike ifTrue:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
   629
            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
   630
        ].
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   631
        unixPath := path name copy replaceAll:$\ with:$/
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
    (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
   635
        "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
   636
        absolutePath := tempdir construct:path.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   637
        absolutePath directory recursiveMakeDirectory.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   638
        "now create the file"
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   639
        (absolutePath writeStream close) isNil ifTrue:[
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   640
            ('CVSSourceCodeManager [error]: cannot create dummy') errorPrintCR.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   641
            tempdir recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   642
            ^ nil.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   643
        ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   644
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   645
        "now create the dummy file in the repository"
892
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   646
        (self import:moduleDir in:tempdir) ifFalse:[
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   647
            ('CVSSourceCodeManager [error]: cannot import dummy') errorPrintCR.
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
   648
        ].
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   649
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   650
        "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
   651
        (tempdir construct:moduleDir) recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   652
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   653
        "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
   654
        (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
   655
            ('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
   656
            tempdir recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   657
            ^ nil.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   658
        ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   659
    ].
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   660
        
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   661
    ^ tempdir.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   662
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   663
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   664
     self createLocalDirectory:'libbasic' inModule:'stx'
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   665
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   666
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   667
    "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
   668
    "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
   669
    "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
   670
!
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   671
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   672
createTempDirectory:packageDir forModule:moduleDir
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   673
    "create a temp directory for checking out"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   674
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   675
    |tempdir dir|
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   676
680
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   677
    "/ if CVSTempDir isNil, use current.
045fb25eb8e7 added CVSTempDir;
Claus Gittinger <cg@exept.de>
parents: 679
diff changeset
   678
    tempdir := Filename newTemporaryIn:CVSTempDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   679
    tempdir exists ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   680
        tempdir recursiveRemove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   681
    ].
606
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   682
    OperatingSystem errorSignal handle:[:ex |
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   683
        '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
   684
        ^ nil.
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   685
    ] do:[
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   686
        tempdir makeDirectory.
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
   687
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   688
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   689
    moduleDir notNil ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   690
        dir := tempdir construct:moduleDir.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   691
        dir makeDirectory.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
   692
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   693
        packageDir notNil ifTrue:[
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   694
            dir := dir construct:packageDir.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   695
            dir recursiveMakeDirectory.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   696
        ].
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   697
        dir exists ifFalse:[
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   698
            tempdir recursiveRemove.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
   699
            'SourceCodemanager [error]: cannot create temporary directory' errorPrintCR.
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   700
            ^ nil.
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
   701
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   702
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   703
    ^ tempdir
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   704
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   705
    "self createTempDirectory:'fooPackage' forModule:'fooModule'"
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   706
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   707
    "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
   708
    "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
   709
    "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
   710
!
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   711
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   712
cvsTimeString:absoluteTime
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   713
    "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
   714
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   715
                         123456789012345678901234
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   716
                         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
   717
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   718
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   719
    |date time stream|
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   720
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   721
    date := absoluteTime asDate.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   722
    time := absoluteTime asTime.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   723
    stream := WriteStream on:(String new:24).
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   724
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   725
    (#('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
   726
    stream space.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   727
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   728
    (#('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
   729
        at:(date month)) printOn:stream.
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   730
    stream space.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   731
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   732
    date day printOn:stream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   733
    stream space.
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
    time print24HourFormatOn: stream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   736
    stream space.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   737
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   738
    date year printOn:stream.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   739
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   740
    ^ stream contents
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
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   744
     CVSSourceCodeManager cvsTimeString:(AbsoluteTime now)
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   745
    "
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   746
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
   747
    "Modified: 20.12.1995 / 11:03:32 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   748
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   749
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   750
executeCVSCommand:cvsCommand module:moduleName inDirectory:dir
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   751
    "execute command and prepend cvs command name and global options.
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   752
     if dir ~= nil, execute command in that directory.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   753
     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
   754
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   755
    ^ self
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   756
        executeCVSCommand:cvsCommand 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   757
        module:moduleName 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   758
        inDirectory:dir 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   759
        log:true
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   760
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   761
    "Modified: / 20.5.1998 / 16:07:28 / cg"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   762
!
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   763
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   764
executeCVSCommand:cvsCommand module:moduleName inDirectory:dir log:doLog
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   765
    "execute command and prepend cvs command name and global options.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   766
     if dir ~= nil, execute command in that directory.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   767
     The doLog argument, if false supresses a logEntry to be added 
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   768
     in the cvs log file (used when reading / extracting history)"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   769
831
9f359f49fbf1 time watchdog added to cvs command execution
Claus Gittinger <cg@exept.de>
parents: 830
diff changeset
   770
    |command cvsRoot rslt pathOfDir p|
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   771
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   772
    cvsRoot := self getCVSROOTForModule:moduleName.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   773
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   774
    doLog ifFalse:[
754
99b423372ef4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 753
diff changeset
   775
        command := CVSBinDir , 'cvs -l -d "', cvsRoot, '" ', cvsCommand.
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   776
    ] ifTrue:[
754
99b423372ef4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 753
diff changeset
   777
        command := CVSBinDir , 'cvs -d "', cvsRoot, '" ', cvsCommand.
675
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
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   780
    Verbose == true ifTrue:[
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
   781
        ('CVSMGR [info]: executing: ' , command , '[in ' , dir , ']') infoPrintCR.
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   782
    ].
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   783
767
1402401e8aec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
   784
    pathOfDir := dir asFilename pathName.
929
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   785
    Processor isDispatching ifFalse:[
831
9f359f49fbf1 time watchdog added to cvs command execution
Claus Gittinger <cg@exept.de>
parents: 830
diff changeset
   786
        rslt := OperatingSystem executeCommand:command inDirectory:pathOfDir.
929
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   787
    ] ifTrue:[
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   788
        p := [
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   789
            rslt := OperatingSystem executeCommand:command inDirectory:pathOfDir.
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   790
        ] fork.
1001
3bc7faf87159 longer timeout (for big class files)
Claus Gittinger <cg@exept.de>
parents: 995
diff changeset
   791
        (p waitUntilTerminatedWithTimeout:300) ifTrue:[
929
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   792
            ('CVSMGR [info]: command timeout: ' , command) infoPrintCR.
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   793
            ^ false
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   794
        ].    
6966f6b4129d do not fork if Processor is not yet dispatching
ca
parents: 927
diff changeset
   795
    ].
831
9f359f49fbf1 time watchdog added to cvs command execution
Claus Gittinger <cg@exept.de>
parents: 830
diff changeset
   796
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   797
    rslt ifFalse:[
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
   798
        ('CVSMGR [info]: command failed: ' , command) infoPrintCR.
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   799
    ].
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   800
    ^ rslt
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   801
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   802
    "Modified: / 23.4.1996 / 15:24:00 / stefan"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   803
    "Created: / 20.5.1998 / 16:06:34 / cg"
767
1402401e8aec checkin from browser
Claus Gittinger <cg@exept.de>
parents: 761
diff changeset
   804
    "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
   805
!
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
getCVSROOTForModule:aModuleName
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   808
    "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
   809
     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
   810
     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
   811
     the global (fallBack) CVSRoot.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   812
     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
   813
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   814
    |root|
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   815
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   816
    CVSModuleRoots isNil ifTrue:[^ CVSRoot].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   817
    aModuleName isNil ifTrue:[^ CVSRoot].
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   818
    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
   819
    ^ root ? CVSRoot
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   820
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   821
    "Created: / 19.9.1997 / 06:18:07 / cg"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   822
    "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
   823
!
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   824
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   825
getCVSROOTsPerModule
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   826
    "return a dictionary, which associates CVSRoots to modules" 
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   827
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   828
    ^ CVSModuleRoots ? #()
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   829
!
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
   830
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   831
import:moduleDir in:tempdir
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   832
    "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
   833
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   834
    |cmd|
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   835
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   836
    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
   837
    ^ self 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   838
        executeCVSCommand:cmd 
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
   839
        module:moduleDir
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   840
        inDirectory:tempdir name
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   841
        log:false
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   842
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   843
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   844
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   845
      |f d|
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   846
      f := 'stefan/dummy/fasel'.
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   847
      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
   848
      d directory recursiveMakeDirectory.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   849
      d writeStream close.
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   850
      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
   851
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   852
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   853
    "Created: / 23.7.1999 / 19:19:34 / stefan"
807
f84a9377278e Fix .stxCvsDummy / import stuff.
Stefan Vogel <sv@exept.de>
parents: 806
diff changeset
   854
    "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
   855
    "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
   856
!
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
   857
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   858
releaseAndRemove:tempdir module:moduleDir outputTo:outputFilename
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   859
    "cleanup; release tree towards cvs and remove the temporary tree"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   860
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
   861
    |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
   862
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
   863
    outputFilename isNil ifTrue:[
822
256ba484c777 NUL device
ps
parents: 818
diff changeset
   864
        OperatingSystem isMSDOSlike ifTrue:[
256ba484c777 NUL device
ps
parents: 818
diff changeset
   865
            redirect := 'NUL'
256ba484c777 NUL device
ps
parents: 818
diff changeset
   866
        ] ifFalse:[
256ba484c777 NUL device
ps
parents: 818
diff changeset
   867
            redirect := '/dev/null'
256ba484c777 NUL device
ps
parents: 818
diff changeset
   868
        ]
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
   869
    ] ifFalse:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   870
        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
   871
    ].
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
   872
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
   873
    "/
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
   874
    "/ 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
   875
    "/
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
   876
    cmd := '-l release > ' , redirect.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   877
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   878
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   879
        module:moduleDir
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   880
        inDirectory:tempdir name
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   881
        log:false
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
   882
    ) 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
   883
"/        '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
   884
    ].
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
   885
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
   886
    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
   887
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   888
    "Modified: / 23.4.1996 / 14:29:49 / stefan"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   889
    "Created: / 19.9.1997 / 06:28:02 / cg"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
   890
    "Modified: / 20.5.1998 / 16:44:07 / cg"
822
256ba484c777 NUL device
ps
parents: 818
diff changeset
   891
    "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
   892
!
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
   893
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   894
repositoryTopDirectory
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   895
    "return the top of the repository. This handles remote CVS connections
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   896
     as well"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   897
758
14b304ca1d73 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 756
diff changeset
   898
    CVSRoot isNil ifTrue:[^ nil].
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   899
    ^ self repositoryTopDirectory:CVSRoot.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   900
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   901
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   902
     CVSSourceCodeManager repositoryTopDirectory
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   903
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   904
640
9a3fb7645218 More fixes for :pserver:.
Stefan Vogel <sv@exept.de>
parents: 639
diff changeset
   905
    "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
   906
    "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
   907
!
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   908
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   909
repositoryTopDirectory:aString
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   910
    "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
   911
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   912
    |idx|
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   913
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   914
    idx := aString indexOf:$/.
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   915
    idx <= 1 ifTrue:[
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   916
        ^ aString.
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   917
    ].
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   918
    ^ aString copyFrom:idx.
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   919
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   920
    "
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   921
     CVSSourceCodeManager repositoryTopDirectory:':pserver:stefan@ibm.exept.de:/archiv/cvs'
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
   922
     CVSSourceCodeManager repositoryTopDirectory:'exept:/files/CVS'
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   923
     CVSSourceCodeManager repositoryTopDirectory:'/archiv/cvs'
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   924
    "
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   925
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
   926
    "Modified: / 16.1.1998 / 17:32:03 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   927
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   928
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   929
revisionStringFromLog:log entry:entry forClass:aClass
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   930
    "given a log entry, extract a revision string"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   931
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   932
    |oldRev idx special|
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   933
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   934
    oldRev := aClass revisionString.
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   935
    special := ''.
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   936
554
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   937
    oldRev notNil ifTrue:[
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   938
        idx := oldRev lastIndexOf:$[.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   939
        idx ~~ 0 ifTrue:[
554
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   940
            idx := oldRev indexOf:$[ startingAt:idx+1.
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   941
            idx ~~ 0 ifTrue:[
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   942
                special := ' ' , (oldRev copyFrom:idx).
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   943
            ]
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   944
        ].
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   945
    ].
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   946
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   947
    ^ '$Header: ' , (log at:#container) ,
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   948
      ' ' , (entry at:#revision) ,
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   949
      ' ' , (entry at:#date) , 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   950
      ' ' , (entry at:#author) , 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   951
      ' ' , (entry at:#state) ,
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   952
      ' $' ,
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   953
      special
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   954
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   955
    "Created: 16.9.1996 / 20:24:14 / cg"
554
dc818ce74166 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 550
diff changeset
   956
    "Modified: 3.3.1997 / 22:31:51 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   957
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   958
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   959
updatedRevisionStringOf:aClass forRevision:newRevision with:originalVersionString
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   960
    "update a revision string"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   961
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   962
    |idx leftPart rightPart vsnString newVsn|
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   963
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   964
    "/ search for ,v
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   965
    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
   966
    idx == 0 ifTrue:[^ nil].
485
ced03221d6e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
   967
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   968
    leftPart := originalVersionString copyTo:(idx - 1 + 5).
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   969
    rightPart := (originalVersionString copyFrom:(idx + 5)) withoutSpaces.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   970
    idx := rightPart indexOfSeparator.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
   971
    idx == 0 ifTrue:[^ nil].
485
ced03221d6e8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 484
diff changeset
   972
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   973
    vsnString := rightPart copyTo:idx - 1.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   974
    rightPart := rightPart copyFrom:idx + 1.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   975
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   976
    newRevision isNil ifTrue:[
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   977
        (vsnString endsWith:'m') ifTrue:[
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   978
             "/ alread a modified class
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   979
"/            ('already modified: ' , vsnString) printNL.
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   980
            ^ nil
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   981
        ].
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   982
        newVsn := vsnString , 'm'
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   983
    ] ifFalse:[
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
   984
        newVsn := newRevision
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   985
    ].
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   986
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   987
    ^ leftPart , ' ' , newVsn , ' ' , rightPart
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   988
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   989
    "Created: 7.12.1995 / 20:23:38 / cg"
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
   990
    "Modified: 16.9.1996 / 20:24:28 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   991
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   992
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
   993
!CVSSourceCodeManager class methodsFor:'source code access'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
   994
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
   995
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
   996
    "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
   997
     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
   998
     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
   999
     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
  1000
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1001
    |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
  1002
     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
  1003
     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
  1004
     mySource mergedSource modulePath time 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1005
     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
  1006
     emSep comment how|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1007
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1008
    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
  1009
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1010
    logMsg := logMessage.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1011
    (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
  1012
        logMsg := 'checkin from browser'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1013
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1014
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1015
    cmdOut := Filename newTemporary.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1016
    cmdOut exists ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1017
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1018
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1019
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1020
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1021
    "/ 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
  1022
    "/ 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
  1023
    "/ other users changes.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1024
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1025
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1026
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1027
    "/ 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
  1028
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1029
    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
  1030
    tempdir isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1031
        ('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
  1032
        ^ false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1033
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1034
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1035
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1036
    "/ 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
  1037
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1038
    modulePath :=  moduleDir , '/' , packageDir. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1039
    checkoutName :=  modulePath , '/' , containerFilename.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1040
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1041
    revision isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1042
        "/ a new file ...
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1043
        ^ self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1044
            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
  1045
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1046
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1047
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1048
    "/ 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
  1049
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1050
    time := AbsoluteTime now subtractSeconds:1.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1051
    time := time addSeconds:(time utcOffset).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1052
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1053
    self createEntryFor:checkoutName 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1054
         module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1055
         in:(tempdir construct:modulePath) 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1056
         revision:revision
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1057
         date:(self cvsTimeString:time)
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1058
         special:''
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1059
         overwrite:true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1060
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1061
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1062
    "/ copy-over our current version
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
    Stream errorSignal handle:[:ex|
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1065
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1066
        '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
  1067
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1068
    ] do:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1069
        s := (tempdir construct:checkoutName) writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1070
        s nextPutAll:someText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1071
        s close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1072
    ].
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
    "/ 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
  1076
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1077
    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
  1078
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1079
    cmd := 'update ', containerFilename, ' >', cmdOut name.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1080
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1081
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1082
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1083
        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
  1084
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1085
        force ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1086
            '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
  1087
            tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1088
            cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1089
            '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
  1090
            ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1091
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1092
    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1093
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1094
        "/ 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
  1095
        "/   empty   -> nothing changed
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1096
        "/   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
  1097
        "/   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
  1098
        "/              needs special action
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1099
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1100
        (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
  1101
            whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1102
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1103
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1104
    cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1105
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1106
    (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
  1107
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1108
        "/ no change
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
"/        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
  1111
        force ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1112
            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
  1113
        ].
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
        ^ true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1116
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1117
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1118
    Verbose == true ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1119
        ('CVSMGR: result is: ' , whatHappened) infoPrintCR.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1120
    ].
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
    force ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1123
        revision isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1124
            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
  1125
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1126
            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
  1127
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1128
        changeLog notNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1129
            s := WriteStream on:String new.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1130
            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
  1131
            changesAsLogged := s contents.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1132
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1133
            "/ mhmh - that should not happen
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1134
            changesAsLogged := ''.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1135
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1136
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1137
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1138
    didMerge := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1139
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
    "/ 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
  1142
    "/ 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
  1143
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1144
    whatHappened := whatHappened asCollectionOfLines asStringCollection.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1145
    whatHappened := whatHappened select:[:line |
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1146
                        (line startsWith:'RCS file') not
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1147
                        and:[(line startsWith:'retrieving') not
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1148
                        and:[(line startsWith:'Merging') not
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1149
                        and:[line size > 0]]]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1150
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1151
    whatHappened := whatHappened asString.
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
    (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
  1154
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1155
        "/ merged in changes
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
        (force 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1158
        or:[changeLog isNil 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1159
        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
  1160
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1161
            "/ 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
  1162
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1163
            Transcript showCR:'checking in ' , containerFilename , ' ...'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1164
        ] ifFalse:[
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
            "/ 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
  1167
            "/ and version have been merged.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1168
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1169
            didMerge := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1170
            changesAsLogged := changesAsLogged asCollectionOfLines.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1171
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1172
            s := WriteStream on:String new.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1173
            s nextPutAll:someText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1174
            mySource := s contents asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1175
            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
  1176
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1177
            mySource = mergedSource ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1178
                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
  1179
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1180
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
  1181
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
  1182
(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
  1183
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1184
                self checkinTroubleDialog:'Merging versions'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1185
                               message:msg 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1186
                               log:changesAsLogged
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1187
                               abortable:false 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1188
                               option:nil.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1189
                didMerge := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1190
            ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1191
                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
  1192
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1193
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
  1194
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
  1195
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
  1196
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
  1197
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1198
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
  1199
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
  1200
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
  1201
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
  1202
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
  1203
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1204
Continue ?'.
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
                answer := self checkinTroubleDialog:'Merging versions'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1207
                               message:msg 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1208
                               log:changesAsLogged
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1209
                               abortable:true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1210
                               option:'stop - see first'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1211
                answer ~~ true ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1212
                    answer == #option ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1213
                        DiffTextView 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1214
                            openOn:mySource
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1215
                            label:'current version'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1216
                            and:mergedSource
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1217
                            label:'merged version'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1218
                            
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1219
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1220
                    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
  1221
                    tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1222
                    ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1223
                ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1224
            ].
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
"/                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
  1227
"/                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
  1228
"/' , changesAsLogged , '
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1229
"/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1230
"/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
  1231
"/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
  1232
"/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
  1233
"/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
  1234
"/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1235
"/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
  1236
"/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
  1237
"/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
  1238
"/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
  1239
"/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1240
"/Continue ?'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1241
"/                (self confirm:msg) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1242
"/                    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
  1243
"/                    tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1244
"/                    ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1245
"/                ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1246
            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
  1247
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1248
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1249
        (whatHappened startsWith:'C ') ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1250
            "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1251
            "/ 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
  1252
            "/ 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
  1253
            "/
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
            changesAsLogged := changesAsLogged asCollectionOfLines.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1256
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1257
            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
  1258
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1259
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
  1260
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1261
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
  1262
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
  1263
'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1264
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1265
            answer := self checkinTroubleDialog:'Version conflict'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1266
                 message:msg 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1267
                 log:changesAsLogged
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1268
                 abortable:false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1269
                 option:'show conflicts'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1270
                 option2:'resolve conflicts'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1271
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1272
            answer == #option ifTrue:[
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
                "/ 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
  1275
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1276
                Diff3TextView
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1277
                    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
  1278
                    label:'your version (checkin attempt)' 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1279
                    label:'original (base version)' 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1280
                    label:'newest repository version'. 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1281
            ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1282
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1283
            checkInRepaired := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1284
            answer == #option2 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1285
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1286
                "/ allow checkin of repair version
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1287
                "/ this is error prone ...
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
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1290
                "/ 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
  1291
                "/ ... accept will check it in.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1292
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1293
                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
  1294
                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
  1295
                             with:(#backgroundColor->Color green)).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1296
                emphasizedText := Diff3TextView 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1297
                            emphasizeMergedDiff3Text:emphasizedText 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1298
                            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
  1299
                                              with:(#backgroundColor->Color blue))
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1300
                            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
  1301
                                              with:(#backgroundColor->Color red))
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1302
                            emphasizeSep:emSep.
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
                comment := 
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
"/ 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
  1307
"/ 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
  1308
"/ from some other checkin.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1309
"/ 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
  1310
"/ 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1311
"/ 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
  1312
"/ 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
  1313
"/ 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
  1314
"/ ***************************************************************
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1315
'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1316
                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
  1317
                emphasizedText := comment , emphasizedText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1318
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1319
                didAccept := false. checkInRepaired := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1320
                [didAccept not and:[checkInRepaired]] whileTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1321
                    editor := RCSConflictEditTextView 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1322
                                setupWith:emphasizedText
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1323
                                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
  1324
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1325
                    editor acceptAction:[:dummy |
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1326
                        repairedText := editor list.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1327
                        didAccept := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1328
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1329
                    didAccept := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1330
                    editor topView openModal.
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
                    didAccept ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1333
                        (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
  1334
                        ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1335
                            checkInRepaired := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1336
                        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1337
                    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1338
                        "/ 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
  1339
                        (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
  1340
                            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
  1341
                            didAccept := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1342
                        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1343
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1344
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1345
                ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1346
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1347
                checkInRepaired ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1348
                    out := (tempdir construct:checkoutName) writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1349
                    out isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1350
                        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
  1351
                        checkInRepaired := false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1352
                    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1353
                        out nextPutAll:(repairedText asString string).
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1354
                        didAccept := true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1355
                        out close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1356
                    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1357
                ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1358
            ].
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
            checkInRepaired ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1361
                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
  1362
            ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1363
                '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
  1364
                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
  1365
                tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1366
                ^ false.
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
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1369
            (whatHappened startsWith:'U ') ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1370
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1371
                "/ 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
  1372
                "/ a newer version.
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
                tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1375
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1376
                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
  1377
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
  1378
                ^ true.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1379
            ] ifFalse:[
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
                "/ unexpected
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1382
                "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1383
                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
  1384
' , whatHappened , '
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
No checkin performed.'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1387
                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
  1388
                tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1389
                ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1390
            ]
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
    "/ now check it in again
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1397
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1398
    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
  1399
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1400
    logMsg := logMsg replChar:$"  withString:'\"'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1401
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1402
    OperatingSystem isUNIXlike ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1403
        "/ 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
  1404
        logTmp := Filename newTemporaryIn:tempdir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1405
        s := logTmp writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1406
        s nextPutAll:logMsg.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1407
        s close.
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
        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
  1410
    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1411
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1412
        "/ 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
  1413
        "/ 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
  1414
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1415
        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
  1416
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1417
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1418
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1419
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1420
        inDirectory:tempdir name
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1421
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1422
        '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
  1423
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1424
        (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
  1425
            whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1426
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1427
            whatHappened := '<< no message >>'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1428
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1429
        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
  1430
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1431
' , whatHappened , '
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1432
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1433
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
  1434
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1435
       '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
  1436
        logTmp notNil ifTrue:[logTmp remove].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1437
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1438
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1439
        ^ false.
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
    logTmp notNil ifTrue:[logTmp remove].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1442
    (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
  1443
        whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1444
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1445
        whatHappened := nil
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
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1448
    tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1449
    cmdOut remove.
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
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1452
    "/ 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
  1453
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1454
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1455
    (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
  1456
        '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
  1457
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1458
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1459
        idx := whatHappened indexOfLineStartingWith:'new revision:'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1460
        idx == 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1461
            '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
  1462
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1463
            l := whatHappened at:idx.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1464
            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
  1465
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1466
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1467
    ^ true
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1468
!
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1469
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1470
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
  1471
    "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
  1472
     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
  1473
     instead, the code is checked in as given (Dangerous).
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1474
     Return true if ok, false if not."
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1475
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1476
    |tempdir cmd checkoutName logMsg revision logTmp 
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
  1477
     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
  1478
     newRevision newString binRevision className msg answer didMerge
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1479
     mySource mergedSource modulePath time 
830
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  1480
     editor checkInRepaired didAccept emphasizedText repairedText out 
c788d0c93635 allow for base-package only checkin
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  1481
     emSep comment how|
814
58fbd75117a2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 811
diff changeset
  1482
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1483
    className := cls name.
938
e6fef2babac9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1484
    cls isPrivate ifTrue:[
e6fef2babac9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1485
        self error:'refuse to check in private classes.'.
e6fef2babac9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 935
diff changeset
  1486
    ].
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1487
    revision := cls revision.
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1488
    revision isNil ifTrue:[ 
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1489
        force ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1490
            ('CVSSourceCodeManager [warning]: class ' , className, ' has no revision string') errorPrintCR.
854
36ce711b8568 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 847
diff changeset
  1491
            (Dialog 
36ce711b8568 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 847
diff changeset
  1492
                confirm:('class ' , className, ' has no (usable) revision string.\\check in as newest ?') withCRs
36ce711b8568 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 847
diff changeset
  1493
                noLabel:'cancel')
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1494
            ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1495
                ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1496
            ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1497
        ]
995
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1498
    ] ifFalse:[
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1499
        (revision endsWith:$m) ifTrue:[
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1500
            "/ this class has already been checked in with a merge,
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1501
            "/ but not reloaded from the repository.
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1502
            "/ must use the original revision string.
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1503
            revision := revision copyWithoutLast:1.
c754159d1aef *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 947
diff changeset
  1504
        ]
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1505
    ].
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1506
    (binRevision := cls binaryRevision) notNil ifTrue:[
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1507
        revision ~= binRevision ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1508
            ('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
  1509
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1510
    ].
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1511
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1512
    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
  1513
        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
  1514
        revision isNil ifTrue:[
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1515
            force ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1516
                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
  1517
            ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1518
                revision := '1.0'
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1519
            ]
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
  1520
        ]
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1521
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1522
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1523
    logMsg := logMessage.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1524
    (logMsg isNil or:[logMsg isEmpty]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1525
        logMsg := 'checkin from browser'.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1526
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1527
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1528
    cmdOut := Filename newTemporary.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1529
    cmdOut exists ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1530
        cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1531
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1532
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1533
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1534
    "/ in CVS, we have to checkout the file first, in order
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1535
    "/ 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
  1536
    "/ other users changes.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1537
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1538
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1539
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1540
    "/ first, create a temporary work tree
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1541
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1542
    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
  1543
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1544
        ('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
  1545
        ^ false
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  1546
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1547
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1548
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1549
    "/ 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
  1550
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1551
    modulePath :=  moduleDir , '/' , packageDir. 
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1552
    checkoutName :=  modulePath , '/' , classFileName.
166
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1553
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1554
    "/
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1555
    "/ 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
  1556
    "/
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1557
    time := AbsoluteTime now subtractSeconds:1.
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1558
    time := time addSeconds:(time utcOffset).
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1559
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  1560
    self createEntryFor:checkoutName 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1561
         module:moduleDir
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1562
         in:(tempdir construct:modulePath) 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1563
         revision:revision
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1564
         date:(self cvsTimeString:time)
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1565
         special:''
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1566
         overwrite:true.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1567
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1568
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1569
    "/ copy-over our current version
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1570
    "/
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  1571
    Object errorSignal handle:[:ex|
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1572
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1573
        'CVSSourceCodeManager [error]: cannot copy-over filedOut class source' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1574
        ^ false.
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  1575
    ] do:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1576
        sourceFileName asFilename copyTo:(tempdir construct:checkoutName).
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1577
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1578
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1579
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1580
    "/ synchronize i.e. merge in any changes
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1581
    "/
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1582
    self activityNotification:'merging ' , cls name , ' with repository version ...'.
159
b66f0e62b312 activity notifications added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1583
738
f4e54d4f3ea5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1584
    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
  1585
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1586
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1587
        module:moduleDir
738
f4e54d4f3ea5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 737
diff changeset
  1588
        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
  1589
    ) ifFalse:[
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1590
        force ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1591
            '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
  1592
            tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1593
            cmdOut remove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1594
            '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
  1595
            ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1596
        ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1597
    ] ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1598
        "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1599
        "/ 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
  1600
        "/   empty   -> nothing changed
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1601
        "/   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
  1602
        "/   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
  1603
        "/              needs special action
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1604
        "/
719
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  1605
        (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
  1606
            whatHappened := cmdOut contentsOfEntireFile asString.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1607
        ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1608
    ].
380
b339513da159 ignore short files in cache;
Claus Gittinger <cg@exept.de>
parents: 267
diff changeset
  1609
    cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1610
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1611
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1612
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1613
        "/ no change
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1614
        "/
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1615
"/        Transcript showCR:'no change in ' , className , ' (repository unchanged)'.
188
191e0970f405 copy file for mod-time
Claus Gittinger <cg@exept.de>
parents: 179
diff changeset
  1616
        tempdir recursiveRemove.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1617
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1618
        force ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1619
            self information:'nothing changed in ' , className , ' (repository unchanged)'.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1620
        ] ifTrue:[
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  1621
            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
  1622
            (changeLog isNil or:[(changeLog at:#revisions) size ~~ 1]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1623
                'CVSSourceCodeManager [error]: failed to update revisionString (no log)' errorPrintCR.
522
2eab45532246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
  1624
                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
  1625
            ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1626
                entry := (changeLog at:#revisions) first.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  1627
                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
  1628
                cls updateVersionMethodFor:newString.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1629
                cls revision ~= newRevision ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1630
                    '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
  1631
                ]
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1632
            ]
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1633
        ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1634
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1635
        ^ true
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1636
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1637
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1638
    Verbose == true ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
  1639
        ('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
  1640
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1641
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1642
    force ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1643
        revision isNil ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1644
            changeLog := self revisionLogOf:cls.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1645
        ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1646
            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
  1647
        ].
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1648
        changeLog notNil ifTrue:[
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1649
            s := WriteStream on:String new.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1650
            self writeRevisionLogMessagesFrom:changeLog withHeader:false to:s.
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1651
            changesAsLogged := s contents.
725
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1652
        ] ifFalse:[
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1653
            "/ mhmh - that should not happen
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1654
            changesAsLogged := ''.
dc077e26b75c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 724
diff changeset
  1655
        ].
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1656
    ].
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1657
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1658
    didMerge := false.
1002
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  1659
    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
  1660
726
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1661
    "/
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1662
    "/ cvs above rel10 returns a multiline info ...
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1663
    "/ 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
  1664
    "/
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1665
    whatHappened := whatHappened asCollectionOfLines asStringCollection.
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1666
    whatHappened := whatHappened select:[:line |
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1667
                        (line startsWith:'RCS file') not
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1668
                        and:[(line startsWith:'retrieving') not
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1669
                        and:[(line startsWith:'Merging') not
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1670
                        and:[line size > 0]]]
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1671
                    ].
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1672
    whatHappened := whatHappened asString.
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  1673
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1674
    (force or:[whatHappened startsWith:'M ']) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1675
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1676
        "/ merged in changes
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1677
        "/
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1678
        (force 
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1679
        or:[changeLog isNil 
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1680
        or:[(changeLog at:#revisions) isEmpty]]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1681
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1682
            "/ pretty good - nothing has changed in the meanwhile
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1683
            "/
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1684
            Transcript showCR:'checking in ' , className , ' ...'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1685
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1686
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1687
            "/ 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
  1688
            "/ and version have been merged.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1689
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1690
            didMerge := true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1691
            changesAsLogged := changesAsLogged asCollectionOfLines.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1692
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1693
            s := WriteStream on:String new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1694
            cls fileOutOn:s withTimeStamp:false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1695
            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
  1696
            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
  1697
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1698
            mySource = mergedSource ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1699
                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
  1700
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1701
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
  1702
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
  1703
(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
  1704
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1705
                self checkinTroubleDialog:'Merging versions'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1706
                               message:msg 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1707
                               log:changesAsLogged
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1708
                               abortable:false 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1709
                               option:nil.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1710
                didMerge := false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1711
            ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1712
                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
  1713
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1714
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
  1715
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
  1716
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
  1717
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
  1718
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1719
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
  1720
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
  1721
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
  1722
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
  1723
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
  1724
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1725
Continue ?'.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1726
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1727
                answer := self checkinTroubleDialog:'Merging versions'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1728
                               message:msg 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1729
                               log:changesAsLogged
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1730
                               abortable:true
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1731
                               option:'stop - see first'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1732
                answer ~~ true ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1733
                    answer == #option ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1734
                        DiffTextView 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1735
                            openOn:mySource
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1736
                            label:'current version'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1737
                            and:mergedSource
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1738
                            label:'merged version'.
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1739
                            
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1740
                    ].
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1741
                    Transcript showCR:'checkin aborted - (no merge; repository unchanged)'.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1742
                    tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1743
                    ^ false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1744
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1745
            ].
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1746
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1747
"/                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
  1748
"/                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
  1749
"/' , changesAsLogged , '
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1750
"/
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1751
"/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
  1752
"/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
  1753
"/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
  1754
"/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
  1755
"/
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1756
"/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
  1757
"/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
  1758
"/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
  1759
"/is different from your current classes.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1760
"/
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1761
"/Continue ?'.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1762
"/                (self confirm:msg) ifFalse:[
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1763
"/                    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
  1764
"/                    tempdir recursiveRemove.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1765
"/                    ^ false.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1766
"/                ].
257
00ab43b47e8d showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 236
diff changeset
  1767
            Transcript showCR:'checking in ' , className , ' (merged other changes) ...'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1768
        ]
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1769
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1770
        (whatHappened startsWith:'C ') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1771
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1772
            "/ conflict; someone else checked in something in the meanwhile,
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1773
            "/ 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
  1774
            "/
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1775
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1776
            changesAsLogged := changesAsLogged asCollectionOfLines.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1777
179
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.
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1779
151
2ecdebacc512 more for merging (classes which have no valid revision string)
Claus Gittinger <cg@exept.de>
parents: 147
diff changeset
  1780
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
  1781
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1782
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
  1783
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
  1784
'.
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1785
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1786
            answer := self checkinTroubleDialog:'Version conflict'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1787
                 message:msg 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1788
                 log:changesAsLogged
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1789
                 abortable:false
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1790
                 option:'show conflicts'
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1791
                 option2:'resolve conflicts'.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1792
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1793
            answer == #option ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1794
                "/
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1795
                "/ show conflicts in a 3-way DiffTextView ...
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1796
                "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1797
                Diff3TextView
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1798
                    openOnMergedText:(tempdir construct:checkoutName) readStream contents 
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1799
                    label:'your version (checkin attempt)' 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1800
                    label:'original (base version)' 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1801
                    label:'newest repository version'. 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1802
            ].
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1803
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1804
            answer == #option2 ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1805
                "/
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1806
                "/ allow checkin of repair version
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1807
                "/ this is error prone ...
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1808
                "/
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1809
                "/
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1810
                "/ show merged version in an editor ...
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1811
                "/ ... accept will check it in.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1812
                "/
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1813
                emphasizedText := (tempdir construct:checkoutName) readStream contents.
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1814
                emSep := (Array with:(#color->Color black)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1815
                             with:(#backgroundColor->Color green)).
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1816
                emphasizedText := Diff3TextView 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1817
                            emphasizeMergedDiff3Text:emphasizedText 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1818
                            emphasize1:(Array with:(#color->Color white)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1819
                                              with:(#backgroundColor->Color blue))
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1820
                            emphasize2:(Array with:(#color->Color white)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1821
                                              with:(#backgroundColor->Color red))
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1822
                            emphasizeSep:emSep.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1823
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1824
                comment := 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1825
'"/ ***************************************************************
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1826
"/ This text contains your current versions code (blue)
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1827
"/ 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
  1828
"/ from some other checkin.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1829
"/ 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
  1830
"/ 
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1831
"/ 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
  1832
"/ 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
  1833
"/ 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
  1834
"/ ***************************************************************
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1835
'.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1836
                comment := (Text string:comment emphasis:emSep) asStringCollection.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1837
                emphasizedText := comment , emphasizedText.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1838
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1839
                didAccept := false. checkInRepaired := true.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1840
                [didAccept not and:[checkInRepaired]] whileTrue:[
692
61505992de88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 682
diff changeset
  1841
                    editor := RCSConflictEditTextView 
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1842
                                setupWith:emphasizedText
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1843
                                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
  1844
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1845
                    editor acceptAction:[:dummy |
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1846
                        repairedText := editor list.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1847
                        didAccept := true.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1848
                    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1849
                    didAccept := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1850
                    editor topView openModal.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1851
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1852
                    didAccept ifFalse:[
854
36ce711b8568 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 847
diff changeset
  1853
                        (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
  1854
                        ifFalse:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1855
                            checkInRepaired := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1856
                        ]
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1857
                    ] ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1858
                        "/ check if all green-stuff (separators) have been removed
578
e1fe2e232555 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 574
diff changeset
  1859
                        (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
  1860
                            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
  1861
                            didAccept := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1862
                        ]
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1863
                    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1864
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1865
                ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1866
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1867
                checkInRepaired ifTrue:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1868
                    out := (tempdir construct:checkoutName) writeStream.
447
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1869
                    out isNil ifTrue:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  1870
                        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
  1871
                        checkInRepaired := false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1872
                    ] ifFalse:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1873
                        out nextPutAll:(repairedText asString string).
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1874
                        didAccept := true.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1875
                        out close.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1876
                    ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1877
                ]
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1878
            ].
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1879
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1880
            checkInRepaired ifTrue:[
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1881
                Transcript showCR:'checking in ' , className , ' (manually repaired version) ...'
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1882
            ] ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1883
                '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
  1884
                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
  1885
                tempdir recursiveRemove.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1886
                ^ false.
4914760f1461 added mechanism to resolve conflicts
Claus Gittinger <cg@exept.de>
parents: 445
diff changeset
  1887
            ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1888
        ] ifFalse:[
1047
e78a6ee0e77c treat P(atch)-rsponse from cvs like U(pdate)-response
ps
parents: 1037
diff changeset
  1889
            ((whatHappened startsWith:'U ') 
e78a6ee0e77c treat P(atch)-rsponse from cvs like U(pdate)-response
ps
parents: 1037
diff changeset
  1890
            or:[ (whatHappened startsWith:'P ') ]) ifTrue:[
629
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1891
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1892
                "/ nothing changed here, but the repository already contains
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1893
                "/ a newer version.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1894
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1895
                tempdir recursiveRemove.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1896
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1897
                self information:'nothing changed in your ''' , className , ''';
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1898
but repository already contains a newer version (repository unchanged).'.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1899
                ^ true.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1900
            ] ifFalse:[
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1901
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1902
                "/ unexpected
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1903
                "/
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1904
                self warn:'unexpected message from CVS:
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1905
' , whatHappened , '
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1906
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  1907
No checkin performed.'.
629
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1908
                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
  1909
                tempdir recursiveRemove.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1910
                ^ false.
6e59525f4932 better message in case of check-in and repository
ca
parents: 628
diff changeset
  1911
            ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1912
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1913
    ].
209
c20db1bcd820 cleanup
Claus Gittinger <cg@exept.de>
parents: 208
diff changeset
  1914
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1915
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1916
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1917
    "/ now check it in again
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1918
    "/
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  1919
    self activityNotification:'saving ' , cls name , ' in repository ...'.
159
b66f0e62b312 activity notifications added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  1920
152
56747cda83bd escape doubleQuote with backslash in log message
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
  1921
    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
  1922
711
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1923
    OperatingSystem isUNIXlike ifFalse:[
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1924
        "/ save the log message into another tempFile ...
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1925
        logTmp := Filename newTemporaryIn:tempdir.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1926
        s := logTmp writeStream.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1927
        s nextPutAll:logMsg.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1928
        s close.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1929
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1930
        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
  1931
    ] ifTrue:[
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1932
        "/
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1933
        "/ 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
  1934
        "/ CVS V1.9.16 to stdout.
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1935
        "/
706414b66b8e oops - no additional newline in logMsg (win32)
Claus Gittinger <cg@exept.de>
parents: 710
diff changeset
  1936
        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
  1937
    ].
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1938
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1939
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1940
        module:moduleDir
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1941
        inDirectory:tempdir name
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  1942
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1943
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  1944
719
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  1945
        (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1946
            whatHappened := cmdOut contentsOfEntireFile asString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1947
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1948
            whatHappened := '<< no message >>'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1949
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1950
        self warn:'The following problem was reported by cvs:
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1951
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1952
' , whatHappened , '
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1953
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1954
The class has NOT been checked into the repository.'.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1955
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1956
       'CVSSourceCodeManager [error]: cannot checkin modified class source' errorPrintCR.
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1957
        logTmp notNil ifTrue:[logTmp remove].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1958
        cmdOut remove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1959
        tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1960
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1961
    ].
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  1962
    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
  1963
    (cmdOut exists and:[cmdOut fileSize > 0]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1964
        whatHappened := cmdOut contentsOfEntireFile asString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1965
    ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1966
        whatHappened := nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1967
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1968
166
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1969
    tempdir recursiveRemove.
dc8e56916049 Correct UTC-Time computation for CVS/Entries.
Stefan Vogel <sv@exept.de>
parents: 165
diff changeset
  1970
    cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1971
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1972
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1973
    "/ 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
  1974
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1975
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1976
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1977
        'CVSSourceCodeManager [error]: unexpected empty checkin command output' errorPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1978
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1979
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1980
        idx := whatHappened indexOfLineStartingWith:'new revision:'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1981
        idx == 0 ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  1982
            '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
  1983
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1984
            l := whatHappened at:idx.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  1985
            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
  1986
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1987
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1988
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  1989
    "/
143
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1990
    "/ 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
  1991
    "/   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
  1992
    "/   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
  1993
    "/   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
  1994
    "/   (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
  1995
    "/    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
  1996
    "/
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1997
    "/ 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
  1998
    "/ other version):
f4bad586eded dont patch classes revision string to newest in case of a merge
Claus Gittinger <cg@exept.de>
parents: 141
diff changeset
  1999
    "/    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
  2000
    "/    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
  2001
    "/    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
  2002
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2003
    newRevision notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2004
        didMerge ifFalse:[
211
da3daf8c87d7 show class name in activity notification
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
  2005
            self activityNotification:'fetch new revision number of ', cls name.
159
b66f0e62b312 activity notifications added
Claus Gittinger <cg@exept.de>
parents: 158
diff changeset
  2006
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2007
            changeLog := self revisionLogOf:cls fromRevision:newRevision toRevision:newRevision.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2008
            (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
  2009
                force ifTrue:[
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2010
                    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
  2011
                ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2012
            ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2013
            (changeLog isNil or:[(changeLog at:#revisions) size ~~ 1]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2014
                'CVSSourceCodeManager [error]: failed to update revisionString (no log)' errorPrintCR.
522
2eab45532246 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 521
diff changeset
  2015
                cls updateVersionMethodFor:'$' , 'Header' , '$'.  "/ concatenated to avoid RCS expansion
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2016
            ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2017
                entry := (changeLog at:#revisions) first.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  2018
                newString := self revisionStringFromLog:changeLog entry:entry forClass:cls.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2019
                cls updateVersionMethodFor:newString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2020
                cls revision ~= newRevision ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2021
                    'CVSSourceCodeManager [error]: failed to update revisionString' errorPrintCR
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2022
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2023
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2024
        ] ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2025
            newString := self updatedRevisionStringOf:cls forRevision:nil with:cls revisionString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2026
            cls updateVersionMethodFor:newString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2027
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2028
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2029
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2030
    Class addChangeRecordForClassCheckIn:cls.
869
9e8f3878bd65 checkin from browser
ps
parents: 866
diff changeset
  2031
    self postCheckIn:cls.
1002
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2032
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2033
    checkInRepaired ifTrue:[
30c1756e486c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1001
diff changeset
  2034
        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
  2035
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
  2036
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
  2037
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
  2038
1003
4f1191f69a45 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1002
diff changeset
  2039
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
  2040
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2041
    ^ true
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2042
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2043
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2044
     SourceCodeManager checkinClass:Array logMessage:'testing only'
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2045
    "
139
c40ea6aacacb better merge/conflict dialog; optionally display conflicts
Claus Gittinger <cg@exept.de>
parents: 137
diff changeset
  2046
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  2047
    "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
  2048
    "Modified: / 26.2.1998 / 17:34:16 / stefan"
726
b46e6d2ed9a1 cvs rel10.x change
Claus Gittinger <cg@exept.de>
parents: 725
diff changeset
  2049
    "Modified: / 17.10.1998 / 17:25:04 / cg"
115
b37d7975d9e2 fully update revisionMethod when checking in
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
  2050
!
b37d7975d9e2 fully update revisionMethod when checking in
Claus Gittinger <cg@exept.de>
parents: 113
diff changeset
  2051
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2052
checkoutModule:aModule package:aPackage andDo:aBlock
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2053
    "check out everything from a package into a temporary directory.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2054
     Then evaluate aBlock, passing the name of that temp-directory.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2055
     Afterwards, the tempDir is removed.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2056
     Return true, if OK, false if any error occurred."
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2057
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2058
    |cvsRoot containers moduleDir packageDir tempdir cmdOut cmd dirName|
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2059
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2060
    cvsRoot := self getCVSROOTForModule:aModule.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2061
    cvsRoot isNil ifTrue:[^ #() ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2062
1049
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2063
    aPackage notNil ifTrue:[
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2064
        dirName := aModule , '/' , aPackage.
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2065
    ] ifFalse:[
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2066
        dirName := aModule.
d4973bdddddc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1047
diff changeset
  2067
    ].
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2068
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2069
    self activityNotification:'checking out everything in ' , dirName , ' ...'.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2070
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2071
    tempdir := self createTempDirectory:nil forModule:nil.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2072
    tempdir isNil ifTrue:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2073
        ('CVSSourceCodeManager [error]: no tempDir - cannot checkout') errorPrintCR.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2074
        ^ false
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2075
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2076
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2077
    cmd := '-l checkout ', dirName.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2078
    OperatingSystem isUNIXlike ifTrue:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2079
        "/ can redirect output
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2080
        cmdOut := Filename newTemporary.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2081
        cmdOut exists ifTrue:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2082
            cmdOut remove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2083
        ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2084
        cmd := cmd , ' > ' , cmdOut name.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2085
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2086
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2087
    (self 
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2088
        executeCVSCommand:cmd 
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2089
        module:aModule
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2090
        inDirectory:tempdir name
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2091
    ) ifFalse:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2092
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2093
        cmdOut notNil ifTrue:[cmdOut remove].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2094
        tempdir recursiveRemove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2095
        ^ false
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2096
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2097
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2098
    cmdOut notNil ifTrue:[cmdOut remove].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2099
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2100
    packageDir := (tempdir construct:dirName).
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2101
    (packageDir exists 
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2102
    and:[packageDir isDirectory]) ifFalse:[
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2103
        'CVSSourceCodeManager [error]: checkout failed (no dir)' errorPrintCR.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2104
        tempdir recursiveRemove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2105
        ^ false
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2106
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2107
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2108
    "/ now, invoke the block ...
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2109
    [
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2110
        aBlock value:packageDir
761
1501e74c5791 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 760
diff changeset
  2111
    ] valueNowOrOnUnwindDo:[
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2112
        tempdir recursiveRemove.
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2113
    ].
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2114
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2115
    ^ true
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2116
761
1501e74c5791 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 760
diff changeset
  2117
    "Modified: / 28.4.1999 / 12:21:10 / cg"
760
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2118
!
a65d8d4c9169 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 758
diff changeset
  2119
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2120
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
  2121
    "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
  2122
     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
  2123
     the latest; otherwise, a specific revisions source is extracted.
3c3871b54d57 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
  2124
     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
  2125
     to validate the correct container against the class."
107
2042ff680821 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 106
diff changeset
  2126
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
  2127
    |dir cachedSourceFilename cachedFile cmd fullName revisionArg stream
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2128
     checkoutDir checkoutName checkoutNameLocal fullTempName fullCachedName tempdir cmdOut
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2129
     classFileName cvsRoot tempFile|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2130
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2131
    (DisabledModules notNil and:[DisabledModules includes:moduleDir]) ifTrue:[^ nil].
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2132
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2133
    cvsRoot := self getCVSROOTForModule:moduleDir.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2134
    cvsRoot isNil ifTrue:[^ nil].
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2135
    (RemoteCVS or:[cvsRoot asFilename exists]) ifFalse:[^ nil].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2136
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2137
    "/ if not already existing, create a cache directory
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2138
    "/ where we deposit sources.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2139
    "/ this is used as a cache for further requests, since
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2140
    "/ accessing the repository may be slow.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2141
    "/ (if cvs uses a remote connection via ppp, for example)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2142
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2143
836
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2144
    revision ~~ #newest ifTrue:[
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2145
        (dir := self sourceCacheDirectory) isNil ifTrue:[
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2146
            'CVSSourceCodeManager [warning]: no source cache directory' errorPrintCR.
29b8ced4cb33 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 832
diff changeset
  2147
        ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2148
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2149
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2150
    classFileName := fileName.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2151
    (classFileName endsWith:',v') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2152
        classFileName := classFileName copyWithoutLast:2.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2153
    ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2154
    (classFileName endsWith:'.st') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2155
        classFileName := classFileName copyWithoutLast:3.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2156
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2157
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2158
    fullName := moduleDir , '/' , packageDir , '/' , classFileName , '.st'.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2159
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2160
    (revision isNil or:[revision == #newest]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2161
        cachedSourceFilename := classFileName.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2162
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2163
        cachedSourceFilename := classFileName , '_' , revision.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2164
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2165
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2166
    dir notNil ifTrue:[
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  2167
        cachedFile := dir construct:cachedSourceFilename.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2168
        cachedFile exists ifTrue:[
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2169
            cachedFile fileSize < 10 ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2170
                ('CVSSourceCodeManager [warning]: existing: ', cachedFile name , ' seems corrupted.') errorPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2171
                cachedFile remove
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2172
            ] ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2173
"/            ('CVSSourceCodeManager [info]: found existing: ', cachedFile name) infoPrintCR.
535
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2174
                ^ cachedFile readStream
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2175
            ]
9e77c32bba75 new infoMessage scheme
Claus Gittinger <cg@exept.de>
parents: 533
diff changeset
  2176
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2177
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2178
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2179
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2180
    "/ 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
  2181
    "/ 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
  2182
    "/
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  2183
    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
  2184
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2185
        ('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
  2186
        ^ nil
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2187
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2188
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2189
"/    tempdir := Filename newTemporaryIn:nil.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2190
"/    tempdir exists ifTrue:[
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2191
"/        tempdir recursiveRemove.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2192
"/    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2193
"/    tempdir makeDirectory.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2194
"/    dir := tempdir construct:moduleDir.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2195
"/    dir makeDirectory.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2196
"/    dir := dir construct:packageDir.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2197
"/    dir recursiveMakeDirectory.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2198
"/    dir exists ifFalse:[
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2199
"/        tempdir recursiveRemove.
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
  2200
"/        'CVSMGR: cannot create temporary directory' infoPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2201
"/        ^ nil.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2202
"/    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2203
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2204
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2205
    "/ check it out there
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2206
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2207
    checkoutDir :=  moduleDir , '/' , packageDir.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2208
    checkoutName :=  checkoutDir , '/' , classFileName , '.st'.
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2209
    checkoutNameLocal := (moduleDir asFilename construct:packageDir) constructString:(classFileName , '.st').
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2210
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2211
    (revision isNil or:[revision == #newest]) ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2212
        cachedSourceFilename := classFileName.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2213
        revisionArg := ''.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2214
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2215
        cachedSourceFilename := classFileName , '_' , revision.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2216
        revisionArg := ' -r ' , revision.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2217
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2218
175
5eeed09f625c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 171
diff changeset
  2219
    self activityNotification:'checking out source ' , checkoutName.
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2220
    OperatingSystem isUNIXlike ifTrue:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2221
        "/ can redirect output
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2222
        cmdOut := Filename newTemporary.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2223
        cmdOut exists ifTrue:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2224
            cmdOut remove.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2225
        ].
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2226
        cmd := '-l checkout' , revisionArg , ' ', checkoutName , ' > ' , cmdOut name.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2227
    ] ifFalse:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2228
        cmd := '-l checkout' , revisionArg , ' ', checkoutName.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2229
    ].
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2230
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2231
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2232
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2233
        module:moduleDir
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2234
        inDirectory:tempdir name
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2235
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2236
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2237
        cmdOut notNil ifTrue:[cmdOut remove].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2238
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2239
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
1014
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2240
        "/ 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
  2241
        (self checkForExistingModule:moduleDir) ifFalse:[
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2242
            "/ disable
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2243
            DisabledModules isNil ifTrue:[
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2244
                DisabledModules := Set new.
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2245
            ].
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2246
            DisabledModules add:moduleDir.
adf578f3bd16 remember unaccessable repository modules and disable access.
Claus Gittinger <cg@exept.de>
parents: 1005
diff changeset
  2247
            ('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
  2248
        ].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2249
        ^ nil.
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
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2252
    cmdOut notNil ifTrue:[cmdOut remove].
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2253
    fullTempName := tempdir construct:checkoutNameLocal.
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2254
    fullCachedName := CacheDirectoryName asFilename constructString:cachedSourceFilename.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2255
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2256
    fullTempName exists ifFalse:[
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2257
        ('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
  2258
        tempdir recursiveRemove.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2259
        ^ nil
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2260
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2261
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2262
    (cacheIt 
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2263
    and:[cachedFile notNil
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2264
    and:[fullTempName exists]])
1059
f5d8cdd9433e care for bad(missing or disabled) cacheDirectory
Claus Gittinger <cg@exept.de>
parents: 1049
diff changeset
  2265
    ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2266
        (OperatingSystem errorSignal catch:[
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2267
            fullTempName moveTo:fullCachedName
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2268
        ]) ifTrue:[
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2269
            ('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
  2270
            tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2271
            ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2272
        ].
1067
35bc8c428c14 oops - cached stream
Claus Gittinger <cg@exept.de>
parents: 1064
diff changeset
  2273
        fullCachedName asFilename exists ifTrue:[
35bc8c428c14 oops - cached stream
Claus Gittinger <cg@exept.de>
parents: 1064
diff changeset
  2274
            stream := fullCachedName asFilename readStream.
35bc8c428c14 oops - cached stream
Claus Gittinger <cg@exept.de>
parents: 1064
diff changeset
  2275
        ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2276
    ] ifFalse:[
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2277
        OperatingSystem isUNIXlike ifFalse:[
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2278
            "/ cannot remove files which are still open ...
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2279
            "/ sigh - need a delete-on-close flag in FileStream.
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2280
            "/
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2281
            tempFile := Filename newTemporary.
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2282
            fullTempName copyTo:tempFile.
706
5149cb0621bd use removeOnClose feature on non-unix systems.
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
  2283
            stream := tempFile readStream.
791
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2284
            stream notNil ifTrue:[
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2285
                stream removeOnClose:true.
0b15bb280608 fixed pathnames for win32;
Claus Gittinger <cg@exept.de>
parents: 767
diff changeset
  2286
            ].
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2287
        ] ifTrue:[
1063
12a2a7d1aab6 oops - caching was broken
Claus Gittinger <cg@exept.de>
parents: 1059
diff changeset
  2288
            stream := fullTempName readStream.
703
85b690a9852d MSDOS changes
Claus Gittinger <cg@exept.de>
parents: 701
diff changeset
  2289
        ]
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
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2292
    self releaseAndRemove:tempdir module:moduleDir outputTo:nil. 
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2293
    ^ stream
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2294
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2295
    "Created: / 4.11.1995 / 19:46:20 / cg"
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2296
    "Modified: / 20.8.1997 / 16:37:11 / stefan"
1064
0596f789467b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1063
diff changeset
  2297
    "Modified: / 23.8.2001 / 12:28:59 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2298
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2299
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
  2300
!CVSSourceCodeManager class methodsFor:'source code administration'!
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2301
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2302
checkForExistingContainerInModule:moduleDir package:packageDir container:fileName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2303
    "check for a container to exist"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2304
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2305
    |fullName tempdir ret cvsRoot cmd|
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2306
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2307
    cvsRoot := self getCVSROOTForModule:moduleDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2308
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2309
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2310
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2311
    RemoteCVS ifFalse:[
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2312
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2313
        "/ with local CVS - simply check if that file exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2314
        "/
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2315
        (fullName endsWith:',v') ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2316
            fullName := fullName , ',v'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2317
        ].
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2318
        ^ (cvsRoot , '/' , fullName) asFilename exists.
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2319
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2320
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2321
    "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
  2322
     need a working directory, but reports missing files"
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2323
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2324
    (fullName endsWith:',v') ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2325
        fullName := fullName copyWithoutLast:2.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2326
    ].
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2327
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2328
    cmd := '-n rtag -l -F dummy '.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2329
    ret := self 
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2330
                executeCVSCommand:cmd , fullName 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2331
                module:moduleDir 
942
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2332
                "/ cg; cannot do it in current dir, in case it contains a CVS subDirectory,
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2333
                "/ with a different CVSRoot in its CVS/Root file ...
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2334
                "/ cvs would complain then.
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2335
                inDirectory:('/tmp' asFilename) "/ Filename currentDirectory pathName
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2336
                log:false.
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2337
    ^ ret
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2338
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2339
    "
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2340
     CVSSourceCodeManager 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2341
        checkForExistingContainerInModule:'stx' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2342
        package:'libbasic' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2343
        container:'Integer.st'     
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2344
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2345
     CVSSourceCodeManager 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2346
        checkForExistingContainerInModule:'stx' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2347
        package:'libtool' 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2348
        container:'AboutBox.st'  
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2349
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2350
     CVSSourceCodeManager 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2351
        checkForExistingContainerInModule:'stx' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2352
        package:'libtool' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2353
        container:'AboutBox.st,v'     
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2354
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2355
     CVSSourceCodeManager 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2356
        checkForExistingContainerInModule:'stx' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2357
        package:'libtool' 
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2358
        container:'FooBar.st'  
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2359
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2360
     CVSSourceCodeManager 
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2361
        checkForExistingContainerInModule:'DPU' 
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2362
        package:'test' 
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2363
        container:'marks'  
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2364
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2365
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2366
    "Created: / 9.12.1995 / 19:13:37 / cg"
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2367
    "Modified: / 1.3.1999 / 19:32:55 / cg"
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2368
    "Modified: / 23.7.1999 / 17:36:58 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2369
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2370
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2371
checkForExistingModule:moduleDir
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2372
    "check for a module to exist"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2373
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2374
    |ret cvsRoot cmd|
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2375
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2376
    self activityNotification:'checking for existing module ' , moduleDir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2377
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2378
    cvsRoot := self getCVSROOTForModule:moduleDir.
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  2379
    cvsRoot isNil ifTrue:[^ false].
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2380
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2381
    RemoteCVS ifFalse:[
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2382
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2383
        "/ with local CVS - simply check if that directory exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2384
        "/
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2385
        ^ (cvsRoot , '/' , moduleDir) asFilename isDirectory.
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2386
    ].
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2387
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2388
    "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
  2389
     need a working directory, but reports missing files"
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2390
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2391
    cmd := '-n rtag -l dummy '.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2392
    ret := self 
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2393
                executeCVSCommand:cmd , moduleDir 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2394
                module:moduleDir
942
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2395
                "/ cg; cannot do it in current dir, in case it contains a CVS subDirectory,
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2396
                "/ with a different CVSRoot in its CVS/Root file ...
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2397
                "/ cvs would complain then.
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2398
                inDirectory:('/tmp' asFilename) "/ Filename currentDirectory pathName
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2399
                log:false.
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  2400
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2401
    ^ ret
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2402
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2403
    "
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2404
     CVSSourceCodeManager checkForExistingModule:'stx'
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2405
     CVSSourceCodeManager checkForExistingModule:'DPU'
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2406
     CVSSourceCodeManager checkForExistingModule:'cg'  
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2407
     CVSSourceCodeManager checkForExistingModule:'aeg' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2408
     CVSSourceCodeManager checkForExistingModule:'foo'   
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2409
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2410
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2411
    "Created: / 9.12.1995 / 19:13:37 / cg"
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2412
    "Modified: / 1.3.1999 / 19:32:59 / cg"
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2413
    "Modified: / 23.7.1999 / 17:38:59 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2414
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2415
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2416
checkForExistingModule:moduleDir package:packageDir
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2417
    "check for a package to exist"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2418
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2419
    |fullName ret cvsRoot cmd|
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  2420
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2421
    self activityNotification:'checking for existing package ' , packageDir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2422
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  2423
    fullName := moduleDir , '/' , packageDir.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2424
    cvsRoot := self getCVSROOTForModule:moduleDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2425
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2426
    RemoteCVS ifFalse:[
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2427
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2428
        "/ with local CVS - simply check if that directory exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2429
        "/
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2430
        ^ (cvsRoot , '/' , fullName) asFilename isDirectory.
176
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2431
    ].
3b634e568759 oops - checkForExistingXXX did no longer work locally ?!
ah
parents: 175
diff changeset
  2432
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2433
    "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
  2434
     need a working directory, but reports missing files"
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2435
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2436
    cmd := '-n rtag -l -F dummy '.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2437
    ret := self 
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2438
                executeCVSCommand:cmd, fullName 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2439
                module:moduleDir
942
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2440
                "/ cg; cannot do it in current dir, in case it contains a CVS subDirectory,
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2441
                "/ with a different CVSRoot in its CVS/Root file ...
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2442
                "/ cvs would complain then.
4dfb85362f65 cannot do rtag command in current directory
ps
parents: 939
diff changeset
  2443
                inDirectory:('/tmp' asFilename) "/ Filename currentDirectory pathName
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2444
                log:false.
753
0454b00e1de5 fixed checkForExistingModule / checkForExistingPackage
Claus Gittinger <cg@exept.de>
parents: 749
diff changeset
  2445
491
4c86df4d8db9 Fix methods for remote CVS.
Stefan Vogel <sv@exept.de>
parents: 490
diff changeset
  2446
    ^ ret
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2447
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2448
    "
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2449
     CVSSourceCodeManager checkForExistingModule:'stx' package:'libbasic' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2450
     CVSSourceCodeManager checkForExistingModule:'aeg' package:'libProgram'  
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2451
     CVSSourceCodeManager checkForExistingModule:'foo' package:'libbasic' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2452
     CVSSourceCodeManager checkForExistingModule:'foo' package:'bar'   
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2453
     CVSSourceCodeManager checkForExistingModule:'cg' package:'private'   
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2454
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2455
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2456
    "Created: / 9.12.1995 / 19:13:37 / cg"
737
df0f84ee3205 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 726
diff changeset
  2457
    "Modified: / 1.3.1999 / 19:33:04 / cg"
803
bb4a95b315aa Speed up remote cvs queries.
Stefan Vogel <sv@exept.de>
parents: 794
diff changeset
  2458
    "Modified: / 23.7.1999 / 17:39:21 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2459
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2460
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2461
createContainerFor:aClass inModule:moduleDir package:packageDir container:fileName
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2462
    "create a container - this does an initial checkin
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2463
     (i.e. cvs add & cvs commit)"
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2464
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2465
    |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
  2466
     changeLog entry newString startIdx endIdx checkInDir logTmp s|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2467
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2468
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2469
    cmdOut := Filename newTemporary.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2470
    cmdOut exists ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2471
        cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2472
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2473
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2474
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2475
    checkoutName :=  moduleDir , '/' , packageDir.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2476
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2477
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2478
    "/ first, check out everything there - this creates the CVS helpfiles
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2479
    "/ required later.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2480
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2481
193
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2482
    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
  2483
    tempdir := self createLocalDirectory:packageDir inModule:moduleDir.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2484
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2485
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2486
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2487
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2488
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2489
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2490
    "/ create the source there
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2491
    "/
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  2492
    tempFile := (tempdir construct:checkoutName) construct:fileName.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2493
    aStream := tempFile writeStream.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2494
    aStream isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2495
        ('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
  2496
        tempdir recursiveRemove.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2497
        ^ false
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2498
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2499
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2500
    Class fileOutErrorSignal handle:[:ex |
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2501
        'CVSSourceCodeManager [error]: fileout failed' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2502
        aStream close.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  2503
        tempdir recursiveRemove.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2504
        ^ false
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2505
    ] do:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2506
        aClass fileOutOn:aStream withTimeStamp:false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2507
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2508
    aStream close.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2509
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2510
    tempFile exists ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2511
        '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
  2512
        tempdir recursiveRemove.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2513
        ^ false
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2514
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2515
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2516
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2517
    "/ and add it to the repository
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2518
    "/
193
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2519
    self activityNotification:'adding ' , fileName.
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2520
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2521
    OperatingSystem isUNIXlike ifTrue:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2522
        checkInDir := tempdir constructString:checkoutName.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2523
    ] ifFalse:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2524
        OperatingSystem isMSDOSlike ifTrue:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2525
            checkInDir := tempdir constructString:(checkoutName copyReplaceAll:$/ with:$\).
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2526
        ] ifFalse:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
  2527
            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
  2528
        ]
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2529
    ].
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2530
    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
  2531
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2532
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2533
        module:moduleDir
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2534
        inDirectory:checkInDir
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2535
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2536
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2537
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2538
        cmdOut remove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2539
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2540
        ('CVSSourceCodeManager [error]: cannot checkout ' , checkoutName) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2541
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2542
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2543
    cmdOut remove.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2544
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2545
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2546
    "/ commit
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2547
    "/
211
da3daf8c87d7 show class name in activity notification
Claus Gittinger <cg@exept.de>
parents: 209
diff changeset
  2548
    self activityNotification:'comitting ' , fileName.
193
8605ef9dcb44 give activityNotifications when creating a container
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  2549
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2550
    OperatingSystem isUNIXlike ifFalse:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2551
        "/ save the log message into another tempFile ...
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2552
        logTmp := Filename newTemporaryIn:checkInDir.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2553
        s := logTmp writeStream.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2554
        s nextPutAll:'initial checkin'.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2555
        s close.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2556
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2557
        cmd := 'commit -F "', logTmp baseName, '" ', fileName, ' >', cmdOut name.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2558
    ] ifTrue:[
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2559
        "/
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2560
        "/ 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
  2561
        "/ CVS V1.9.16 to stdout.
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2562
        "/
841
a026be83dc21 output a message to the transcript, when adding a new container.
Claus Gittinger <cg@exept.de>
parents: 836
diff changeset
  2563
        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
  2564
    ].
31c656290287 care for cmdOut file to exists after cvs command;
Claus Gittinger <cg@exept.de>
parents: 715
diff changeset
  2565
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2566
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2567
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2568
        module:moduleDir
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2569
        inDirectory:checkInDir "tempdir name"
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2570
    ) ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2571
        Verbose == true ifTrue:[
267
9d511577a315 printNL -> printCR
Claus Gittinger <cg@exept.de>
parents: 257
diff changeset
  2572
            'CVSMGR: failed to execute: ' infoPrint. cmd infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2573
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2574
        cmdOut fileSize > 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2575
            whatHappened := cmdOut contentsOfEntireFile asString.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2576
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2577
            whatHappened := '<< no message >>'
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2578
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2579
        self warn:'The following problem was reported by cvs:
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2580
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2581
' , whatHappened , '
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2582
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2583
The class has NOT been checked into the repository.'.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2584
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2585
       'CVSSourceCodeManager [error]: cannot checkin modified class source' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2586
        cmdOut remove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2587
        tempdir recursiveRemove.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2588
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2589
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2590
    whatHappened := cmdOut contentsOfEntireFile asString.
605
db13f9acfdc3 oops - temporary file was not removed in createContainer
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
  2591
    cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2592
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2593
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2594
    "/ release it towards cvs
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2595
    "/
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2596
    self releaseAndRemove:tempdir module:moduleDir outputTo:nil. 
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2597
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2598
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2599
    "/ 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
  2600
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2601
    (whatHappened isNil or:[whatHappened isEmpty]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2602
        'CVSSourceCodeManager [warning]: unexpected empty commit command output' errorPrintCR.
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2603
        "/ TODO: scan the file for $Header ...
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2604
        "/ and extract the revision manually
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2605
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2606
    ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2607
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2608
        idx := whatHappened indexOfLineStartingWith:'initial revision:'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2609
        idx ~~ 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2610
            startIdx := 18
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2611
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2612
            idx := whatHappened indexOfLineStartingWith:'new revision:'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2613
            idx ~~ 0 ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2614
                'CVSSourceCodeManager [warning]: container existed before' errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2615
                startIdx := 14.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2616
            ] ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2617
                '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
  2618
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2619
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2620
        idx ~~ 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2621
            l := whatHappened at:idx.
628
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2622
            endIdx := (l indexOf:$; startingAt:startIdx) - 1.
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2623
            endIdx < 0 ifTrue:[
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2624
                endIdx := l size
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2625
            ].
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2626
            newRevision := (l copyFrom:startIdx to:endIdx) withoutSpaces.
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2627
            (Number fromString:newRevision onError:nil) isNil ifTrue:[
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2628
                newRevision := '1.1'
78456d8ff546 CVS 1.9 has changed message format when creating new containers
tz
parents: 627
diff changeset
  2629
            ]
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2630
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2631
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2632
847
d2800baef050 checkin from browser
ca
parents: 841
diff changeset
  2633
    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
  2634
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2635
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2636
    "/ patch the classes revisionInfo (but keep binaryRevision unchanged)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2637
    "/ 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
  2638
    "/ the newly checked in version.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2639
    "/ (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
  2640
    "/  correctly for all unchanged methodss)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2641
    "/
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
  2642
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2643
    newRevision notNil ifTrue:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2644
        changeLog := self 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2645
                        revisionLogOf:aClass 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2646
                        fromRevision:newRevision 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2647
                        toRevision:newRevision
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2648
                        fileName:fileName
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2649
                        directory:packageDir
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2650
                        module:moduleDir.
133
888aa2dac89b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 132
diff changeset
  2651
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2652
        (changeLog isNil or:[(changeLog at:#revisions) size ~~ 1]) ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2653
            'CVSSourceCodeManager [error]: failed to update revisionString (no log)' errorPrintCR
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2654
        ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2655
            entry := (changeLog at:#revisions) first.
486
6922583bf941 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 485
diff changeset
  2656
            newString := self revisionStringFromLog:changeLog entry:entry forClass:aClass.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2657
            aClass updateVersionMethodFor:newString.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2658
            ('CVSSourceCodeManager [info]: updated revisionString to:',newString) infoPrintCR
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  2659
        ]
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2660
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2661
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2662
    tempdir recursiveRemove.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  2663
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  2664
    Class addChangeRecordForClassCheckIn:aClass.
869
9e8f3878bd65 checkin from browser
ps
parents: 866
diff changeset
  2665
    self postCheckIn:aClass.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2666
    ^ true
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2667
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  2668
    "Created: / 9.12.1995 / 19:13:37 / cg"
724
f9fe7098ef3c fixed create-container on win32
Claus Gittinger <cg@exept.de>
parents: 723
diff changeset
  2669
    "Modified: / 14.10.1998 / 11:01:57 / cg"
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2670
    "Modified: / 23.7.1999 / 19:47:59 / stefan"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2671
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2672
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2673
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
  2674
    "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
  2675
     (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
  2676
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2677
    |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
  2678
     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
  2679
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2680
    cmdOut := Filename newTemporary.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2681
    cmdOut exists ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2682
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2683
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2684
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2685
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2686
    checkoutName :=  moduleDir , '/' , packageDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2687
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2688
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2689
    "/ 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
  2690
    "/ required later.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2691
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2692
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2693
    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
  2694
    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
  2695
    tempdir isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2696
        ('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
  2697
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2698
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2699
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2700
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2701
    "/ create the source there
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2702
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2703
    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
  2704
    aStream := tempFile writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2705
    aStream isNil ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2706
        ('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
  2707
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2708
        ^ false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2709
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2710
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2711
    aStream nextPutAll:someText.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2712
    aStream close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2713
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2714
    tempFile exists ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2715
        '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
  2716
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2717
        ^ false
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2718
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2719
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2720
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2721
    "/ 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
  2722
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2723
    self activityNotification:'adding ' , fileName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2724
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2725
    OperatingSystem isUNIXlike ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2726
        checkInDir := tempdir constructString:checkoutName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2727
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2728
        OperatingSystem isMSDOSlike ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2729
            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
  2730
        ] ifFalse:[
939
3d9db91f992a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 938
diff changeset
  2731
            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
  2732
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2733
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2734
    cmd := 'add ' , fileName , ' > ' , cmdOut name.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2735
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2736
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2737
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2738
        inDirectory:checkInDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2739
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2740
        '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
  2741
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2742
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2743
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2744
        ('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
  2745
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2746
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2747
    cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2748
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2749
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2750
    "/ commit
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2751
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2752
    self activityNotification:'comitting ' , fileName.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2753
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2754
    OperatingSystem isUNIXlike ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2755
        "/ 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
  2756
        logTmp := Filename newTemporaryIn:checkInDir.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2757
        s := logTmp writeStream.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2758
        s nextPutAll:'initial checkin'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2759
        s close.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2760
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2761
        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
  2762
    ] ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2763
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2764
        "/ 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
  2765
        "/ 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
  2766
        "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2767
        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
  2768
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2769
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2770
    (self 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2771
        executeCVSCommand:cmd 
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2772
        module:moduleDir
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2773
        inDirectory:checkInDir "tempdir name"
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2774
    ) ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2775
        Verbose == true ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2776
            '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
  2777
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2778
        cmdOut fileSize > 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2779
            whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2780
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2781
            whatHappened := '<< no message >>'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2782
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2783
        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
  2784
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2785
' , whatHappened , '
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2786
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2787
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
  2788
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2789
       '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
  2790
        cmdOut remove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2791
        tempdir recursiveRemove.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2792
        ^ false.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2793
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2794
    whatHappened := cmdOut contentsOfEntireFile asString.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2795
    cmdOut remove.
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
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2798
    "/ release it towards cvs
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2799
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2800
    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
  2801
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2802
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2803
    "/ 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
  2804
    "/
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2805
    (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
  2806
        '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
  2807
        "/ 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
  2808
        "/ and extract the revision manually
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
    ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2811
        whatHappened := whatHappened asCollectionOfLines asStringCollection.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2812
        idx := whatHappened indexOfLineStartingWith:'initial revision:'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2813
        idx ~~ 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2814
            startIdx := 18
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2815
        ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2816
            idx := whatHappened indexOfLineStartingWith:'new revision:'.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2817
            idx ~~ 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2818
                '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
  2819
                startIdx := 14.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2820
            ] ifFalse:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2821
                '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
  2822
            ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2823
        ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2824
        idx ~~ 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2825
            l := whatHappened at:idx.
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2826
            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
  2827
            endIdx < 0 ifTrue:[
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2828
                endIdx := l size
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
            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
  2831
            (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
  2832
                newRevision := '1.1'
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2833
            ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2834
        ]
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2835
    ].
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2836
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2837
    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
  2838
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
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  2841
    ^ true
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
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2844
createModule:moduleName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2845
    "create a module directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2846
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2847
    |tempdir moduleDir cmdOut cmd|
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2848
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2849
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2850
    "/ first, create a temporary work tree
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2851
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2852
    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
  2853
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2854
        ('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
  2855
        ^ false
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2856
    ].
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2857
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2858
    cmdOut := Filename newTemporary.
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2859
    cmdOut exists ifTrue:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2860
        cmdOut remove.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2861
    ].
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2862
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2863
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2864
    "/ create the module directory 
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2865
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2866
    moduleDir := tempdir construct:moduleName.
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2867
    moduleDir exists ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2868
        '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
  2869
        tempdir recursiveRemove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2870
        ^ false.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2871
    ].     
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2872
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2873
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2874
    "/ then import it into CVS
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2875
    "/
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2876
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
  2877
    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
  2878
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2879
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2880
        module:moduleName
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2881
        inDirectory:tempdir name
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  2882
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2883
        '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
  2884
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2885
        cmdOut remove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2886
        tempdir recursiveRemove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2887
        ^ false.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2888
    ].
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2889
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2890
    '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
  2891
    tempdir recursiveRemove.
605
db13f9acfdc3 oops - temporary file was not removed in createContainer
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
  2892
    cmdOut remove.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2893
    ^ true
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2894
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
  2895
    "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
  2896
    "Modified: / 7.1.1998 / 14:18:57 / stefan"
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2897
    "Modified: / 6.6.1998 / 16:15:34 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2898
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2899
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2900
createModule:moduleDirName package:packageDirName
472
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2901
    "create a package directory"
111878eff048 comments
Claus Gittinger <cg@exept.de>
parents: 461
diff changeset
  2902
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2903
    |tempdir cmdOut cmd packageDir moduleDir where relativePath|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2904
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2905
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2906
    "/ first, create a temporary work tree
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2907
    "/
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2908
    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
  2909
    tempdir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2910
        ('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
  2911
        ^ false
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  2912
    ].
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2913
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2914
    cmdOut := Filename newTemporary.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2915
    cmdOut exists ifTrue:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2916
        cmdOut remove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2917
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2918
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2919
    moduleDir := tempdir construct:moduleDirName.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2920
    moduleDir isDirectory ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2921
        'CVSSourceCodeManager [error]: command failed: ' errorPrint. cmd errorPrintCR.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2922
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2923
        tempdir recursiveRemove.
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2924
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2925
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2926
        
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2927
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2928
    "/ create the package directory there
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2929
    "/
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2930
    packageDir := moduleDir construct:packageDirName.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2931
    OperatingSystem errorSignal catch:[
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
  2932
        packageDir recursiveMakeDirectory.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2933
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2934
    packageDir isDirectory ifFalse:[
224
8480651d8772 Pass CVSRoot to cvs with -d option.
Stefan Vogel <sv@exept.de>
parents: 218
diff changeset
  2935
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2936
        ('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
  2937
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2938
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2939
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2940
    "/
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2941
    "/ then import it into CVS
574
a3c4ee494a46 when creating new packageDir: walk over directory components,
Claus Gittinger <cg@exept.de>
parents: 554
diff changeset
  2942
    "/
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2943
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2944
    relativePath := moduleDirName asFilename constructString:packageDirName.
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  2945
    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
  2946
    (self 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2947
        executeCVSCommand:cmd 
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2948
        module:moduleDirName
892
e6da12b72fde create container fixes
tm
parents: 885
diff changeset
  2949
        inDirectory:tempdir name
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2950
    ) ifFalse:[
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2951
        '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
  2952
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2953
        cmdOut remove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2954
        tempdir recursiveRemove.
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2955
        ^ false.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2956
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2957
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2958
    tempdir recursiveRemove.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2959
    cmdOut remove.
141
1419f5d68ca0 fixed creation of new modules/packages
Claus Gittinger <cg@exept.de>
parents: 139
diff changeset
  2960
    ^ true
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  2961
804
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2962
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2963
      self createModule:'stefan' package:'dummy1'
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2964
    "
210040657004 Speedup creation of new containers in the repository.
Stefan Vogel <sv@exept.de>
parents: 803
diff changeset
  2965
639
9072415bbeb1 Fixes: grok new CVSROOT=:pserver:hostname:/pathname syntax.
Stefan Vogel <sv@exept.de>
parents: 638
diff changeset
  2966
    "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
  2967
    "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
  2968
    "Modified: / 18.1.2000 / 20:14:01 / cg"
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2969
!
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  2970
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  2971
getExistingContainersInModule:aModule package:aPackage
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  2972
    "return a list of existing containers.
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  2973
     This does not work with remote-CVS"
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  2974
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  2975
    |cvsRoot containers moduleDir packageDir tempdir cmdOut cmd dirName|
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  2976
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  2977
    cvsRoot := self getCVSROOTForModule:aModule.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2978
    cvsRoot isNil ifTrue:[^ #() ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2979
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  2980
    dirName := aModule , '/' , aPackage.
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  2981
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  2982
    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
  2983
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2984
    RemoteCVS ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2985
        "/ remote CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2986
        "/ filter the output of the history command
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2987
        "/ (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
  2988
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2989
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2990
        tempdir := self createTempDirectory:nil forModule:nil.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2991
        tempdir isNil ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2992
            ('CVSSourceCodeManager [error]: no tempDir - cannot checkout') errorPrintCR.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2993
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2994
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2995
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  2996
        cmd := '-l checkout ', dirName.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2997
        OperatingSystem isUNIXlike ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2998
            "/ can redirect output
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  2999
            cmdOut := Filename newTemporary.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3000
            cmdOut exists ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3001
                cmdOut remove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3002
            ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3003
            cmd := cmd , ' > ' , cmdOut name.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3004
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3005
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3006
        (self 
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3007
            executeCVSCommand:cmd 
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3008
            module:aModule
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3009
            inDirectory:tempdir name
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3010
        ) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3011
            '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
  3012
            cmdOut notNil ifTrue:[cmdOut remove].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3013
            tempdir recursiveRemove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3014
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3015
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3016
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3017
        cmdOut notNil ifTrue:[cmdOut remove].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3018
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3019
        packageDir := (tempdir construct:dirName).
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3020
        (packageDir exists 
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3021
        and:[packageDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3022
            'CVSSourceCodeManager [error]: checkout failed (no dir)' errorPrintCR.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3023
            tempdir recursiveRemove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3024
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3025
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3026
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3027
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3028
        "/ 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
  3029
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3030
        containers := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3031
        packageDir directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3032
            |fn|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3033
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3034
            (packageDir construct:aFilenameString) isDirectory ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3035
                containers add:aFilenameString
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3036
            ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3037
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3038
        tempdir recursiveRemove.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3039
    ] ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3040
        (cvsRoot := cvsRoot asFilename) exists ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3041
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3042
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3043
        ((moduleDir := cvsRoot construct:aModule) exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3044
        and:[moduleDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3045
            self warn:'No such module'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3046
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3047
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3048
        ((packageDir := moduleDir construct:aPackage) exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3049
        and:[packageDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3050
            self warn:'No such package'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3051
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3052
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3053
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3054
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3055
        "/ 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
  3056
        "/ strip off the ,v ending.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3057
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3058
        containers := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3059
        packageDir directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3060
            |fn|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3061
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3062
            (aFilenameString endsWith:',v') ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3063
                containers add:(aFilenameString copyWithoutLast:2)
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3064
            ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3065
        ].
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3066
    ].
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3067
    ^ containers sort
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3068
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3069
    "
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3070
     CVSSourceCodeManager getExistingContainersInModule:'stx' package:'libhtml'
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3071
     CVSSourceCodeManager getExistingContainersInModule:'cg'  package:'java'
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3072
     CVSSourceCodeManager getExistingContainersInModule:'sel' package:'bmti'
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3073
    "
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3074
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3075
    "Created: / 20.5.1998 / 19:48:59 / cg"
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3076
    "Modified: / 20.5.1998 / 22:08:29 / cg"
678
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3077
!
4d1de0639e2e added #getExistingContainersInModule:package:
Claus Gittinger <cg@exept.de>
parents: 675
diff changeset
  3078
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3079
getExistingModules
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3080
    "return a list of existing modules.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3081
     This does not work with remote-CVS"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3082
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3083
    |cvsRoot modules inStream list|
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3084
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3085
    cvsRoot := self getCVSROOTForModule:nil.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3086
    cvsRoot isNil ifTrue:[^ #() ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3087
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3088
    self activityNotification:'getting list of modules...'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3089
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3090
    RemoteCVS ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3091
        "/ remote CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3092
        "/ filter the output of the history command
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3093
        "/ (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
  3094
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3095
        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
  3096
        inStream isNil ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3097
            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
  3098
            ^ #().
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
        list := inStream contents asStringCollection.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3101
        inStream close.
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
        modules := Set new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3104
        list do:[:line |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3105
            |idx items entry|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3106
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3107
            items := line asCollectionOfWords.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3108
            "/ #( '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
  3109
            "/ fetch the word before '=='
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3110
        
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3111
            idx := items indexOf:'=='.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3112
            idx > 1 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3113
                entry := items at:idx-1.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3114
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3115
                "/ extract the first directory component ...
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3116
                idx := entry indexOf:$/.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3117
                idx ~~ 0 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3118
                    entry := entry copyTo:idx-1
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3119
                ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3120
                modules add:entry.
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
        modules := modules asArray
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3124
    ] ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3125
        "/ local CVS
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
        "/ enumerate the root directory, looking for subdirs
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3128
        "/ which contain a CVS subdir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3129
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3130
        (cvsRoot := cvsRoot asFilename) exists ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3131
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3132
        ].
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
        modules := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3135
        cvsRoot directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3136
            |fn|
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3137
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3138
            (aFilenameString endsWith:',v') ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3139
                (#('CVS' 'CVSROOT' 'Attic') includes:aFilenameString) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3140
                    (fn := (cvsRoot construct:aFilenameString)) isDirectory ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3141
                        modules add:aFilenameString
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3142
                    ]
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3143
                ]
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3144
            ]
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3145
        ].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3146
    ].
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3147
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3148
    ^ modules sort
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3149
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3150
    "
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3151
     CVSSourceCodeManager getExistingModules
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3152
    "
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3153
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3154
    "Created: / 20.5.1998 / 19:28:43 / cg"
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3155
    "Modified: / 20.5.1998 / 22:07:07 / cg"
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3156
!
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3157
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3158
getExistingPackagesInModule:aModule
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3159
    "return a list of existing packages.
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3160
     This does not work with remote-CVS"
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3161
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3162
    |cvsRoot packages moduleDir inStream list|
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3163
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3164
    cvsRoot := self getCVSROOTForModule:aModule.
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3165
756
cf687ed4838c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 755
diff changeset
  3166
    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
  3167
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3168
    RemoteCVS ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3169
        "/ remote CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3170
        "/ filter the output of the history command
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3171
        "/ (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
  3172
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3173
        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
  3174
        inStream isNil ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3175
            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
  3176
            ^ #().
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3177
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3178
        list := inStream contents asStringCollection.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3179
        inStream close.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3180
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3181
        packages := Set new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3182
        list do:[:line |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3183
            |items idx entry|
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
            items := line asCollectionOfWords.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3186
            "/ #( '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
  3187
            "/ fetch the word before '=='
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3188
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3189
            idx := items indexOf:'=='.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3190
            idx > 1 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3191
                entry := items at:idx-1.
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
                "/ extract the first directory component ...
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3194
                (entry startsWith:aModule) ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3195
                    idx := entry indexOf:$/.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3196
                    idx ~~ 0 ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3197
                        (entry copyTo:idx-1) = aModule ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3198
                            packages add:(entry copyFrom:idx+1).
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3199
                        ]
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3200
                    ].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3201
                ]
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3202
            ]
755
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3203
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3204
        packages := packages asArray
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3205
    ] ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3206
        "/ local CVS
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3207
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3208
        "/ enumerate the module directory, looking for subdirs
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3209
        "/ which contain a CVS subdir.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3210
        "/
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3211
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3212
        (cvsRoot := cvsRoot asFilename) exists ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3213
            ^ #()
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3214
        ].
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3215
        ((moduleDir := cvsRoot construct:aModule) exists
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3216
        and:[moduleDir isDirectory]) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3217
            self warn:'No such module'.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3218
            ^ #()
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
        packages := OrderedCollection new.
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3222
        moduleDir directoryContents do:[:aFilenameString |
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3223
            |fn|
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
            (aFilenameString endsWith:',v') ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3226
                (#('CVS' 'CVSROOT' 'Attic') includes:aFilenameString) ifFalse:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3227
                    (fn := (moduleDir construct:aFilenameString)) isDirectory ifTrue:[
35fa25c262a6 added load-from-repository support for remoteCVS
Claus Gittinger <cg@exept.de>
parents: 754
diff changeset
  3228
                        packages add:aFilenameString
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
        ].
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3233
    ].
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3234
    ^ packages sort
675
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3235
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3236
    "
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3237
     CVSSourceCodeManager getExistingPackagesInModule:'stx'
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3238
     CVSSourceCodeManager getExistingPackagesInModule:'cg'
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3239
     CVSSourceCodeManager getExistingPackagesInModule:'sel'
f7c08bb12bd7 added #getExistingModules & #getExistingPackagesInModule:
Claus Gittinger <cg@exept.de>
parents: 669
diff changeset
  3240
    "
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
    "Created: / 20.5.1998 / 19:28:43 / cg"
679
bc814f9f0cab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 678
diff changeset
  3243
    "Modified: / 20.5.1998 / 22:07:13 / cg"
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3244
!
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3245
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3246
initialRevisionStringFor:aClass inModule:moduleDir package:packageDir container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3247
    "return a string usable as initial revision string"
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3248
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3249
    |cvsRoot|
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3250
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3251
    cvsRoot := self getCVSROOTForModule:moduleDir.
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
  3252
    cvsRoot := self repositoryTopDirectory:cvsRoot.
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3253
    ^ self
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3254
        initialRCSRevisionStringFor:aClass 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3255
        in:(cvsRoot , '/' , moduleDir , '/' , packageDir)
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3256
        container:fileName
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3257
641
539406d77877 Fix initial rcs string for remote CVS
Stefan Vogel <sv@exept.de>
parents: 640
diff changeset
  3258
    "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
  3259
    "Modified: / 16.1.1998 / 17:34:13 / stefan"
545
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3260
!
198957db4e32 restructured & added demo classes
Claus Gittinger <cg@exept.de>
parents: 539
diff changeset
  3261
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3262
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
  3263
    "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
  3264
     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
  3265
     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
  3266
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3267
    |info|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3268
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3269
    info := self
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3270
            statusOf:nil 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3271
            fileName:classFileName 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3272
            directory:packageDir 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3273
            module:moduleDir.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3274
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3275
    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
  3276
    ^ 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
  3277
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3278
    "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3279
     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
  3280
    "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3281
!
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  3282
935
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3283
readRevisionLogEntryFromStream:inStream
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3284
    "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
  3285
     Return nil on end.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3286
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3287
     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
  3288
     filled with:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3289
              #revision              -> the revision string
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3290
              #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
  3291
              #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
  3292
              #state                 -> the RCS state
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3293
              #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
  3294
              #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
  3295
    "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3296
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3297
    |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
  3298
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3299
    atEnd := false.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3300
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3301
    revLine1 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3302
    [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
  3303
        whileTrue:[inStream atEnd ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3304
                    revLine1 := nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3305
                   ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3306
                    revLine1 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3307
                  ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3308
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3309
    revLine2 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3310
    (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
  3311
        record := IdentityDictionary new.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3312
        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
  3313
        "/ 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
  3314
        (revLine2 asCollectionOfSubstringsSeparatedBy:$;) do:[:info |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3315
            |subEntry|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3316
            subEntry := info withoutSeparators.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3317
            #('date:'   #date
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3318
              'author:' #author 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3319
              'state:'  #state 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3320
              'lines:'  #numberOfChangedLines
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3321
             ) pairWiseDo:[:word :key |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3322
                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
  3323
                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
  3324
            ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3325
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3326
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3327
        "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
  3328
        (record includesKey:#numberOfChangedLines) ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3329
            record at:#numberOfChangedLines put:''
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3330
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3331
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3332
        s := nil.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3333
        line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3334
        [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
  3335
            (line startsWith:'==========') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3336
                atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3337
            ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3338
                (line withoutSpaces = '.') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3339
                    line := '*** empty log message ***'
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3340
                ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3341
                s isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3342
                    s := line
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3343
                ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3344
                    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
  3345
                ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3346
                line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3347
            ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3348
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3349
        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
  3350
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3351
    ^record.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3352
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3353
!
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3354
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3355
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
  3356
    "remove a container"
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3357
818
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3358
    (self removeContainerInModule:moduleDir package:packageDir container:fileName) ifFalse:[
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3359
        ^ false
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3360
    ].
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3361
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3362
    "/
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3363
    "/ patch the classes revisionInfo (but keep binaryRevision unchanged)
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3364
    "/ 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
  3365
    "/ some container-less class.
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3366
    "/ (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
  3367
    "/  correctly for all unchanged methodss)
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3368
    "/
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3369
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3370
    aClass updateVersionMethodFor:'no longer in repository'.
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3371
    Class addChangeRecordForClassContainerRemove:aClass.
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3372
    ^ true
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3373
!
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3374
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3375
removeContainerInModule:moduleDir package:packageDir container:fileName
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3376
    "remove a container"
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3377
501
c3ccbea7930c removed unused vars
Claus Gittinger <cg@exept.de>
parents: 491
diff changeset
  3378
    |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
  3379
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3380
    fullName := moduleDir , '/' , packageDir , '/' , fileName.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3381
    checkoutName :=  moduleDir , '/' , packageDir.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3382
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3383
    (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
  3384
        '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
  3385
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3386
        ('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
  3387
        ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3388
    ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3389
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3390
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3391
    "/ 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
  3392
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3393
    self activityNotification:'removing ' , fileName.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3394
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3395
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3396
    "/ 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
  3397
    "/
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  3398
    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
  3399
    tempFile exists ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3400
        '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
  3401
        tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3402
        ^ false
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3403
    ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3404
885
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3405
    tempFile exists ifTrue:[
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3406
        tempFile remove.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3407
    ].
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3408
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3409
    cmdOut := Filename newTemporary.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3410
    cmdOut exists ifTrue:[
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3411
        cmdOut remove.
f0a7be47b53a fixed (hopefully) creation of new package dirs
Claus Gittinger <cg@exept.de>
parents: 869
diff changeset
  3412
    ].
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3413
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3414
    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
  3415
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3416
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3417
        module:moduleDir
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  3418
        inDirectory:(tempdir constructString:checkoutName)
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3419
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3420
        '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
  3421
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3422
        cmdOut remove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3423
        tempdir recursiveRemove.
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3424
        ('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
  3425
        ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3426
    ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3427
    cmdOut remove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3428
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3429
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3430
    "/ commit
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3431
    "/
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  3432
    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
  3433
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3434
    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
  3435
    (self 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3436
        executeCVSCommand:cmd 
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3437
        module:moduleDir
617
96c14afeeb9d use Filename protocol to construct subDir names (prep for VMS)
Claus Gittinger <cg@exept.de>
parents: 616
diff changeset
  3438
        inDirectory:(tempdir constructString:checkoutName)
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3439
    ) ifFalse:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3440
        'CVSSourceCodeManager [error]: failed to execute: ' errorPrint. cmd errorPrintCR.
539
017889159bcd newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents: 535
diff changeset
  3441
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3442
        cmdOut fileSize > 0 ifTrue:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3443
            whatHappened := cmdOut contentsOfEntireFile asString.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3444
        ] ifFalse:[
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3445
            whatHappened := '<< no message >>'
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3446
        ].
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3447
        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
  3448
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3449
' , whatHappened , '
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3450
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3451
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
  3452
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3453
       '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
  3454
        cmdOut remove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3455
        tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3456
        ^ false.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3457
    ].
605
db13f9acfdc3 oops - temporary file was not removed in createContainer
Claus Gittinger <cg@exept.de>
parents: 604
diff changeset
  3458
    cmdOut remove.
461
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3459
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3460
    "/
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3461
    "/ 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
  3462
    "/
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3463
    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
  3464
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3465
    tempdir recursiveRemove.
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3466
    ^ true
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3467
818
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
     CVSSourceCodeManager removeContainerInModule:'stx' package:'private' container:'WorldPO.st'
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3470
    "
47f8d0b4b035 extra entry to remove a container (without existsing class)
tm
parents: 814
diff changeset
  3471
655
94cba977cb39 Fixes for CVS V1.9.16 (prints revision info to stdout instead stderr)
Stefan Vogel <sv@exept.de>
parents: 641
diff changeset
  3472
    "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
  3473
    "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
  3474
!
4c4d42662239 added interface to remove a container & to read a containers
Claus Gittinger <cg@exept.de>
parents: 449
diff changeset
  3475
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3476
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
  3477
    "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
  3478
     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
  3479
     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
  3480
     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
  3481
     (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
  3482
     of those repositories.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3483
     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
  3484
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3485
    |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
  3486
     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
  3487
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3488
    CVSRoot isNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3489
        '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
  3490
        ^ nil
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3491
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3492
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3493
    CVSModuleRoots notNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3494
        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
  3495
    ] ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3496
        roots := Set new.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3497
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3498
    roots add:CVSRoot.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3499
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3500
    "/ 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
  3501
    "/ 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
  3502
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3503
    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
  3504
    tempDir isNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3505
        ('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
  3506
        ^ nil.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3507
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3508
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3509
    roots do:[:aCVSRoot |
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3510
        |root host cmd|
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3511
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3512
        cmd := 'cvs -d ' , aCVSRoot.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3513
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3514
        "/ workaround a CVS bug ...
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3515
        "/ cvs crashes with:
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3516
        "/   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
  3517
        "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3518
        "/ 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
  3519
        "/   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
  3520
        "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3521
        (aCVSRoot startsWith:':') ifFalse:[
905
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3522
            OperatingSystem isUNIXlike ifTrue:[
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3523
                host := aCVSRoot copyTo:(aCVSRoot indexOf:$:)-1.
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3524
                (host size > 0 and:[(host includes:Character space) not]) ifTrue:[
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3525
                    root := aCVSRoot copyFrom:(aCVSRoot indexOf:$:)+1.
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3526
                    cmd := 'rsh ' , host , ' cvs -d ' , root    
6be589cd95a4 cvs history under MSWindows
Claus Gittinger <cg@exept.de>
parents: 904
diff changeset
  3527
                ]
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3528
            ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3529
        ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3530
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3531
        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
  3532
        (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
  3533
            cmd := cmd , ' -D "' , timeGoal , '"'.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3534
        ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3535
        filterRep notNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3536
            filterRep do:[:aRepository |
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3537
                cmd := cmd , ' -p "' , aRepository , '"'.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3538
            ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3539
        ].
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3540
"/ 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
  3541
"/ 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
  3542
"/
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3543
"/        filterModules notNil ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3544
"/            filterModules do:[:aModule |
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3545
"/                cmd := cmd , ' -m "' , aModule , '"'.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3546
"/            ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3547
"/        ].
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3548
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3549
        Transcript showCR:cmd.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3550
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3551
        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
  3552
        inStream isNil ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3553
            ('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
  3554
        ] ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3555
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3556
            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
  3557
                ('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
  3558
                ex return.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3559
            ] do:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3560
                "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3561
                "/ 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
  3562
                "/
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3563
                endReached := false.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3564
                [endReached] whileFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3565
                    inStream readWait.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3566
                    line := inStream nextLine.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3567
                    (endReached := line isNil) ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3568
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3569
                        "/ 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
  3570
                        "/ [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
  3571
                        words := line asCollectionOfWords.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3572
                        words size >= 8 ifFalse:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3573
                            "/ 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
  3574
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3575
                        ] ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3576
                            recordType := words at:1.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3577
                            fileName := words at:7.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3578
                            user := words at:5.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3579
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3580
                            (filter not 
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3581
                            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
  3582
                                (userFilter isNil
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3583
                                or:[userFilter = user]) ifTrue:[
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3584
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3585
                                    date := words at:2.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3586
                                    time := words at:3.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3587
                                    rev := words at:6.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3588
                                    pkgDir := words at:8.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3589
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3590
                                    module := pkgDir copy.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3591
                                    (module startsWith:'./') ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3592
                                        module := module copyFrom:3.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3593
                                    ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3594
                                    idx := module indexOf:$/.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3595
                                    idx ~~ 0 ifTrue:[    
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3596
                                        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
  3597
                                    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3598
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3599
                                    (filterModules isNil 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3600
                                    or:[filterModules includes:module]) ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3601
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3602
                                        recordType = 'M' ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3603
                                            recordType := ' '
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3604
                                        ] ifFalse:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3605
                                            recordType = 'A' ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3606
                                                recordType := '+'
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3607
                                            ] ifFalse:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3608
                                                (recordType = 'R' or:[recordType = 'W']) ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3609
                                                    recordType := '-'
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3610
                                                ]
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3611
                                            ]
856
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3612
                                        ].
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3613
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3614
                                        info := Dictionary new.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3615
                                        info at:#cvsRecordType       put:recordType.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3616
                                        info at:#date                put:date.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3617
                                        info at:#time                put:time.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3618
                                        info at:#user                put:user.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3619
                                        info at:#fileName            put:fileName.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3620
                                        info at:#revision            put:rev.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3621
                                        info at:#directory           put:pkgDir.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3622
                                        info at:#className           put:(Smalltalk classNameForFile:fileName).
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3623
                                    
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3624
                                        "/
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3625
                                        "/ for your convenience:
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3626
                                        "/  check what the actual version is in the image
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3627
                                        "/
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3628
                                        clsName := Smalltalk classNameForFile:fileName.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3629
                                        clsName notNil ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3630
                                            cls := Smalltalk classNamed:clsName.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3631
                                            (cls notNil and:[(clsRev := cls revision) notNil]) ifTrue:[
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3632
                                                info at:#classesRevision     put:clsRev.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3633
                                            ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3634
                                        ].
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3635
                                        aBlock value:info
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3636
                                    ]
856
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
                            ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3639
                        ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3640
                    ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3641
                ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3642
            ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3643
            inStream close.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3644
        ]
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3645
    ].
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3646
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3647
    tempDir recursiveRemove.
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3648
1037
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3649
    "Created: / 17.1.2001 / 13:11:20 / cg"
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3650
    "Modified: / 17.1.2001 / 13:41:22 / cg"
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3651
!
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3652
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3653
reportHistoryLogSince:timeGoal filterSTSources:filter filterUser:userFilter filterRepository:filterRep inTo:aBlock
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3654
    "process a full historyLog, evaluate aBlock for each entry, passing 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3655
     the logs info in a dictionary.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3656
     This walks over all possible repositories.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3657
     filterRep may be a collection of repository names 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3658
     (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
  3659
     of those repositories.
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3660
     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
  3661
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3662
    ^self
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3663
        reportHistoryLogSince:timeGoal 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3664
        filterSTSources:filter 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3665
        filterUser:userFilter 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3666
        filterRepository:filterRep 
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3667
        filterModules:nil
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3668
        inTo:aBlock
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3669
5c3bcbb11256 module filter in history
Claus Gittinger <cg@exept.de>
parents: 1025
diff changeset
  3670
    "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
  3671
!
795e1b535a9d made cvs-history more useful, by extracting the parsing code
Claus Gittinger <cg@exept.de>
parents: 854
diff changeset
  3672
550
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3673
revisionInfoFromString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3674
    "{ Pragma: +optSpace }"
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3675
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3676
    "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
  3677
     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
  3678
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3679
    ^ self revisionInfoFromRCSString:aString
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3680
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3681
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3682
     self revisionInfoFromString:(Array version)   
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3683
    "
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3684
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3685
    "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
  3686
!
3ddcec87d591 the sourceManager only should extract revision numbers from a revisionString
Claus Gittinger <cg@exept.de>
parents: 549
diff changeset
  3687
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  3688
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
  3689
    "return info about the repository container and
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3690
     (part of) the revisionlog as a collection of revision entries.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3691
     Return nil on failure.
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3692
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3693
     The returned information is a structure (IdentityDictionary)
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3694
     filled with:
1025
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
  3695
            #container          -> the RCS/CVS container file name 
038e9825811f fixes for multiple CVSRoots
Claus Gittinger <cg@exept.de>
parents: 1023
diff changeset
  3696
            #cvsRoot            -> the CVS root (repository) 
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3697
            #filename           -> the actual source file name
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3698
            #newestRevision     -> the revisionString of the newest revision
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
  3699
            #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
  3700
            #revisions          -> collection of per-revision info (see below)
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3701
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3702
            rev1 / rev2 specify from which revisions a logEntry is wanted:
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3703
             -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
  3704
              otherwise, the log starts with that revision.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3705
             -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
  3706
              otherwise, the log ends with that revision.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3707
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3708
             -If both are nil, all logEntries are extracted.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3709
             -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
  3710
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3711
            per revision info consists of one record per revision:
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3712
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3713
              #revision              -> the revision string
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3714
              #author                -> who checked that revision into the repository
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3715
              #date                  -> when was it checked in
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3716
              #state                 -> the RCS state
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3717
              #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
  3718
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3719
            revisions are ordered newest first 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3720
            (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
  3721
        "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3722
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3723
    |tempDir cmd fullName modulePath inStream inHeaderInfo atEnd line revArg revLine1 revLine2 idx
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3724
     info record revisionRecords s headerOnly msg cvsRoot|
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3725
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3726
    cvsRoot := self getCVSROOTForModule:moduleDir.
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3727
    cvsRoot isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3728
        'CVSSourceCodeManager [info]: CVSROOT not set' infoPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3729
        ^ nil
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3730
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3731
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3732
    modulePath :=  moduleDir , '/' , packageDir. 
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3733
    fullName :=  modulePath , '/' , classFileName.
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3734
    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
  3735
    tempDir isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3736
        ('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
  3737
        ^ nil.
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3738
    ].
855597464034 graceful handling of errors while creating the tempDir.
Claus Gittinger <cg@exept.de>
parents: 605
diff changeset
  3739
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3740
    [
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3741
        self createEntryFor:fullName 
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3742
             module:moduleDir
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3743
             in:(tempDir construct:modulePath) 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3744
             revision:'1.1' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3745
             date:'dummy' 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3746
             special:''
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3747
             overwrite:false.
160
dacfc2454cc8 prints replaced by infoPrint
Claus Gittinger <cg@exept.de>
parents: 159
diff changeset
  3748
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3749
        revArg := ''.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3750
        headerOnly := false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3751
        (rev1 notNil or:[rev2 notNil]) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3752
            (rev1 == 0 and:[rev2 == 0]) ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3753
                revArg := '-h'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3754
                headerOnly := true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3755
            ] ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3756
                revArg := '-r'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3757
                rev1 notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3758
                    revArg := revArg , rev1
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3759
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3760
                revArg := revArg , ':'.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3761
                rev2 notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3762
                    revArg := revArg , rev2
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3763
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3764
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3765
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3766
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3767
        headerOnly ifTrue:[
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3768
            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
  3769
        ] ifFalse:[
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3770
            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
  3771
        ].
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  3772
        clsOrNil isNil ifTrue:[
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3773
            msg := msg , 'in ' , fullName.
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3774
        ] ifFalse:[
922
24cfcd3043a2 file based operations added (to check in extensions etc.)
Claus Gittinger <cg@exept.de>
parents: 905
diff changeset
  3775
            msg := msg , 'of ', clsOrNil name.
533
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3776
        ].
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3777
        self activityNotification:msg.
53a982919a5e faster #newestRevisionOf.
Claus Gittinger <cg@exept.de>
parents: 529
diff changeset
  3778
669
f6606693a1be care for CVSBinDir when reading revisionLog
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3779
        CVSBinDir asFilename isAbsolute ifTrue:[
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  3780
            cmd := CVSBinDir , 'cvs -d ', cvsRoot, ' log ' , revArg , ' ' , fullName.
669
f6606693a1be care for CVSBinDir when reading revisionLog
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3781
        ] ifFalse:[
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  3782
            cmd := 'cvs -d ', cvsRoot, ' log ' , revArg , ' ' , fullName.
669
f6606693a1be care for CVSBinDir when reading revisionLog
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3783
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3784
    "/ cmd printNL.
710
aa590bc6895e fixes for WIN32 (checkin & revLog)
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
  3785
        inStream := PipeStream readingFrom:cmd inDirectory:tempDir name.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3786
        inStream isNil ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3787
            ('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
  3788
            ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3789
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3790
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3791
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3792
        "/ read the commands pipe output and extract the container info
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3793
        "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3794
        info := IdentityDictionary new.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3795
        inHeaderInfo := true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3796
        [inHeaderInfo and:[inStream atEnd not]] whileTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3797
            line:= inStream nextLine.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3798
            line notNil ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3799
                |gotIt|
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
                gotIt := false.
616
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3802
                #('RCS file:'        #container
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3803
                  'Working file:'    #filename
c8ba3d8df1ab support for per-module CVSROOT; allows customers to have
Claus Gittinger <cg@exept.de>
parents: 614
diff changeset
  3804
                  'head:'            #newestRevision
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3805
                  'total revisions:' #numberOfRevisions
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3806
                 ) pairWiseDo:[:word :key |
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3807
                    gotIt ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3808
                        s := line restAfter:word withoutSeparators:true.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3809
                        s notNil ifTrue:[info at:key put:s. gotIt := true].                        
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3810
                    ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3811
                ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3812
                gotIt ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3813
                    (line startsWith:'description:') ifTrue:[inHeaderInfo := false].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3814
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3815
            ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3816
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3817
        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
  3818
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3819
        info isEmpty ifTrue:[
681
d3095689e2f5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  3820
            ('CVSSourceCodeManager [warning]: no log for ', fullName) errorPrintCR.
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3821
            ^ nil
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3822
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3823
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3824
        "/ strip selected revisions from the total-revisions entry
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3825
        s := info at:#numberOfRevisions.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3826
        (idx := s indexOf:$;) ~~ 0 ifTrue:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3827
            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
  3828
        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3829
            info at:#numberOfRevisions put:(Integer readFrom:s onError:[1])
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3830
        ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3831
        headerOnly ifFalse:[
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3832
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3833
            "/ continue to read the commands pipe output 
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3834
            "/ and extract revision info records
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3835
            "/
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3836
            revisionRecords := OrderedCollection new:(info at:#numberOfRevisions).
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3837
            info at:#revisions put:revisionRecords.
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3838
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3839
            atEnd := false.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3840
            [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
  3841
                record := self readRevisionLogEntryFromStream:inStream.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3842
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3843
"/                revLine1 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3844
"/                [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
  3845
"/                    whileTrue:[inStream atEnd ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3846
"/                                revLine1 := nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3847
"/                               ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3848
"/                                revLine1 := inStream nextLine.]].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3849
"/                revLine2 := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3850
"/                (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
  3851
"/                    record := IdentityDictionary new.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3852
"/                    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
  3853
"/                    "/ 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
  3854
"/                    (revLine2 asCollectionOfSubstringsSeparatedBy:$;) do:[:info |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3855
"/                        |subEntry|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3856
"/                        subEntry := info withoutSeparators.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3857
"/                        #('date:'   #date
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3858
"/                          'author:' #author 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3859
"/                          'state:'  #state 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3860
"/                          'lines:'  #numberOfChangedLines
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3861
"/                         ) pairWiseDo:[:word :key |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3862
"/                            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
  3863
"/                            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
  3864
"/                        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3865
"/                    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3866
"/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3867
"/                    "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
  3868
"/                    (record includesKey:#numberOfChangedLines) ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3869
"/                        record at:#numberOfChangedLines put:''
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3870
"/                    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3871
"/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3872
"/                    s := nil.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3873
"/                    line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3874
"/                    [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
  3875
"/                        (line startsWith:'==========') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3876
"/                            atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3877
"/                        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3878
"/                            (line withoutSpaces = '.') ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3879
"/                                line := '*** empty log message ***'
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3880
"/                            ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3881
"/                            s isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3882
"/                                s := line
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3883
"/                            ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3884
"/                                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
  3885
"/                            ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3886
"/                            line := inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3887
"/                        ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3888
"/                    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3889
"/                    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
  3890
"/                    revisionRecords add:record.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3891
"/                ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3892
                record isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3893
                    atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3894
                ] ifFalse:[
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3895
                    revisionRecords add:record.
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3896
                ]
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3897
            ].
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3898
        ].
165
375583357309 checkout, checkin and log works with server version
Stefan Vogel <sv@exept.de>
parents: 163
diff changeset
  3899
    ] valueNowOrOnUnwindDo:[
529
3fcaac638b26 always close the log-stream
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  3900
        inStream notNil ifTrue:[inStream close].
179
0df4c85ebd1f fixes for new classes
Claus Gittinger <cg@exept.de>
parents: 176
diff changeset
  3901
        tempDir recursiveRemove
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3902
    ].
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3903
    ^ info
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3904
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3905
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3906
     SourceCodeManager revisionLogOf:Array 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3907
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:'1.43' 
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3908
     SourceCodeManager revisionLogOf:Array fromRevision:'1.40' toRevision:nil  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3909
     SourceCodeManager revisionLogOf:Array fromRevision:nil toRevision:'1.3'  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3910
     SourceCodeManager revisionLogOf:Array fromRevision:nil toRevision:nil  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3911
     SourceCodeManager revisionLogOf:Array fromRevision:0 toRevision:0  
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3912
    "
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  3913
669
f6606693a1be care for CVSBinDir when reading revisionLog
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3914
    "Created: / 16.11.1995 / 13:25:30 / cg"
f6606693a1be care for CVSBinDir when reading revisionLog
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
  3915
    "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
  3916
    "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
  3917
!
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3918
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3919
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
  3920
    "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
  3921
     (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
  3922
     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
  3923
     Return nil on failure.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3924
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3925
     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
  3926
     filled with:
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3927
            #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
  3928
            #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
  3929
            #newestRevision     -> the revisionString of the newest revision
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
  3930
            #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
  3931
            #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
  3932
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3933
            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
  3934
             -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
  3935
              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
  3936
             -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
  3937
              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
  3938
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3939
             -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
  3940
             -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
  3941
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3942
            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
  3943
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3944
              #revision              -> the revision string
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3945
              #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
  3946
              #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
  3947
              #state                 -> the RCS state
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3948
              #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
  3949
              #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
  3950
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3951
            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
  3952
            (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
  3953
        "
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3954
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3955
    |tempDir cmd fullName modulePath inStream inHeaderInfo atEnd line revArg revLine1 revLine2 idx
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3956
     info record revisionRecords s msg cvsRoot|
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
    cvsRoot := self getCVSROOTForModule:moduleDir.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3959
    cvsRoot isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3960
        'CVSSourceCodeManager [info]: CVSROOT not set' infoPrintCR.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3961
        ^ nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3962
    ].
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
    modulePath :=  moduleDir , '/' , packageDir. 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3965
    fullName :=  modulePath , '/' , classFileName.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3966
    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
  3967
    tempDir isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3968
        ('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
  3969
        ^ nil.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3970
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3971
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3972
    [
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3973
        self createEntryFor:fullName 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3974
             module:moduleDir
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3975
             in:(tempDir construct:modulePath) 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3976
             revision:'1.1' 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3977
             date:'dummy' 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3978
             special:''
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3979
             overwrite:false.
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
        revArg := ''.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3982
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3983
        msg := 'reading revision log '.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3984
        clsOrNil isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3985
            msg := msg , 'in ' , fullName.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3986
        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3987
            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
  3988
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3989
        self activityNotification:msg.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3990
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3991
        CVSBinDir asFilename isAbsolute ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3992
            cmd := CVSBinDir , 'cvs -d ', cvsRoot, ' log ' , revArg , ' ' , fullName.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3993
        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3994
            cmd := 'cvs -d ', cvsRoot, ' log ' , revArg , ' ' , fullName.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3995
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3996
    "/ cmd printNL.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3997
        inStream := PipeStream readingFrom:cmd inDirectory:tempDir name.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3998
        inStream isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  3999
            ('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
  4000
            ^ nil
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4001
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4002
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4003
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4004
        "/ 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
  4005
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4006
        info := IdentityDictionary new.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4007
        inHeaderInfo := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4008
        [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
  4009
            line:= inStream nextLine.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4010
            line notNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4011
                |gotIt|
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4012
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4013
                gotIt := false.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4014
                #('RCS file:'        #container
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4015
                  'Working file:'    #filename
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4016
                  'head:'            #newestRevision
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4017
                  'total revisions:' #numberOfRevisions
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4018
                 ) pairWiseDo:[:word :key |
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4019
                    gotIt ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4020
                        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
  4021
                        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
  4022
                    ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4023
                ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4024
                gotIt ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4025
                    (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
  4026
                ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4027
            ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4028
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4029
        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
  4030
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4031
        info isEmpty ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4032
            ('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
  4033
            ^ nil
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
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4036
        "/ 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
  4037
        s := info at:#numberOfRevisions.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4038
        (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
  4039
            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
  4040
        ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4041
            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
  4042
        ].
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
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4045
        "/ 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
  4046
        "/ 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
  4047
        "/
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4048
        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
  4049
        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
  4050
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4051
        atEnd := false.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4052
        [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
  4053
            record := self readRevisionLogEntryFromStream:inStream.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4054
            record isNil ifTrue:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4055
                atEnd := true.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4056
            ] ifFalse:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4057
                revisionRecords add:record.
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4058
            ].
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
  4059
            (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
  4060
                atEnd := true
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4061
            ]
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4062
        ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4063
    ] valueNowOrOnUnwindDo:[
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4064
        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
  4065
        tempDir recursiveRemove
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4066
    ].
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4067
    ^ info
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4068
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
     SourceCodeManager revisionLogOf:Array 
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4071
     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
  4072
f5a8e98c8730 added entry to read the last N newest revision-log.
Claus Gittinger <cg@exept.de>
parents: 929
diff changeset
  4073
    "
1005
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4074
!
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4075
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4076
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
  4077
    "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
  4078
     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
  4079
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4080
     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
  4081
     filled with:
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4082
            #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
  4083
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4084
     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
  4085
     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
  4086
        "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4087
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4088
    |tempDir cmd fullName modulePath inStream inHeaderInfo atEnd line revLine1 revLine2 idx
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4089
     info record revisionRecords s headerOnly msg cvsRoot|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4090
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4091
    cvsRoot := self getCVSROOTForModule:moduleDir.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4092
    cvsRoot isNil ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4093
        'CVSSourceCodeManager [info]: CVSROOT not set' infoPrintCR.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4094
        ^ nil
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4095
    ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4096
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4097
    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
  4098
    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
  4099
    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
  4100
    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
  4101
        ('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
  4102
        ^ nil.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4103
    ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4104
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4105
    [
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4106
        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
  4107
             module:moduleDir
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4108
             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
  4109
             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
  4110
             date:'dummy' 
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4111
             special:''
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4112
             overwrite:false.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4113
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4114
        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
  4115
        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
  4116
            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
  4117
        ] ifFalse:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4118
            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
  4119
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4120
        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
  4121
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4122
        CVSBinDir asFilename isAbsolute ifTrue:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4123
            cmd := CVSBinDir , 'cvs -d ', cvsRoot, ' status ' , fullName.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4124
        ] ifFalse:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4125
            cmd := 'cvs -d ', cvsRoot, ' status ' , fullName.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4126
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4127
"/ cmd printNL.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4128
        inStream := PipeStream readingFrom:cmd inDirectory:tempDir name.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4129
        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
  4130
            ('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
  4131
            ^ nil
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4132
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4133
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4134
        "/
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4135
        "/ 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
  4136
        "/
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4137
        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
  4138
        [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
  4139
            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
  4140
            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
  4141
                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
  4142
            ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4143
            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
  4144
                |gotIt i|
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4145
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4146
                gotIt := false.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4147
                #(
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4148
                  '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
  4149
                 ) 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
  4150
                    gotIt ifFalse:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4151
                        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
  4152
                        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
  4153
                            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
  4154
                            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
  4155
                                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
  4156
                            ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4157
                            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
  4158
                            gotIt := true.
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4159
                        ].                        
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4160
                    ]
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
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4164
        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
  4165
            ('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
  4166
            ^ nil
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4167
        ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4168
    ] valueNowOrOnUnwindDo:[
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4169
        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
  4170
        tempDir recursiveRemove
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4171
    ].
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4172
    ^ info
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
    "
5f595dc604e0 use 'cvs status' to get newest revision (used to be 'cvs log')
Claus Gittinger <cg@exept.de>
parents: 1003
diff changeset
  4175
     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
  4176
     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
  4177
     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
  4178
     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
  4179
    "
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4180
! !
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4181
502
dea42b71f832 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 501
diff changeset
  4182
!CVSSourceCodeManager class methodsFor:'documentation'!
89
a6730f6832b6 log bug fix (synchronize on first revision line)
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  4183
a6730f6832b6 log bug fix (synchronize on first revision line)
Claus Gittinger <cg@exept.de>
parents: 87
diff changeset
  4184
version
1069
860c5e37c282 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1067
diff changeset
  4185
    ^ '$Header: /cvs/stx/stx/libbasic3/CVSSourceCodeManager.st,v 1.235 2001-09-07 14:35:56 cg Exp $'
117
882343f83624 minor bug
Claus Gittinger <cg@exept.de>
parents: 116
diff changeset
  4186
! !
130
4abc831b165f oops - invalid ccheckin
Claus Gittinger <cg@exept.de>
parents: 129
diff changeset
  4187
CVSSourceCodeManager initialize!