mercurial/HGWorkingCopyFile.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 22 Jan 2013 14:05:05 +0000
changeset 190 a4a4b6f2fc52
parent 180 7b70d26f28da
child 210 54a73fa50d40
permissions -rw-r--r--
Performance optimization in HGWorkingCopyFile. HGWorkingCopyFile>>revisions now returns a list of lazy revisions which are lazy loaded on demand. This helps in cases the requestor only asks for changeset ids or changesets (although a little in this case a change set had to be created).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
     1
"{ Package: 'stx:libscm/mercurial' }"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
     2
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
     3
Object subclass:#HGWorkingCopyFile
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
     4
	instanceVariableNames:'wc children filename revisions'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
     5
	classVariableNames:''
63
77b0d42eebd0 Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 61
diff changeset
     6
	poolDictionaries:''
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
     7
	category:'SCM-Mercurial-Core'
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
     8
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
     9
190
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    10
Object subclass:#LazyRevision
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    11
	instanceVariableNames:'collection index changeset wc path'
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    12
	classVariableNames:''
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    13
	poolDictionaries:''
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    14
	privateIn:HGWorkingCopyFile
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    15
!
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    16
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    17
!HGWorkingCopyFile class methodsFor:'documentation'!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    18
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    19
documentation
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    20
"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    21
    A representation on a file in working copy. It behaves just like 
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    22
    ordinary filename but also provides methods for quering it's
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    23
    state (added/removed/modified...), access to previous versions
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    24
    and so on.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    25
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    26
    [author:]
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    27
        Jan Vrany <jan.vrany@fit.cvut.cz>
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    28
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    29
    [instance variables:]
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    30
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    31
    [class variables:]
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    32
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    33
    [see also:]
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    34
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    35
"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
    36
! !
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    37
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    38
!HGWorkingCopyFile class methodsFor:'instance creation'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    39
63
77b0d42eebd0 Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 61
diff changeset
    40
wc: aHGWorkingCopy path: aStringOrFilename
77b0d42eebd0 Removed last bits of Git, hopefully
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 61
diff changeset
    41
    ^self new setWorkingCopy: aHGWorkingCopy path: aStringOrFilename
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    42
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    43
    "Created: / 24-09-2012 / 13:52:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    44
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    45
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    46
!HGWorkingCopyFile methodsFor:'accessing'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    47
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    48
changeset
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    49
    ^wc changeset
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    50
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    51
    "Created: / 05-12-2012 / 19:23:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    52
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    53
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    54
pathName
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    55
    ^filename pathName
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    56
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    57
    "Created: / 12-11-2012 / 22:43:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    58
!
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    59
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    60
pathNameRelative
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    61
    ^self == wc root
67
985488894699 HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    62
        ifTrue:['']
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    63
        ifFalse:[filename pathName copyFrom: (wc root pathName size + 2)]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    64
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    65
    "Created: / 25-09-2012 / 00:28:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
67
985488894699 HGCommitDialog: nicer icons, fix for file list
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 63
diff changeset
    66
    "Modified: / 16-11-2012 / 11:23:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    67
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    68
142
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    69
pathNameRelativeSlashed
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    70
    | p |
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    71
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    72
    p := self pathNameRelative.
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    73
    (p includes:$\) ifTrue:[
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    74
        p := p copyReplaceAll:$\ with:$/.
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    75
    ].
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    76
    ^p
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    77
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    78
    "Created: / 06-12-2012 / 17:11:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    79
!
67e8c5ab8db2 Initial support for config parsing (not yet integrated). UI improvements in commit dialog (comparing).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 140
diff changeset
    80
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    81
revisions
140
feab684bc4dc Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    82
    | path pathS |
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    83
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    84
    path := self pathNameRelative.
140
feab684bc4dc Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    85
    pathS := OperatingSystem isMSWINDOWSlike 
feab684bc4dc Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    86
                ifTrue:[path copyReplaceAll:$\ with: $/]
feab684bc4dc Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    87
                ifFalse:[path].
feab684bc4dc Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
    88
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    89
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    90
    revisions isNil ifTrue:[
190
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    91
        | old oldIds |
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    92
        oldIds := HGCommand log
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    93
                        workingDirectory: wc pathName;
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    94
                        path: path;
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
    95
                        execute.
190
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    96
        pathS.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    97
        old := OrderedCollection new.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    98
        oldIds withIndexDo: [:id :index|
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
    99
            old add: (
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   100
                LazyRevision new
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   101
                    setCollection: old index: index changesetId: id workingCopy: wc path: pathS)
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   102
"/            | cs f |
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   103
"/
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   104
"/            f := (cs := wc repository changesetWithId: id) / p.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   105
"/
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   106
"/            cs changes do:[:chg|
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   107
"/                "/Catch renames...
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   108
"/                (chg isCopied and:[chg path = p]) ifTrue:[
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   109
"/                    p := chg source.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   110
"/                ]
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   111
"/            ].
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   112
"/            f.
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
   113
        ].
138
c66a831e131b Make HGWorkingCopy>>revisions dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   114
c66a831e131b Make HGWorkingCopy>>revisions dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   115
        revisions := old.
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
   116
    ].
