mercurial/HGTests.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 02 Jul 2013 11:42:11 +0100
changeset 303 aee999e9dc25
parent 302 e078bdcef149
child 335 7e19ab19148b
permissions -rw-r--r--
Bugfixes in push parsing. Updated parser tp handle 'remote: ' prefix when pushing to remote repositories. Skip mercurial_keyring extension's error output complaing on realm quotation (the underlying python library writes to stderr, sigh)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     1
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     2
 COPYRIGHT (c) 2012-2013 by Jan Vrany
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     3
              All Rights Reserved
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     4
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     5
 This software is furnished under a license and may be used
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     6
 only in accordance with the terms of that license and with the
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     8
 be provided or otherwise made available to, or used by, any
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
     9
 other person.  No title to or ownership of the software is
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    10
 hereby transferred.
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    11
"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    12
"{ Package: 'stx:libscm/mercurial' }"
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    13
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    14
HGTestCase subclass:#HGTests
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    15
	instanceVariableNames:''
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    16
	classVariableNames:''
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    17
	poolDictionaries:''
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    18
	category:'SCM-Mercurial-Tests'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    19
!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    20
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    21
!HGTests class methodsFor:'documentation'!
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    22
210
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    23
copyright
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    24
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    25
 COPYRIGHT (c) 2012-2013 by Jan Vrany
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    26
              All Rights Reserved
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    27
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    28
 This software is furnished under a license and may be used
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    29
 only in accordance with the terms of that license and with the
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    31
 be provided or otherwise made available to, or used by, any
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    32
 other person.  No title to or ownership of the software is
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    33
 hereby transferred.
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    34
"
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    35
!
54a73fa50d40 Added copyright notice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 189
diff changeset
    36
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    37
documentation
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    38
"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    39
    Tests for core Mercurial code - no Smalltalk/X specific code.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    40
    Commiting, cloning, walking history and so on...
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    41
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    42
    [author:]
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    43
        Jan Vrany <jan.vrany@fit.cvut.cz>
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    44
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    45
    [instance variables:]
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    46
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    47
    [class variables:]
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    48
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    49
    [see also:]
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    50
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    51
"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    52
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    53
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    54
!HGTests methodsFor:'tests - basic workflow'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    55
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    56
test_basic_01a
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    57
    "Test modification of working copy and commit back"
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
    58
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    59
    | repo  wc  f1_txt  oldcs  currentcs |
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    60
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    61
    repo := self repositoryNamed:'test_repo_01'.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    62
     "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    63
     UserPreferences fileBrowserClass openOn: repo directory.
34
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
    wc := repo workingCopy.
46
d5a192b11a1a - More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 40
diff changeset
    66
    oldcs := wc changeset.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    67
    self assert:oldcs id revno == 4.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    68
     "Modify some file"
38
c3d02ed6a645 - HGWorkingCopyFile
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 36
diff changeset
    69
    f1_txt := wc / 'f1.txt'.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    70
    self assert:f1_txt isModified not.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    71
    f1_txt writingFileDo:[:s | s nextPutAll:'modified from test_01a'. ].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    72
    self assert:f1_txt isModified.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    73
    wc commit:'test_01a commit 1'.
46
d5a192b11a1a - More Smalltalk/X support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 40
diff changeset
    74
    currentcs := wc changeset.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    75
    self assert:f1_txt isModified not.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    76
    self assert:currentcs id revno == 5.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
    77
    self assert:currentcs parent1 = oldcs.
93
2579830f6b61 Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
    78
    self assert:currentcs author = 'test_basic_01a <test_basic_01a@HGTests>'
39
10e693b3e034 - Support for commit
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 38
diff changeset
    79
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    80
    "Created: / 19-09-2012 / 23:06:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
93
2579830f6b61 Tests fixed. Not-yet-supported tests marked as skipped.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
    81
    "Modified: / 22-11-2012 / 11:42:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    82
! !
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
    83
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    84
!HGTests methodsFor:'tests - branches'!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    85
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    86
test_branches_01
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    87
    "
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    88
    Test listing branches
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    89
    "
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    90
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    91
    | repo branches |
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    92
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    93
    repo := self repositoryNamed:'test_repo_02'.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    94
    branches := repo branches.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    95
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    96
    self assert: branches first name = 'default'.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    97
    self assert: branches first isActive.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    98
    self assert: branches first isClosed not.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
    99
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   100
    self assert: branches second name = 'branch1'.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   101
    self assert: branches second isActive not.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   102
    self assert: branches second isClosed not.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   103
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   104
    self assert: branches third name = 'branch2'.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   105
    self assert: branches third isActive.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   106
    self assert: branches third isClosed.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   107
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   108
    "Created: / 27-11-2012 / 19:50:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   109
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   110
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   111
test_branches_02
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   112
    "
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   113
    Test getting current branch (branch of currently checked-out working copy)
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   114
    "
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   115
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   116
    | repo wc branch |
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   117
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   118
    repo := self repositoryNamed:'test_repo_02'.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   119
    wc := repo workingCopy.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   120
    branch := wc branch.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   121
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   122
    self assert: branch name = 'default'.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   123
    self assert: wc changeset branch == branch.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   124
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   125
    "Created: / 27-11-2012 / 20:44:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   126
