mercurial/HGWorkingCopyFile.st
branchhg-command-server-support
changeset 234 a9ef61b902ae
parent 210 54a73fa50d40
child 235 3d8ef499d7d9
equal deleted inserted replaced
233:d9a8bb2aaa0b 234:a9ef61b902ae
   101     ^p
   101     ^p
   102 
   102 
   103     "Created: / 06-12-2012 / 17:11:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   103     "Created: / 06-12-2012 / 17:11:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   104 !
   104 !
   105 
   105 
       
   106 repository
       
   107     ^wc repository
       
   108 
       
   109     "Created: / 03-03-2013 / 20:40:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   110 !
       
   111 
   106 revisions
   112 revisions
   107     | path pathS |
   113     | path pathS |
   108 
   114 
   109     path := self pathNameRelative.
   115     path := self pathNameRelative.
   110     pathS := OperatingSystem isMSWINDOWSlike 
   116     pathS := OperatingSystem isMSWINDOWSlike 
   115     revisions isNil ifTrue:[
   121     revisions isNil ifTrue:[
   116         | old oldIds |
   122         | old oldIds |
   117         oldIds := HGCommand log
   123         oldIds := HGCommand log
   118                         workingDirectory: wc pathName;
   124                         workingDirectory: wc pathName;
   119                         path: path;
   125                         path: path;
   120                         execute.
   126                         executeOnRepository: self repository.
   121         pathS.
   127         pathS.
   122         old := OrderedCollection new.
   128         old := OrderedCollection new.
   123         oldIds withIndexDo: [:id :index|
   129         oldIds withIndexDo: [:id :index|
   124             old add: (
   130             old add: (
   125                 LazyRevision new
   131                 LazyRevision new
   143 
   149 
   144     ^((wc changeset / pathS) newer:true) , revisions
   150     ^((wc changeset / pathS) newer:true) , revisions
   145 
   151 
   146     "Created: / 05-12-2012 / 19:09:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   152     "Created: / 05-12-2012 / 19:09:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   147     "Modified: / 06-12-2012 / 03:50:58 / jv"
   153     "Modified: / 06-12-2012 / 03:50:58 / jv"
   148     "Modified: / 22-01-2013 / 13:52:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   154     "Modified: / 03-03-2013 / 20:40:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   149 !
   155 !
   150 
   156 
   151 status
   157 status
   152     | cmd statuses  |
   158     | cmd statuses  |
   153 
   159 
   154     cmd := HGCommand status.
   160     cmd := HGCommand status.
   155     cmd workingDirectory: filename directory.
   161     cmd workingDirectory: filename directory.
   156     cmd path: filename pathName.
   162     cmd path: filename pathName.
   157     statuses := cmd execute.
   163     statuses := cmd executeOnRepository: self repository.
   158     self assert: statuses size == 1.
   164     self assert: statuses size == 1.
   159     self assert: statuses first second = filename baseName.
   165     self assert: statuses first second = filename baseName.
   160     ^statuses first first.
   166     ^statuses first first.
   161 
   167 
   162     "Created: / 24-09-2012 / 22:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   168     "Created: / 24-09-2012 / 22:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   163     "Modified: / 09-11-2012 / 12:09:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   169     "Modified: / 03-03-2013 / 20:40:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   164 ! !
   170 ! !
   165 
   171 
   166 !HGWorkingCopyFile methodsFor:'delegating'!
   172 !HGWorkingCopyFile methodsFor:'delegating'!
   167 
   173 
   168 doesNotUnderstand: aMessage
   174 doesNotUnderstand: aMessage
   268 markResolved
   274 markResolved
   269     HGCommand resolve
   275     HGCommand resolve
   270         workingDirectory: filename directory;
   276         workingDirectory: filename directory;
   271         mark: true;
   277         mark: true;
   272         files: (Array with: filename baseName);
   278         files: (Array with: filename baseName);
   273         execute.
   279         executeOnRepository: self repository.
   274 
   280 
   275     "Created: / 15-01-2013 / 10:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   281     "Created: / 15-01-2013 / 10:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   282     "Modified: / 03-03-2013 / 20:40:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   276 !
   283 !
   277 
   284 
   278 markUnresolved
   285 markUnresolved
   279     HGCommand resolve
   286     HGCommand resolve
   280         workingDirectory: filename directory;
   287         workingDirectory: filename directory;
   281         unmark: true;
   288         unmark: true;
   282         files: (Array with: filename baseName);
   289         files: (Array with: filename baseName);
   283         execute.
   290         executeOnRepository: self repository.
   284 
   291 
   285     "Created: / 15-01-2013 / 10:22:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   292     "Created: / 15-01-2013 / 10:22:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   293     "Modified: / 03-03-2013 / 20:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   286 !
   294 !
   287 
   295 
   288 moveTo: destination
   296 moveTo: destination
   289     "Make sure that this entry is tracked by Mercurial"
   297     "Make sure that this entry is tracked by Mercurial"
   290 
   298 
   291     self isTracked ifTrue:[
   299     self isTracked ifTrue:[
   292         HGCommand mv
   300         HGCommand mv
   293             workingDirectory: filename directory;
   301             workingDirectory: filename directory;
   294             source: filename pathName;
   302             source: filename pathName;
   295             destination: destination pathName;
   303             destination: destination pathName;
   296             execute.
   304             executeOnRepository: self repository.
   297     ].
   305     ].
   298     filename exists ifTrue:[
   306     filename exists ifTrue:[
   299         filename moveTo: destination pathName
   307         filename moveTo: destination pathName
   300     ].
   308     ].
   301 
   309 
   302     "Created: / 15-11-2012 / 00:23:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   310     "Created: / 15-11-2012 / 00:23:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   303     "Modified: / 21-11-2012 / 00:48:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   311     "Modified: / 03-03-2013 / 20:40:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   304 !
   312 !
   305 
   313 
   306 remove
   314 remove
   307     "Make sure that this entry is tracked by Mercurial"
   315     "Make sure that this entry is tracked by Mercurial"
   308 
   316 
   309     self isTracked ifTrue:[
   317     self isTracked ifTrue:[
   310         HGCommand remove
   318         HGCommand remove
   311             workingDirectory: filename directory;
   319             workingDirectory: filename directory;
   312             paths: { filename baseName };
   320             paths: { filename baseName };
   313             execute
   321             executeOnRepository: self repository
   314     ].
   322     ].
   315     filename remove
   323     filename remove
   316 
   324 
   317     "Created: / 15-11-2012 / 00:08:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   325     "Created: / 15-11-2012 / 00:08:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   318     "Modified: / 16-11-2012 / 20:09:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   326     "Modified: / 03-03-2013 / 20:40:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   319 !
   327 !
   320 
   328 
   321 track
   329 track
   322     "Make sure that this entry is tracked by Mercurial"
   330     "Make sure that this entry is tracked by Mercurial"
   323 
   331 
   324     self isUntracked ifTrue:[
   332     self isUntracked ifTrue:[
   325         HGCommand add
   333         HGCommand add
   326             workingDirectory: filename directory;
   334             workingDirectory: filename directory;
   327             paths: { filename baseName };
   335             paths: { filename baseName };
   328             execute.
   336             executeOnRepository: self repository.
   329     ]
   337     ]
   330 
   338 
   331     "Created: / 15-11-2012 / 00:08:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   339     "Created: / 15-11-2012 / 00:08:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   340     "Modified: / 03-03-2013 / 20:40:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   332 ! !
   341 ! !
   333 
   342 
   334 !HGWorkingCopyFile methodsFor:'printing & storing'!
   343 !HGWorkingCopyFile methodsFor:'printing & storing'!
   335 
   344 
   336 printOn:aStream
   345 printOn:aStream