190
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   117
    "/older revisions are cached, newer not since they may change...
138
c66a831e131b Make HGWorkingCopy>>revisions dynamic.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   118
140
feab684bc4dc Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
   119
    ^((wc changeset / pathS) newer:true) , revisions
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
   120
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
   121
    "Created: / 05-12-2012 / 19:09:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
140
feab684bc4dc Bugfix in HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 138
diff changeset
   122
    "Modified: / 06-12-2012 / 03:50:58 / jv"
190
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   123
    "Modified: / 22-01-2013 / 13:52:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
   124
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 121
diff changeset
   125
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   126
status
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
   127
    | cmd statuses  |
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   128
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   129
    cmd := HGCommand status.
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
   130
    cmd workingDirectory: filename directory.
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   131
    cmd path: filename pathName.
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
   132
    statuses := cmd execute.
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
   133
    self assert: statuses size == 1.
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
   134
    self assert: statuses first second = filename baseName.
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
   135
    ^statuses first first.
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   136
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   137
    "Created: / 24-09-2012 / 22:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
   138
    "Modified: / 09-11-2012 / 12:09:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   139
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   140
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   141
!HGWorkingCopyFile methodsFor:'delegating'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   142
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   143
doesNotUnderstand: aMessage
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   144
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   145
    ^(filename respondsTo: aMessage selector) ifTrue:[
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   146
        aMessage sendTo: filename
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   147
    ] ifFalse:[
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   148
        super doesNotUnderstand: aMessage
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   149
    ].
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   150
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   151
    "Created: / 24-09-2012 / 13:46:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   152
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   153
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   154
!HGWorkingCopyFile methodsFor:'enumerating-contents'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   155
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   156
directoryContentsAsFilenamesDo:aBlock
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   157
    "evaluate aBlock for each file in the directory represented by the receiver.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   158
     The block is invoked with a filename-argument.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   159
     The enumerations order is undefined - i.e. usually NOT sorted by
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   160
     filenames (but by creation time - on some systems).
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   161
     This excludes entries for '.' or '..'.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   162
     NoOp for non-existing directories; however, this behavior
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   163
     may be changed in the near future, to raise an exception instead.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   164
     So users of this method better test for existing directory before.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   165
     Notice: this enumerates fileName objects; see also
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   166
     #directoryContentsDo:, which enumerates strings."
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   167
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   168
    self directoryContentsDo:[:entry |
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   169
        aBlock value:(self construct:entry).
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   170
    ]
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   171
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   172
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   173
     '.' asFilename directoryContentsAsFilenamesDo:[:fn | Transcript showCR:fn pathName].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   174
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   175
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   176
    "Modified: / 18.9.1997 / 18:42:23 / stefan"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   177
    "Modified: / 23.12.1999 / 20:56:35 / cg"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   178
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   179
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   180
!HGWorkingCopyFile methodsFor:'initialization'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   181
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   182
setWorkingCopy: aHGWorkingCopy path: aStringOrFilename
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   183
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   184
    wc := aHGWorkingCopy.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   185
    filename := aStringOrFilename asFilename.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   186
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   187
    "Created: / 24-09-2012 / 13:53:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   188
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   189
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   190
!HGWorkingCopyFile methodsFor:'inspecting'!
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   191
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   192
browse
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   193
    "Opens a file browser on the working copy"
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   194
162
108fc9ee061e Added HGWorkingCopyBrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   195
    HGSourceCodeManager workingCopyBrowserClass openOnDirectory: filename
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   196
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   197
    "Created: / 04-02-2012 / 17:14:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
162
108fc9ee061e Added HGWorkingCopyBrowser.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   198
    "Modified: / 14-12-2012 / 15:48:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   199
