mercurial/HGPackageModel.st
changeset 109 08c6eca6df25
parent 102 16bc16d9e6d5
child 111 6439af30a24b
equal deleted inserted replaced
107:c92f7674485e 109:08c6eca6df25
    27 repository
    27 repository
    28     self ensureWorkingCopy.
    28     self ensureWorkingCopy.
    29     ^wc repository
    29     ^wc repository
    30 
    30 
    31     "Created: / 15-11-2012 / 09:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    31     "Created: / 15-11-2012 / 09:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    32 !
       
    33 
       
    34 upstreamRepository
       
    35     "Returns original package repository (not the temporary repository)"
       
    36 
       
    37     "Stupid naming here..."
       
    38 
       
    39     ^repository
       
    40 
       
    41     "Created: / 27-11-2012 / 23:22:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    32 ! !
    42 ! !
    33 
    43 
    34 !HGPackageModel methodsFor:'accessing-classes'!
    44 !HGPackageModel methodsFor:'accessing-classes'!
    35 
    45 
    36 commitDialogClass
    46 commitDialogClass
    69 !HGPackageModel methodsFor:'utils'!
    79 !HGPackageModel methodsFor:'utils'!
    70 
    80 
    71 ensureWorkingCopy
    81 ensureWorkingCopy
    72     "raise an error: must be redefined in concrete subclass(es)"
    82     "raise an error: must be redefined in concrete subclass(es)"
    73 
    83 
    74     | tmpPath tmpRepo tmpWc |
    84     | rev tmpPath tmpRepo tmpWc |
    75 
    85 
    76     (wc notNil and:[wc path exists]) ifTrue:[ ^ self ].
    86     rev := self definition hgLogicalRevision.
       
    87     (wc notNil and:[wc path exists]) ifTrue:[ 
       
    88         wc changeset id ~= rev ifTrue:[
       
    89             wc update:rev.
       
    90         ].
       
    91         ^ self 
       
    92     ].
    77 
    93 
    78     tmpPath := self manager temporaryWorkingCopyDirectory / repository uuid printString.
    94     tmpPath := self manager temporaryWorkingCopyDirectory / repository uuid printString.
    79     tmpPath exists ifTrue:[
    95     tmpPath exists ifTrue:[
    80         tmpRepo := HGRepository on: tmpPath.
    96         tmpRepo := HGRepository on: tmpPath.
    81         tmpWc := tmpRepo workingCopy.
    97         tmpRepo pull.
    82     ] ifFalse:[
    98     ] ifFalse:[
    83         tmpRepo := repository cloneTo: tmpPath update: false.
    99         tmpRepo := repository cloneTo: tmpPath update: false.
    84         tmpWc := tmpRepo workingCopy.
       
    85         tmpWc update: self definition hgLogicalRevision.
       
    86     ].
   100     ].
       
   101     tmpWc := tmpRepo workingCopy.
       
   102     tmpWc update: rev.
    87 
   103 
    88     self wc: tmpWc
   104     self wc: tmpWc
    89 
   105 
    90     "Created: / 14-11-2012 / 00:16:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   106     "Created: / 14-11-2012 / 00:16:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    91     "Modified: / 21-11-2012 / 00:37:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   107     "Modified: / 27-11-2012 / 23:44:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    92 ! !
   108 ! !
    93 
   109 
    94 !HGPackageModel class methodsFor:'documentation'!
   110 !HGPackageModel class methodsFor:'documentation'!
    95 
   111 
    96 version_GIT
   112 version_GIT