author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 01 Feb 2013 12:02:22 +0000 | |
changeset 210 | 54a73fa50d40 |
parent 158 | 591092ed5641 |
child 248 | b1a6ab0c86a1 |
permissions | -rw-r--r-- |
210 | 1 |
" |
2 |
COPYRIGHT (c) 2012-2013 by Jan Vrany |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
12 |
"{ Package: 'stx:libscm/mercurial' }" |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
13 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
14 |
SCMAbstractCommitTask subclass:#HGCommitTask |
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
15 |
instanceVariableNames:'author remote branch' |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
16 |
classVariableNames:'' |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
17 |
poolDictionaries:'' |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
18 |
category:'SCM-Mercurial-StX-Tasks' |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
19 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
20 |
|
210 | 21 |
!HGCommitTask class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2012-2013 by Jan Vrany |
|
26 |
All Rights Reserved |
|
27 |
||
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! ! |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
36 |
|
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
37 |
!HGCommitTask methodsFor:'accessing'! |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
38 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
39 |
author |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
40 |
^author isNil ifTrue:[ |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
41 |
| a | |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
42 |
a := HGAuthorQuery query. |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
43 |
a isNil ifTrue:[ |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
44 |
a := package repository config get:#(ui username) default: nil |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
45 |
]. |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
46 |
a |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
47 |
] ifFalse:[ |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
48 |
author |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
49 |
] |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
50 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
51 |
"Modified: / 07-12-2012 / 16:17:02 / jv" |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
52 |
! |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
53 |
|
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
54 |
author:aString |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
55 |
author := aString. |
151
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
56 |
! |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
57 |
|
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
58 |
branch |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
59 |
^ branch |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
60 |
! |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
61 |
|
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
62 |
branch:aString |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
63 |
branch := aString. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
64 |
! |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
65 |
|
151
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
66 |
remote |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
67 |
^ remote |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
68 |
! |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
69 |
|
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
70 |
remote:something |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
71 |
remote := something. |
146
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
72 |
! ! |
1015b8f6dc1c
Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
118
diff
changeset
|
73 |
|
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
74 |
!HGCommitTask methodsFor:'executing'! |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
75 |
|
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
76 |
doCommit: msg files: containers |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
77 |
"Actually commit the changes, To be overridden by subclasses" |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
78 |
|
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
79 |
self synchronized:[ |
153
442c60f78aec
Bugfix HGCommitTask>>doCommit:files: - allow commit into same branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
80 |
| wc createBranch | |
151
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
81 |
|
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
82 |
wc := self package temporaryWorkingCopy. |
153
442c60f78aec
Bugfix HGCommitTask>>doCommit:files: - allow commit into same branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
83 |
createBranch := branch notNil and:[branch ~= wc branch name]. |
442c60f78aec
Bugfix HGCommitTask>>doCommit:files: - allow commit into same branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
84 |
|
442c60f78aec
Bugfix HGCommitTask>>doCommit:files: - allow commit into same branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
85 |
createBranch ifTrue:[ |
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
86 |
(self package repository branches contains:[:b|b name = branch]) ifTrue:[ |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
87 |
HGCommitError raiseErrorString: 'Commiting to an existing branch is not allowed'. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
88 |
^self. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
89 |
]. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
90 |
wc branch: branch. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
91 |
]. |
151
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
92 |
wc commit: msg files: containers author: self author. |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
93 |
wc repository push: nil force: true. |
527a1e85aef8
Support for 'autopush' in commit dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
146
diff
changeset
|
94 |
remote notNil ifTrue:[ |
158
591092ed5641
Bugfix in HGCommitTask>>doCommit:files: (pass remote name as string)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
156
diff
changeset
|
95 |
self package repository push: remote name force: false. |
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
96 |
]. |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
97 |
"/Also, mark original (package) working copy as given branch |
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
98 |
"/so subsequent 'hg update' will update from that branch |
153
442c60f78aec
Bugfix HGCommitTask>>doCommit:files: - allow commit into same branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
152
diff
changeset
|
99 |
createBranch ifTrue:[ |
156
725d8bc65e48
Bugfix in HGCommit tast (committing into a new branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
100 |
self package repository workingCopy branch: branch. |
152
9068fe7a5795
Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
151
diff
changeset
|
101 |
]. |
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
102 |
]. |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
103 |
|
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
104 |
"Created: / 15-11-2012 / 16:52:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
156
725d8bc65e48
Bugfix in HGCommit tast (committing into a new branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
105 |
"Modified: / 10-12-2012 / 11:19:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
158
591092ed5641
Bugfix in HGCommitTask>>doCommit:files: (pass remote name as string)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
156
diff
changeset
|
106 |
"Modified: / 10-12-2012 / 10:53:14 / jv" |
111
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
107 |
! |
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
108 |
|
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
109 |
doPrepareWorkingCopy2 |
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
110 |
|
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
111 |
self isPackageCommit ifTrue:[ |
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
112 |
self do:[ |
118
5a8b78ad48ae
Refactoring (part 2): Rename SCMAbstractPackageModel>>workingCopy to temporaryWorkingCopy
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
113 |
self package ensureTemporaryWorkingCopyAtRevision:self package revision. |
111
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
114 |
self doFileOut |
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
115 |
] |
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
116 |
]. |
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
117 |
|
6439af30a24b
Fix in temporary working copy update.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
107
diff
changeset
|
118 |
"Created: / 28-11-2012 / 09:42:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
119 |
! ! |
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
120 |
|
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
121 |
!HGCommitTask class methodsFor:'documentation'! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
122 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
123 |
version_HG |
115
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
124 |
|
b1ed2d29054b
version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
111
diff
changeset
|
125 |
^ '$Changeset: <not expanded> $' |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
126 |
! |
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
127 |
|
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
128 |
version_SVN |
61
fd129d0c603e
Fixes in committing
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
54
diff
changeset
|
129 |
^ '§Id:: §' |
54
66045198bfbc
More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff
changeset
|
130 |
! ! |
210 | 131 |