!
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   127
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   128
test_branches_03
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   129
    "
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   130
    Test listing branches
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   131
    "
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   132
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   133
    | repo branches |
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   134
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   135
    repo := self repositoryNamed:'test_repo_02'.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   136
    branches := repo branches.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   137
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   138
    self assert: branches first heads size == 1.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   139
    self assert: branches first heads anElement id revno == 5.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   140
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   141
    self assert: branches second heads size == 1.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   142
    self assert: branches second heads anElement id revno == 4.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   143
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   144
    "Created: / 27-11-2012 / 21:40:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
152
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   145
!
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   146
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   147
test_branches_04
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   148
    "
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   149
    Change branch & commit. Check whether commited changeset
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   150
    has the branch set.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   151
    "
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   152
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   153
    | repo wc |
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   154
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   155
    repo := self repositoryNamed:'test_repo_01'.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   156
    wc := repo workingCopy.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   157
    self assert: repo branches size == 1.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   158
    wc branch: 'test_branches_04'.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   159
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   160
    "Modify some file"
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   161
    (wc / 'f1.txt') writingFileDo:[:s | s nextPutAll:'modified...' ].
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   162
    wc commit:'test_branches_04 1'.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   163
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   164
    self assert: wc changeset branches size == 1.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   165
    self assert: wc changeset branches anElement name = 'test_branches_04'.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   166
    self assert: repo branches size == 2.
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   167
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   168
    "Created: / 10-12-2012 / 03:10:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   169
!
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   170
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   171
test_branches_05
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   172
    "
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   173
    Freshly created repository should have 'default' branch
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   174
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   175
    "
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   176
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   177
    | repo branches |
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   178
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   179
    repo := self repositoryNamed:'test_repo_empty' unpack: false.
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   180
    branches := repo branches.
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   181
    self assert: branches size == 1.
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   182
    self assert: branches anElement name = 'default'
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   183
89e868803035 Bufix: empty repository should have one branch named 'default'.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 152
diff changeset
   184
    "Created: / 14-01-2013 / 14:08:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   185
! !
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   186
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   187
!HGTests methodsFor:'tests - changesets'!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   188
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   189
test_changeset_01
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   190
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   191
    Test accessing changesets
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   192
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   193
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   194
    | repo cs |
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   195
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   196
    repo := self repositoryNamed:'test_repo_01'.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   197
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   198
    cs := repo @ 4.
116
b690f5845323 Class revision ID refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   199
    self assert: cs id printString = '4:6f88e1f44d9e'.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   200
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   201
    cs := repo @ '4:6f88e1f44d9eb86e0b56ca15e30e5d786acd83c7'.
116
b690f5845323 Class revision ID refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   202
    self assert: cs id printString = '4:6f88e1f44d9e'.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   203
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   204
    cs := repo @ '4:6f88e1f44d9e'.
116
b690f5845323 Class revision ID refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   205
    self assert: cs id printString = '4:6f88e1f44d9e'.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   206
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   207
    "Created: / 16-11-2012 / 21:03:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
116
b690f5845323 Class revision ID refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   208
    "Modified: / 30-11-2012 / 23:34:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   209
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   210
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   211
test_changeset_02
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   212
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   213
    Tests identity if changesets (cacheing)
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   214
    "
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   215
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   216
    | repo cs1 cs2 |
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   217
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   218
    repo := self repositoryNamed:'test_repo_01'.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   219
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   220
    cs1 := repo @ 4.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   221
    cs2 := repo @ 4.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   222
    self assert: cs1 == cs2.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   223
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   224
    cs2 := repo @ '4:6f88e1f44d9eb86e0b56ca15e30e5d786acd83c7'.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   225
    self assert: cs1 == cs2.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   226
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   227
    cs2 := repo @ '4:6f88e1f44d9e'.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   228
    self assert: cs1 == cs2.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   229
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   230
    "Created: / 16-11-2012 / 22:10:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   231
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   232
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   233
test_changeset_03
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   234
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   235
    Test walking history though parents
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   236
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   237
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   238
    | repo cs0 cs1 cs2 cs3 |
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   239
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   240
    repo := self repositoryNamed:'test_repo_01'.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   241
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   242
    cs0 := repo @ 0.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   243
    cs1 := repo @ 1.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   244
    cs2 := repo @ 2.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   245
    cs3 := repo @ 3.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   246
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   247
    self assert: cs3 parent1 == cs2.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   248
    self assert: cs3 parent2 isNil.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   249
    self assert: cs2 parent1 == cs1.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   250
    self assert: cs2 parent2 isNil.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   251
    self assert: cs1 parent1 == cs0.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   252
    self assert: cs1 parent2 isNil.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   253
    self assert: cs0 parent1 isNil.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   254
    self assert: cs0 parent2 isNil.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   255
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   256
    "Created: / 16-11-2012 / 22:14:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   257
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   258
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   259
test_changeset_04
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   260
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   261
    Test access to changeset contents
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   262
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   263
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   264
    | repo cs |
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   265
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   266
    repo := self repositoryNamed:'test_repo_01'.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   267
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   268
    cs := repo @ 1.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   269
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   270
    self assert: cs root children size == 2.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   271
    self assert: (cs root / 'b') children size == 2.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   272
    self assert: (cs root / 'b') parent == cs root.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   273
    self assert: (cs root / 'f1.txt') children size == 0.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   274
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   275
    self should: [cs root / 'abraka'] raise: HGError.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   276
    self should: [cs root / 'c' / 'abraka'] raise: HGError.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   277
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   278
    "Created: / 16-11-2012 / 22:38:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