! !
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   200
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   201
!HGWorkingCopyFile methodsFor:'instance creation'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   202
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   203
/ aString
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   204
    ^self construct: aString
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   205
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   206
    "Created: / 24-09-2012 / 13:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   207
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   208
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   209
construct: aString
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   210
    ^(aString includes: Filename separator) ifTrue:[
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   211
        self components: (aString tokensBasedOn: Filename separator)
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   212
    ] ifFalse:[
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   213
        self component: aString
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   214
    ]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   215
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   216
    "Created: / 24-09-2012 / 13:50:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   217
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   218
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   219
!HGWorkingCopyFile methodsFor:'instance creation-private'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   220
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   221
component: aString
121
f7cac3dae028 Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   222
f7cac3dae028 Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   223
    aString = '.' ifTrue:[ ^ self ].
f7cac3dae028 Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   224
    aString = '..' ifTrue:[ ^ self error:'Not yet supported' ].
f7cac3dae028 Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   225
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   226
    children isNil ifTrue: [ children := Dictionary new ].
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   227
    ^children 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   228
        at: aString 
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   229
        ifAbsentPut:[HGWorkingCopyFile wc: wc path: (filename construct: aString)]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   230
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   231
    "Created: / 24-09-2012 / 23:26:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
121
f7cac3dae028 Basic revision log support in HGSourceCodeManager.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   232
    "Modified: / 01-12-2012 / 02:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   233
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   234
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   235
components: anArray"OfStrings"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   236
    ^anArray inject: self into:[:entry :name | entry component: name ]
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   237
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   238
    "Created: / 24-09-2012 / 23:25:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   239
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   240
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   241
!HGWorkingCopyFile methodsFor:'operations'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   242
180
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   243
markResolved
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   244
    HGCommand resolve
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   245
        workingDirectory: filename directory;
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   246
        mark: true;
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   247
        files: (Array with: filename baseName);
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   248
        execute.
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   249
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   250
    "Created: / 15-01-2013 / 10:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   251
!
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   252
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   253
markUnresolved
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   254
    HGCommand resolve
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   255
        workingDirectory: filename directory;
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   256
        unmark: true;
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   257
        files: (Array with: filename baseName);
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   258
        execute.
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   259
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   260
    "Created: / 15-01-2013 / 10:22:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   261
!
7b70d26f28da More work on merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   262
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   263
moveTo: destination
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   264
    "Make sure that this entry is tracked by Mercurial"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   265
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   266
    self isTracked ifTrue:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   267
        HGCommand mv
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   268
            workingDirectory: filename directory;
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   269
            source: filename pathName;
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   270
            destination: destination pathName;
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   271
            execute.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   272
    ].
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
   273
    filename exists ifTrue:[
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
   274
        filename moveTo: destination pathName
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
   275
    ].
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   276
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   277
    "Created: / 15-11-2012 / 00:23:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
88
1ad71a063a20 Bunch of fixes.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
   278
    "Modified: / 21-11-2012 / 00:48:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   279
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   280
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   281
remove
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   282
    "Make sure that this entry is tracked by Mercurial"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   283
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   284
    self isTracked ifTrue:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   285
        HGCommand remove
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   286
            workingDirectory: filename directory;
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
   287
            paths: { filename baseName };
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   288
            execute
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   289
    ].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   290
    filename remove
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   291
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   292
    "Created: / 15-11-2012 / 00:08:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 67