71
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   279
    "Modified: / 17-11-2012 / 00:23:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   280
!
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   281
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   282
test_changeset_05
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   283
    "
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   284
    Test access to changeset contents
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   285
    "
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   286
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   287
    | repo |
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   288
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   289
    repo := self repositoryNamed:'test_repo_01'.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   290
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   291
    self assert: (repo @ 0 / 'f1.txt') contents asString = 'f1-C0
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   292
'.
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   293
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   294
    self assert: (repo @ 1 / 'f1.txt') contents asString = 'f1-C0
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   295
f1-C1
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   296
'
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   297
bd4cfb10a262 Basic support to access changeset content.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 69
diff changeset
   298
    "Created: / 17-11-2012 / 00:19:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
105
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   299
!
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   300
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   301
test_changeset_06
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   302
    "
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   303
    Test access to changeset contents
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   304
    "
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   305
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   306
    | repo cs |
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   307
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   308
    repo := self repositoryNamed:'test_repo_02'.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   309
    cs := repo @ 5.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   310
    self assert: cs parent1 id revno = 0.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   311
    self assert: cs parent2 id revno = 4.
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   312
25e8ff9d2a31 Added read-only support for branches.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 103
diff changeset
   313
    "Created: / 27-11-2012 / 20:54:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
134
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   314
!
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   315
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   316
test_changeset_07
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   317
    "
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   318
    Test accessing changesets
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   319
    "
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   320
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   321
    | repo cs0 cs1 |
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   322
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   323
    repo := self repositoryNamed:'test_repo_01'.
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   324
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   325
    cs0 := repo @ 0.
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   326
    cs1 := repo @ 1.
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   327
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   328
    self assert: cs0 children size == 1.
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   329
    self assert: (cs0 children includesIdentical: cs1).
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   330
565c8bd9c9e8 Added children support to changesets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 116
diff changeset
   331
    "Created: / 05-12-2012 / 17:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   332
! !
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   333
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   334
!HGTests methodsFor:'tests - commit'!
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   335
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   336
test_commit_02
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   337
    "
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   338
                    base    (r4)
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   339
        1) modify & commit  (r5)
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   340
        2) update wc to r4
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   341
        3) modifty & commit (r6)
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   342
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   343
        check:  i) before 1) only one head r4
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   344
                ii) after 3) two heads r5, r6, both with parent r4
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   345
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   346
    "
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   347
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   348
    | repo wc heads |
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   349
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   350
    repo := self repositoryNamed:'test_repo_01'.
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   351
    wc := repo workingCopy.
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   352
    heads := wc heads.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   353
    self assert: wc changeset id revno == 4.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   354
    self assert: heads size == 1.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   355
    self assert: heads anElement id revno = 4.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   356
    ( wc / 'f1.txt' ) writingFileDo:[:s | s nextPutAll:'modified from test_commit_02 1'. ].
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   357
    wc commit:'test_commit_02 commit 1'.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   358
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   359
    wc update: 4.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   360
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   361
    self assert: wc changeset id revno == 4.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   362
    ( wc / 'f1.txt' ) writingFileDo:[:s | s nextPutAll:'modified from test_commit_02 2'. ].
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   363
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   364
    wc commit:'test_commit_02 commit 2'.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   365
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   366
    heads := wc heads.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   367
    self assert: heads size == 2.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   368
    self assert: heads first parent1 == (repo @ 4).
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   369
    self assert: heads second parent1 == (repo @ 4).
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   370
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   371
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   372
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   373
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   374
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   375
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   376
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   377
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   378
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   379
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   380
     "
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   381
     UserPreferences fileBrowserClass openOn: repo directory.
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   382
    "
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   383
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   384
    "Created: / 27-11-2012 / 10:36:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   385
    "Modified: / 27-11-2012 / 21:53:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
146
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   386
!
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   387
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   388
test_commit_03
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   389
    "
152
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   390
    Commit without configured author should raise an error
146
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   391
    "
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   392
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   393
    | repo wc |
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   394
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   395
    repo := self repositoryNamed:'test_repo_01'.
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   396
    wc := repo workingCopy.
146
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   397
    ( wc / 'f1.txt' ) writingFileDo:[:s | s nextPutAll:'modified from test_commit_02 2'. ].
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   398
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   399
    "Now, fake missing ui.username config entry"
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   400
    (repo config root includesKey: #ui) ifTrue:[
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   401
        (repo config get:#ui) removeKey: #username ifAbsent:[nil].
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   402
    ].
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   403
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   404
    "Try commit"
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   405
    HGAuthorQuery answer: nil do:["/See HGtestCase>>performCase
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   406
    self should:[wc commit:'test_commit_03 commit 1'] raise: HGCommitError
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   407
    ]
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   408
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   409
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   410
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   411
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   412
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   413
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   414
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   415
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   416
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   417
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   418
     "
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   419
     UserPreferences fileBrowserClass openOn: repo directory.
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   420
    "
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   421
1015b8f6dc1c Added check for author signature before commit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 145
diff changeset
   422
    "Created: / 07-12-2012 / 15:42:52 / jv"
152
9068fe7a5795 Support for commiting to a new branch.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 150
diff changeset
   423
    "Modified (comment): / 10-12-2012 / 03:08:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   424
!
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   425
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   426
test_commit_04
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   427
    "
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   428
    Commit with specified date
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   429
    "
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   430
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   431
    | repo wc cs|
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   432
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   433
    repo := self repositoryNamed:'test_repo_01'.
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   434
    wc := repo workingCopy.
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   435
    ( wc / 'f1.txt' ) writingFileDo:[:s | s nextPutAll:'modified from test_commit_04 2'. ].
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   436
224
eaf8b811d987 Bugfix in HGTests>>#test_commit_04 - workaround for buggy Timestamp.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 216
diff changeset
   437
    wc commit: 'test_commit_04 2' date: '0 0'.
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   438
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   439
    cs := repo @ 5.
224
eaf8b811d987 Bugfix in HGTests>>#test_commit_04 - workaround for buggy Timestamp.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 216
diff changeset
   440
    self assert: cs id printString = '5:15e269cc7406'.
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   441
225
48cc28187eed Workaround for buggy Timestamp.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 224
diff changeset
   442
    "
213
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   443
     UserPreferences fileBrowserClass openOn: repo directory.
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   444
    "
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   445
d5a0f178e2c4 Add a date parameter to commit message.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 210
diff changeset
   446
    "Created: / 01-02-2013 / 14:46:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
224
eaf8b811d987 Bugfix in HGTests>>#test_commit_04 - workaround for buggy Timestamp.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 216
diff changeset
   447
    "Modified: / 06-02-2013 / 10:22:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
107
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   448
! !
c92f7674485e Fixed test StXTests>>test_commit_03c
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   449
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   450
!HGTests methodsFor:'tests - mercurial'!
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   451
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   452
test_mercurial_test_commit_t
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   453
    "
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   454
    Taken from Mercurial source code: tests/test-commit.t
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   455
    "
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   456
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   457
    | repo wc |
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   458
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   459
    repo := self repositoryNamed: 'test' init: true.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   460
    wc := repo workingCopy.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   461
    ( wc / 'foo' )
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   462
        contents: 'foo';
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   463
        track.
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   464
    OperatingSystem isMSWINDOWSlike ifFalse:[
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   465
        self should:   [ wc commit: '' ] raise: HGCommitError withMessage: 'empty commit message'.
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   466
    ].
214
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   467
    self shouldnt: [ wc commit: 'commit-1' date:'0 0'] raise: HGError.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   468
    ( wc / 'foo' )
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   469
        contents: 'foo/foo'.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   470
    self should:   [ wc commit: 'commit-3' date:'1 444444444'] raise: HGCommitError withMessage: 'impossible time zone offset: 444444444'.
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   471
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   472
    "Created: / 04-02-2013 / 11:04:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   473
    "Modified: / 04-02-2013 / 12:37:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   474
! !
175e450bb8dd Better error handling in HGCommand (part 1).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 213
diff changeset
   475
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   476
!HGTests methodsFor:'tests - merging'!
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   477
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   478
test_merge_01
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   479
    "
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   480
    Basic working copy tests after merge
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   481
    "
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   482
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   483
    | repo wc |
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   484
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   485
    repo := self repositoryNamed:'mocks/hg/p3'.
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   486
    wc := repo workingCopy.
177
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   487
    wc update: 2.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   488
    wc merge: (repo @ 1).
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   489
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   490
    self assert: (wc root / 'Make.proto') isConflict.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   491
    self assert: (wc root / 'Make.proto') isResolved.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   492
    self deny:   (wc root / 'Make.proto') isUnresolved.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   493
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   494
    self assert: (wc root / 'Make.spec') isConflict.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   495
    self deny:   (wc root / 'Make.spec') isResolved.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   496
    self assert: (wc root / 'Make.spec') isUnresolved.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   497
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   498
    self deny: (wc root / 'MockHGP3Qux.st') isConflict.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   499
    self deny: (wc root / 'MockHGP3Qux.st') isResolved.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   500
    self deny: (wc root / 'MockHGP3Qux.st') isUnresolved.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   501
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   502
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   503
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   504
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   505
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   506
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   507
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   508
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   509
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   510
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   511
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   512
     "
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   513
     UserPreferences fileBrowserClass openOn: repo directory.
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   514
    "
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   515
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   516
    "Created: / 14-01-2013 / 15:34:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   517
    "Modified: / 14-01-2013 / 16:58:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   518
! !
1b0ddad9770e Initial support for merging.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 175
diff changeset
   519
145
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   520
!HGTests methodsFor:'tests - misc'!
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   521
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   522
test_config_01
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   523
    "
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   524
    Test listing repository heads
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   525
    "
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   526
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   527
    | repo1 repo2  |
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   528
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   529
    repo1 := self repositoryNamed:'test_repo_02'.
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   530
    repo2 := repo1 cloneTo: (repositories add: (Filename newTemporaryDirectory / 'repo') pathName).
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   531
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   532
    self assert: ((repo2 config get: 'paths') get: 'default') = repo1 pathName.
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   533
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   534
    "Created: / 06-12-2012 / 21:42:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1b8652185a8f Added HGRepository>>config.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 136
diff changeset
   535
!
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   536
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   537
test_config_02
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   538
    "
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   539
    Test listing repository heads
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   540
    "
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   541
302
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   542
    | repo1 s |
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   543
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   544
    repo1 := self repositoryNamed:'test_repo_02'.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   545
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   546
    self assert: (repo1 config get: #('foo' 'bar') default: nil) isNil.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   547
    Delay waitForSeconds: 1.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   548
302
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   549
    [
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   550
        s := (repo1 path / '.hg' / 'hgrc') appendStream.
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   551
        s nextPutLine:'[foo]'.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   552
        s nextPutLine:'bar = baz'.
302
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   553
    ] ensure:[
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   554
        s close
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   555
    ].
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   556
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   557
    self assert: (repo1 config get: #('foo' 'bar') default: nil) = 'baz'.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   558
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   559
    "Created: / 09-12-2012 / 23:01:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   560
!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   561
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   562
test_heads_01
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   563
    "
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   564
    Test listing repository heads
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   565
    "
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   566
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   567
    | repo heads |
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   568
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   569
    repo := self repositoryNamed:'test_repo_02'.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   570
    heads := repo heads.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   571
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   572
    self assert: heads size == 2.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   573
    self assert: heads first id revno == 5.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   574
    self assert: heads second id revno == 4.
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   575
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   576
    "Created: / 27-11-2012 / 21:34:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   577
!
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   578
247
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   579
test_heads_02
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   580
    "
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   581
    Test listing repository heads on an emptu repository
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   582
    "
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   583
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   584
    | repo heads |
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   585
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   586
    repo := self repositoryNamed:'test_repo_empty' init: true.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   587
    heads := repo heads.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   588
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   589
    self assert: heads isEmpty.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   590
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   591
    "Created: / 08-03-2013 / 19:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   592
!
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
   593
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   594
test_remotes_01
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   595
    "
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   596
    Tests listing og repository remotes (upstream repos)
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   597
    "
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   598
302
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   599
    | repo remotes s |
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   600
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   601
    repo := self repositoryNamed:'test_repo_01'.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   602
302
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   603
    [
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   604
        s := (repo path / '.hg' / 'hgrc') appendStream.
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   605
        s nextPutLine:'[paths]'.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   606
        s nextPutLine:'default = https://swing.fit.cvut.cz/hg/mocks.xxx'.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   607
        s nextPutLine:'jv1 = /home/jv/xxx/jv1/yyy'
302
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   608
    ] ensure:[
e078bdcef149 Fixes for Smalltalk/X 6.2.2 (part 1)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 264
diff changeset
   609
        s close.    
150
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   610
    ].
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   611
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   612
    remotes := repo remotes.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   613
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   614
    self assert: remotes size == 2.
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   615
    self assert: (remotes contains:[:e|e name = 'default' and:[e url asString = 'https://swing.fit.cvut.cz/hg/mocks.xxx']]).
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   616
    self assert: (remotes contains:[:e|e name = 'jv1' and:[e url asString = '///home/jv/xxx/jv1/yyy']]).
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   617
1813913f6106 Addec HGRepositoru>>remotes returning list of remote repositories.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 146
diff changeset
   618
    "Created: / 09-12-2012 / 23:16:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
183
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   619
!
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   620
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   621
test_version
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   622
    "
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   623
    Checks for hg version (just that it does not fail
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   624
    "
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   625
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   626
    HGCommand hgVersion.
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   627
    HGCommand hgVersionOf: nil
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   628
8f8315881c72 Bugfix in Settings (checking for Mercurial version).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 177
diff changeset
   629
    "Created: / 21-01-2013 / 05:22:36 / jv"
106
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   630
! !
99be3b5a40da Added support for heads (both repository and per-branch)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   631
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   632
!HGTests methodsFor:'tests - node id'!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   633
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   634
test_nodeid_01
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   635
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   636
    Tests parsing node id
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   637
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   638
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   639
    | id |
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   640
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   641
    id := HGChangesetId fromString:'4:6f88e1f44d9eb86e0b56ca15e30e5d786acd83c7'.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   642
    self assert: id revno = 4.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   643
    self assert: id asByteArray = #[111 136 225 244 77 158 184 110 11 86 202 21 227 14 93 120 106 205 131 199].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   644
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   645
    id := HGChangesetId fromString:'4:6f88e1f44d9e'.
76
f047cf2fc688 HGTests: tests for not yet supported features commented.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 71
diff changeset
   646
    self assert: id revno = 4.
f047cf2fc688 HGTests: tests for not yet supported features commented.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 71
diff changeset
   647
    self assert: id asByteArray = #[111 136 225 244 77 158].
f047cf2fc688 HGTests: tests for not yet supported features commented.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 71
diff changeset
   648
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   649
    "/Only revno
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   650
    id := HGChangesetId fromString:'1234'.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   651
    self assert: id revno = 1234.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   652
    self assert: id asByteArray = #[].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   653
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   654
    "/Only hash
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   655
    id := HGChangesetId fromString:'6f88e1f44d9eb86e0b56ca15e30e5d786acd83c7'.
189
3d6c123a7295 HGChangesetId>>readFrom: now supports revno-only and hash-only form of CS IDs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
   656
    self assert: id revno = nil. "/meaning - unknown.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   657
    self assert: id asByteArray = #[111 136 225 244 77 158 184 110 11 86 202 21 227 14 93 120 106 205 131 199].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   658
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   659
    "/Only short hash
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   660
    id := HGChangesetId fromString:'6f88e1f44d9e'.
189
3d6c123a7295 HGChangesetId>>readFrom: now supports revno-only and hash-only form of CS IDs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
   661
    self assert: id revno = nil. "/meaning - unknown.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   662
    self assert: id asByteArray = #[111 136 225 244 77 158]
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   663
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   664
    "Created: / 16-11-2012 / 21:27:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
189
3d6c123a7295 HGChangesetId>>readFrom: now supports revno-only and hash-only form of CS IDs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 183
diff changeset
   665
    "Modified: / 22-01-2013 / 12:31:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   666
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   667
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   668
test_nodeid_02
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   669
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   670
    Tests conversions
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   671
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   672
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   673
    | id |
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   674
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   675
    id := '4:6f88e1f44d9eb86e0b56ca15e30e5d786acd83c7' asHGChangesetId.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   676
    self assert: id revno = 4.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   677
    self assert: id asByteArray = #[111 136 225 244 77 158 184 110 11 86 202 21 227 14 93 120 106 205 131 199].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   678
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   679
    id := 1234 asHGChangesetId.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   680
    self assert: id revno = 1234.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   681
    self assert: id asByteArray = #[].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   682
226
e2f6e7330c37 Test fixes for Windows.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 225
diff changeset
   683
    id := #[ 111 136 225 244 77 158 184 110 11 86 202 21 227 14 93 120 106 205 131 199 ]
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   684
    asHGChangesetId.
116
b690f5845323 Class revision ID refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   685
    self assert: id revno isNil.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   686
    self assert: id asByteArray = #[111 136 225 244 77 158 184 110 11 86 202 21 227 14 93 120 106 205 131 199].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   687
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   688
    "Created: / 16-11-2012 / 21:32:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
116
b690f5845323 Class revision ID refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 115
diff changeset
   689
    "Modified: / 30-11-2012 / 23:36:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   690
!
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   691
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   692
test_nodeid_03
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   693
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   694
    Tests comparison
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   695
    "
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   696
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   697
    | id1 id2 |
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   698
103
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   699
    id1 := HGChangesetId new revno: 4.
04731ef44417 HGNodeId renamed to HGChangesetId
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 93
diff changeset
   700
    id2 := HGChangesetId new revno: 4.
69
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   701
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   702
    self assert: id1 = id2.
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   703
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   704
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   705
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   706
    "/ #[111 136 225 244 77 158 184 110 11 86 202 21 227 14 93 120 106 205 131 199].
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   707
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   708
    "Created: / 16-11-2012 / 21:41:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   709
! !
17045d49309f Refactoring: preparation for accessing changeset contents.
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 55
diff changeset
   710
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   711
!HGTests methodsFor:'tests - push/pull'!
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   712
264
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   713
test_pull_01a
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   714
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   715
    Test whether notifications are signalled to the caller.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   716
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   717
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   718
    | repoA wcA repoCDir repoC wcC |
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   719
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   720
    repoA := self repositoryNamed: 'test_push_01_A' init: true.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   721
    wcA := repoA workingCopy.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   722
    repoCDir := HGRepositoriesResource current directoryForRepositoryNamed: 'test_push_01_C' init: false.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   723
    repoC := repoA cloneTo: repoCDir.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   724
    wcC := repoC workingCopy.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   725
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   726
    self should: [ repoA pull: '/some/funny/directory' ] raise: HGError suchThat:[:ex|ex description startsWith: 'repository'].
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   727
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   728
    "Created: / 18-03-2013 / 10:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   729
!
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   730
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   731
test_pull_01b
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   732
    "
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   733
    Test whether notifications are signalled to the caller.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   734
    "
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   735
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   736
    | repoA wcA repoCDir repoC wcC log info |
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   737
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   738
    repoA := self repositoryNamed: 'test_push_01_A' init: true.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   739
    wcA := repoA workingCopy.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   740
    repoCDir := HGRepositoriesResource current directoryForRepositoryNamed: 'test_push_01_C' init: false.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   741
    repoC := repoA cloneTo: repoCDir.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   742
    wcC := repoC workingCopy.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   743
216
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   744
    log := OrderedCollection new.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   745
    [ info := repoC pull: repoA pathName ] on: HGNotification do:[:not|log add: not. not proceed].
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   746
    self assert: log size = 1.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   747
    self assert: info numChangesets = 0.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   748
    self assert: info numChanges = 0.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   749
    self assert: info numFiles = 0.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   750
264
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   751
    "Created: / 18-03-2013 / 10:33:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   752
!
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   753
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   754
test_pull_01c
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   755
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   756
    Test whether notifications are signalled to the caller.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   757
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   758
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   759
    | repoA wcA repoCDir repoC wcC log info |
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   760
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   761
    repoA := self repositoryNamed: 'test_push_01_A' init: true.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   762
    wcA := repoA workingCopy.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   763
    repoCDir := HGRepositoriesResource current directoryForRepositoryNamed: 'test_push_01_C' init: false.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   764
    repoC := repoA cloneTo: repoCDir.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   765
    wcC := repoC workingCopy.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   766
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   767
254
b268d7cd9c37 Syntax fix.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
   768
    (wcA / 'foo') writingFileDo:[:s|s nextPutAll: 'foo'; syncData]; track.
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   769
    wcA commit:'test_push_01 1'.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   770
216
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   771
    log := OrderedCollection new.
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   772
    [ info := repoC pull: repoA pathName ] on: HGNotification do:[:not|log add: not. not proceed].
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   773
    self assert: (repoC @ 0) message = 'test_push_01 1'.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   774
    self assert: log size = 4.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   775
    self assert: info numChangesets = 1.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   776
    self assert: info numChanges = 1.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   777
    self assert: info numFiles = 1.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   778
264
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   779
    "Created: / 18-03-2013 / 10:34:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   780
!
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   781
264
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   782
test_push_01a
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   783
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   784
    Test whether notifications are signalled to the caller.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   785
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   786
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   787
    | repoA wcA repoCDir repoC |
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   788
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   789
    repoA := self repositoryNamed: 'test_push_01_A' init: true.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   790
    wcA := repoA workingCopy.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   791
    repoCDir := HGRepositoriesResource current directoryForRepositoryNamed: 'test_push_01_C' init: false.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   792
    repoC := repoA cloneTo: repoCDir.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   793
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   794
    self should: [ repoA push: '/some/funny/directory' ] raise: HGError 
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   795
        suchThat:[:ex|
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   796
            ex description startsWith: 'repository'
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   797
    ].
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   798
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   799
    "Created: / 18-03-2013 / 10:34:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   800
!
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   801
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   802
test_push_01b
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   803
    "
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   804
    Test whether notifications are signalled to the caller.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   805
    "
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   806
216
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   807
    | repoA wcA repoCDir repoC log info |
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   808
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   809
    repoA := self repositoryNamed: 'test_push_01_A' init: true.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   810
    wcA := repoA workingCopy.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   811
    repoCDir := HGRepositoriesResource current directoryForRepositoryNamed: 'test_push_01_C' init: false.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   812
    repoC := repoA cloneTo: repoCDir.
216
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   813
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   814
    log := OrderedCollection new.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   815
    [ info := repoA push: repoC pathName ] on: HGNotification do:[:not|log add: not. not proceed].
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   816
    self assert: log size = 1.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   817
    self assert: info numChangesets = 0.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   818
    self assert: info numChanges = 0.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   819
    self assert: info numFiles = 0.
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   820
264
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   821
    "Created: / 18-03-2013 / 10:34:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   822
!
216
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   823
264
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   824
test_push_01c
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   825
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   826
    Test whether notifications are signalled to the caller.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   827
    "
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   828
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   829
    | repoA wcA repoCDir repoC log info |
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   830
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   831
    repoA := self repositoryNamed: 'test_push_01_A' init: true.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   832
    wcA := repoA workingCopy.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   833
    repoCDir := HGRepositoriesResource current directoryForRepositoryNamed: 'test_push_01_C' init: false.
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   834
    repoC := repoA cloneTo: repoCDir.
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   835
254
b268d7cd9c37 Syntax fix.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 253
diff changeset
   836
    (wcA / 'foo') writingFileDo:[:s|s nextPutAll: 'foo'; syncData]; track.
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   837
    wcA commit:'test_push_01 1'.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   838
216
0a3821d4bdb6 Error & notification handling & propagating unified. Fixes in push/pull error handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 215
diff changeset
   839
    log := OrderedCollection new.
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   840
    [ info := repoA push: repoC pathName ] on: HGNotification do:[:not|log add: not. not proceed].
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   841
    self assert: (repoC @ 0) message = 'test_push_01 1'.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   842
    self assert: log size = 4.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   843
    self assert: info numChangesets = 1.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   844
    self assert: info numChanges = 1.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   845
    self assert: info numFiles = 1.
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   846
264
0dfa1a4b17ea HGTests: push/pull tests splitted into multiple tests.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 254
diff changeset
   847
    "Created: / 18-03-2013 / 10:35:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
215
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   848
! !
165ce6502156 Temporary commit: added notification propagation. Added Push/Pull info.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 214
diff changeset
   849
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   850
!HGTests methodsFor:'tests - wc'!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   851
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   852
test_wc_01a
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   853
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   854
    " Test revisions "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   855
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   856
    | repo  wc  f1_txt revs |
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   857
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   858
    repo := self repositoryNamed:'test_repo_01'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   859
     "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   860
     UserPreferences fileBrowserClass openOn: repo directory.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   861
    "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   862
    wc := repo workingCopy.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   863
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   864
    f1_txt := wc / 'f1.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   865
    revs := f1_txt revisions.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   866
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   867
    self assert: revs size == 2.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   868
    self assert: revs first contents asString = 'f1-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   869
f1-C1
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   870
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   871
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   872
    self assert: revs second contents asString = 'f1-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   873
'
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   874
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   875
    "Created: / 05-12-2012 / 19:50:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   876
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   877
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   878
test_wc_01b
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   879
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   880
    " Test revisions "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   881
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   882
    | repo  wc  f1_txt revs |
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   883
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   884
    repo := self repositoryNamed:'test_repo_01'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   885
     "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   886
     UserPreferences fileBrowserClass openOn: repo directory.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   887
    "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   888
    wc := repo workingCopy.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   889
    wc update: 0.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   890
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   891
    f1_txt := wc / 'f1.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   892
    revs := f1_txt revisions.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   893
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   894
    self assert: revs size == 2.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   895
    self assert: revs first contents asString = 'f1-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   896
f1-C1
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   897
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   898
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   899
    self assert: revs second contents asString = 'f1-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   900
'
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   901
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   902
    "Created: / 05-12-2012 / 19:50:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   903
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   904
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   905
test_wc_02a
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   906
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   907
    " Test revisions "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   908
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   909
    | repo  wc  f1_txt revs |
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   910
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   911
    repo := self repositoryNamed:'test_repo_01'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   912
     "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   913
     UserPreferences fileBrowserClass openOn: repo directory.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   914
    "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   915
    wc := repo workingCopy.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   916
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   917
    f1_txt := wc / 'c' / 'f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   918
    revs := f1_txt revisions.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   919
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   920
    self assert: revs size == 3.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   921
    self assert: revs first pathName = 'c/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   922
    self assert: revs first contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   923
f3-C2
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   924
f3-C4
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   925
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   926
    self assert: revs second pathName = 'c/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   927
    self assert: revs second contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   928
f3-C2
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   929
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   930
    self assert: revs third pathName = 'b/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   931
    self assert: revs third contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   932
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   933
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   934
    "Created: / 05-12-2012 / 19:54:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   935
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   936
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   937
test_wc_02b
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   938
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   939
    " Test revisions "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   940
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   941
    | repo  wc  f1_txt revs |
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   942
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   943
    repo := self repositoryNamed:'test_repo_01'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   944
     "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   945
     UserPreferences fileBrowserClass openOn: repo directory.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   946
    "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   947
    wc := repo workingCopy.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   948
    wc update: 2.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   949
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   950
    f1_txt := wc / 'c' / 'f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   951
    revs := f1_txt revisions.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   952
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   953
    self assert: revs size == 3.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   954
    self assert: revs first pathName = 'c/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   955
    self assert: revs first contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   956
f3-C2
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   957
f3-C4
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   958
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   959
    self assert: revs second pathName = 'c/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   960
    self assert: revs second contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   961
f3-C2
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   962
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   963
    self assert: revs third pathName = 'b/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   964
    self assert: revs third contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   965
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   966
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   967
    "Created: / 05-12-2012 / 20:00:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   968
!
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   969
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   970
test_wc_02c
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   971
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   972
    " Test revisions "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   973
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   974
    | repo  wc  f1_txt revs |
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   975
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   976
    repo := self repositoryNamed:'test_repo_01'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   977
     "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   978
     UserPreferences fileBrowserClass openOn: repo directory.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   979
    "
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   980
    wc := repo workingCopy.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   981
    wc update: 0.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   982
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   983
    f1_txt := wc / 'b' / 'f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   984
    revs := f1_txt revisions.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   985
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   986
    self assert: revs size == 3.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   987
    self assert: revs first pathName = 'c/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   988
    self assert: revs first contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   989
f3-C2
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   990
f3-C4
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   991
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   992
    self assert: revs second pathName = 'c/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   993
    self assert: revs second contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   994
f3-C2
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   995
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   996
    self assert: revs third pathName = 'b/f3.txt'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   997
    self assert: revs third contents asString = 'f3-C0
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   998
'.
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
   999
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
  1000
    "Created: / 05-12-2012 / 20:00:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
247
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1001
!
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1002
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1003
test_wc_03a
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1004
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1005
    " 
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1006
        Test HGWorkingCopy>>changeset/changesetId on
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1007
        an empty repository
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1008
    "
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1009
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1010
    | repo  wc |
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1011
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1012
    repo := self repositoryNamed:'test_repo_empty' init: true.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1013
     "
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1014
     UserPreferences fileBrowserClass openOn: repo directory.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1015
    "
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1016
    wc := repo workingCopy.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1017
    self assert: (wc path / '.hg' / 'dirstate') exists not.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1018
    self assert: wc changesetId = HGChangesetId null.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1019
    self assert: wc changeset   = HGChangeset null.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1020
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1021
    ( wc / 'a.txt' ) writingFileDo:[:s|s nextPutAll: 'a'].
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1022
    ( wc / 'a.txt' ) track.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1023
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1024
    self assert: (wc path / '.hg' / 'dirstate') exists.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1025
    self assert: wc changesetId = HGChangesetId null.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1026
    self assert: wc changeset   = HGChangeset null.
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1027
bf5bfe409ff8 Bugfix for commiting to an empty repository.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 235
diff changeset
  1028
    "Created: / 08-03-2013 / 19:49:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
136
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
  1029
! !
2d1512dde043 Added HGWorkingCopyFile>>revisions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 134
diff changeset
  1030
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1031
!HGTests class methodsFor:'documentation'!
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1032
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 49
diff changeset
  1033
version_HG
115
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
  1034
b1ed2d29054b version_HG changed to return string.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 107
diff changeset
  1035
    ^ '$Changeset: <not expanded> $'
54
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 49
diff changeset
  1036
!
66045198bfbc More changes towards self hosting. Some work on model is still missing...
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 49
diff changeset
  1037
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1038
version_SVN
55
30d72a8f4501 Commit support
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents: 54
diff changeset
  1039
    ^ '§Id::                                                                                                                        §'
34
0ef61b36cfa7 - First bits
vranyj1@bd9d3459-6c23-4dd9-91de-98eeebb81177
parents:
diff changeset
  1040
! !
303
aee999e9dc25 Bugfixes in push parsing.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 302
diff changeset
  1041