diff changeset
   293
    "Modified: / 16-11-2012 / 20:09:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   294
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   295
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   296
track
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   297
    "Make sure that this entry is tracked by Mercurial"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   298
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   299
    self isUntracked ifTrue:[
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   300
        HGCommand add
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   301
            workingDirectory: filename directory;
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   302
            paths: { filename baseName };
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   303
            execute.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   304
    ]
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   305
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   306
    "Created: / 15-11-2012 / 00:08:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   307
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   308
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   309
!HGWorkingCopyFile methodsFor:'printing & storing'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   310
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   311
printOn:aStream
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   312
    "append a printed representation if the receiver to the argument, aStream"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   313
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   314
    | path |
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   315
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   316
    aStream nextPut:$[.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   317
    path := filename pathName.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   318
    path := path copyFrom: wc path pathName size + 1.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   319
    aStream nextPutAll: path.
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   320
    aStream nextPut:$].
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   321
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   322
    "Modified: / 17-10-2012 / 13:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   323
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   324
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   325
!HGWorkingCopyFile methodsFor:'reading-directories'!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   326
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   327
directoryContentsAsFilenames
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   328
    "return the contents of the directory as a collection of filenames.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   329
     This excludes any entries for '.' or '..'.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   330
     Returns nil for non-existing directories; however, this behavior
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   331
     may be changed in the near future, to raise an exception instead.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   332
     So users of this method better test for existing directory before.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   333
     Notice: 
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   334
        this returns the file-names as fileName instances; 
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   335
        see also #directoryContents, which returns strings."
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   336
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   337
    |names|
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   338
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   339
    names := filename directoryContents.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   340
    names isNil ifTrue:[^ nil].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   341
    ^ names collect:[:entry | self construct:entry].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   342
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   343
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   344
     '.' asFilename directoryContentsAsFilenames   
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   345
     '/XXXdoesNotExist' asFilename directoryContentsAsFilenames
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   346
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   347
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   348
    "Modified: / 15-11-2012 / 01:13:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   349
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   350
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   351
directoryContentsAsFilenamesMatching: patternOrCollectionOfThose
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   352
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   353
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   354
        Same as directoryContentsAsFilenames, but returns only files
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   355
        that matches given patterns. This uses String>>matches:
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   356
        for pattern matching
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   357
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   358
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   359
    |names|
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   360
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   361
    names := filename directoryContentsMatching: patternOrCollectionOfThose .
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   362
    names isNil ifTrue:[^ nil].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   363
    ^ names asOrderedCollection collect:[:entry | self construct:entry].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   364
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   365
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   366
    '/etc' asFilename
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   367
        directoryContentsAsFilenamesMatching: 'pass*'
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   368
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   369
    '/etc' asFilename
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   370
            directoryContentsAsFilenamesMatching: #('pass*' 'nsswitch.conf')
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   371
    "
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   372
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   373
    "Created: / 03-06-2009 / 09:57:45 / Jan Vrany <vranyj1@fel.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   374
    "Modified: / 15-11-2012 / 01:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   375
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   376
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   377
recursiveDirectoryContentsAsFilenames
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   378
    "return the contents of the directory and all subdirectories
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   379
     as a collection of filenames.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   380
     This excludes any entries for '.' or '..'.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   381
     Returns nil for non-existing directories; however, this behavior
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   382
     may be changed in the near future, to raise an exception instead.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   383
     So users of this method better test for existing directory before.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   384
     Notice: 
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   385
        this returns the file-names as fileName instances; 
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   386
        see also #recursiveDirectoryContents, which returns strings.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   387
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   388
     Warning: this may take a long time to execute."
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   389
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   390
    |names|
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   391
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   392
    names := filename recursiveDirectoryContents.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   393
    names isNil ifTrue:[^ nil].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   394
    ^ names collect:[:entry | self construct:entry].
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   395
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   396
    "Created: / 15-11-2012 / 01:11:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   397
! !
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   398
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   399
!HGWorkingCopyFile methodsFor:'testing'!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   400
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   401
isAdded
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   402
    ^ self status isAdded
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   403
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   404
    "Modified: / 23-10-2012 / 11:13:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   405
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   406
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   407
isClean
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   408
    ^ self status isClean
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   409
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   410
    "Modified: / 23-10-2012 / 11:13:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   411
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   412
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   413
isCleanOrIgnored
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   414
    | s |
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   415
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   416
    s := self status.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   417
    ^s isClean or:[s isIgnored]
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   418
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   419
    "Created: / 15-11-2012 / 01:25:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   420
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   421
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   422
isConflict
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   423
    "Return true, if the file had a conflict during merge or update.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   424
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   425
     Note, that this return true even if the file was later merged
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   426
     and conflicts resolved. To check whether conflicts are resolved or
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   427
     not, use #isResolved or isUnresolved"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   428
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   429
    ^wc mergeState includesKey: self pathNameRelative.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   430
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   431
    "Created: / 14-01-2013 / 16:54:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   432
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   433
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   434
isIgnored
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   435
    ^ self status isIgnored
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   436
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   437
    "Modified: / 23-10-2012 / 11:13:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   438
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   439
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   440
isMissing
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   441
    ^ self status isMissing
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   442
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   443
    "Modified: / 23-10-2012 / 11:12:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   444
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   445
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   446
isModified
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   447
    ^ self status isModified
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   448
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   449
    "Modified: / 23-10-2012 / 11:13:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   450
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   451
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   452
isNotTracked
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   453
    ^ self status isNotTracked
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   454
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   455
    "Modified: / 23-10-2012 / 11:13:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   456
!
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   457
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   458
isRemoved
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   459
    ^ self status isRemoved
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   460
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   461
    "Modified: / 23-10-2012 / 11:13:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   462
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   463
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   464
isResolved
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   465
    "Return true, if the file had a conflict during merge or update
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   466
     and is marked as resolved."
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   467
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   468
    ^(wc mergeState at: self pathNameRelative) == $R
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   469
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   470
    "Created: / 14-01-2013 / 16:56:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   471
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   472
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   473
isTracked
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   474
    | s |
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   475
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   476
    s := self status.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   477
    ^s isNotTracked not and:[s isIgnored not and:[s isRemoved not]]
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   478
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   479
    "Created: / 15-11-2012 / 00:11:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   480
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   481
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   482
isUnresolved
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   483
    "Return true, if the file had a conflict during merge or update
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   484
     and is marked as not yet resolved."
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   485
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   486
    ^(wc mergeState at: self pathNameRelative) == $U
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   487
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   488
    "Created: / 14-01-2013 / 16:56:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   489
!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 165
diff changeset
   490
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   491
isUntracked
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   492
    "An alias for not-tracked"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   493
    ^ self isNotTracked
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   494
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   495
    "Created: / 14-11-2012 / 23:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   496
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   497
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   498
isUntrackedOrIgnored
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   499
    | s |
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   500
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   501
    s := self status.
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   502
    ^s isNotTracked or:[s isIgnored]
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   503
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   504
    "Created: / 15-11-2012 / 01:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   505
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   506
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   507
isUnversioned
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   508
    "An alias for not-tracked"
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   509
    ^ self isNotTracked
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   510
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   511
    "Created: / 14-11-2012 / 23:56:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
36
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   512
! !
41cb88196e69 - HGTests
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 34
diff changeset
   513
190
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   514
!HGWorkingCopyFile::LazyRevision methodsFor:'accessing'!
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   515
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   516
changeset
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   517
    ^changeset isHGChangeset 
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   518
        ifTrue:[changeset]
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   519
        ifFalse:[changeset := wc repository changesetWithId: changeset]
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   520
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   521
    "Created: / 22-01-2013 / 13:38:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   522
!
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   523
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   524
changesetId
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   525
    ^changeset isHGChangesetId
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   526
        ifTrue:[changeset]
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   527
        ifFalse:[changeset id]
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   528
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   529
    "Created: / 22-01-2013 / 13:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   530
! !
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   531
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   532
!HGWorkingCopyFile::LazyRevision methodsFor:'error handling'!
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   533
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   534
doesNotUnderstand: aMessage
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   535
    (HGChangesetFile canUnderstand: aMessage selector) ifFalse:[
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   536
        ^ super doesNotUnderstand: aMessage
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   537
    ].
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   538
    self ensureNotLazy.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   539
    ^aMessage sendTo: (collection at: index).
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   540
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   541
    "Created: / 22-01-2013 / 13:41:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   542
! !
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   543
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   544
!HGWorkingCopyFile::LazyRevision methodsFor:'initialization'!
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   545
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   546
setCollection: coll index: idx changesetId: csId workingCopy: workCopy path: p
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   547
    collection := coll.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   548
    index := idx.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   549
    changeset := csId.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   550
    wc := workCopy.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   551
    path := p.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   552
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   553
    "Created: / 22-01-2013 / 13:32:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   554
!
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   555
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   556
setPath: p
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   557
    path := p.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   558
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   559
    "Created: / 22-01-2013 / 13:48:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   560
! !
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   561
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   562
!HGWorkingCopyFile::LazyRevision methodsFor:'private'!
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   563
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   564
ensureNotLazy
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   565
    | cs file renamed |
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   566
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   567
    index ~~ 1 ifTrue:[
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   568
        (collection at: index - 1) ensureNotLazy.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   569
    ].
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   570
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   571
    cs := self changeset.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   572
    file := cs / path.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   573
    collection at: index put: file.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   574
    index ~~ collection size ifTrue:[
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   575
        cs changes do:[:chg|
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   576
            "/Catch renames...
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   577
            (chg isCopied and:[chg path = path]) ifTrue:[
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   578
                renamed := chg source.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   579
                index + 1 to: collection size do:[:i|
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   580
                    (collection at: i) setPath: renamed.
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   581
                ].
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   582
                ^self
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   583
            ]
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   584
        ].
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   585
    ].
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   586
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   587
    "Created: / 22-01-2013 / 13:48:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   588
! !
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   589
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   590
!HGWorkingCopyFile class methodsFor:'documentation'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   591
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   592
version_HG
115
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 88
diff changeset
   593
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 88
diff changeset
   594
    ^ '$Changeset: <not expanded> $'
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   595
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 39
diff changeset
   596
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   597
version_SVN
61
fd129d0c603e Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
   598
    ^ '§Id::                                                                                                                        §'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
   599
! !
190
a4a4b6f2fc52 Performance optimization in HGWorkingCopyFile.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 180
diff changeset
   600