mercurial/HGRepository.st
changeset 655 d16442a5751c
parent 577 cd420edfbd1d
equal deleted inserted replaced
605:96fd9746c9ed 655:d16442a5751c
   141 
   141 
   142     ^self clone: aFilenameOrUrlOrString to: aStringOrFilename update: true
   142     ^self clone: aFilenameOrUrlOrString to: aStringOrFilename update: true
   143 
   143 
   144     "Created: / 14-11-2012 / 22:46:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   144     "Created: / 14-11-2012 / 22:46:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   145     "Modified: / 21-11-2012 / 00:20:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   145     "Modified: / 21-11-2012 / 00:20:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   146     "Modified (comment): / 25-03-2016 / 17:27:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   146 !
   147 !
   147 
   148 
   148 clone: aFilenameOrUrlOrString to: aStringOrFilename update: update
   149 clone: aFilenameOrUrlOrString to: aStringOrFilename update: update
   149     "Clones repository at given URL to given directory.
   150     "Clones repository at given URL to given directory.
   150      Returns an instance HGRepository representing the clone."
   151      Returns an instance HGRepository representing the clone."
   860     "Created: / 16-12-2012 / 00:40:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   861     "Created: / 16-12-2012 / 00:40:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   861 ! !
   862 ! !
   862 
   863 
   863 !HGRepository methodsFor:'testing'!
   864 !HGRepository methodsFor:'testing'!
   864 
   865 
       
   866 hasExtension: extension
       
   867     "Return true, if the repository has `extension` enabled, false otherwise"
       
   868 
       
   869     | extensions value |
       
   870 
       
   871     extensions := self config get: 'extensions' default: nil.
       
   872     extensions notNil ifTrue:[ 
       
   873         value := extensions get: extension default: 0.
       
   874         value ~~ 0 ifTrue:[ 
       
   875             ^value isEmptyOrNil or:[ value asFilename exists ]
       
   876         ].
       
   877     ].
       
   878     ^ false
       
   879 
       
   880     "
       
   881     (HGRepository on: (Smalltalk getPackageDirectoryForPackage: #'stx:libscm')) hasExtension: 'evolve'
       
   882     "
       
   883 
       
   884     "Created: / 16-03-2016 / 23:56:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   885 !
       
   886 
       
   887 hasExtensionEvolve
       
   888     "Return true, if evolve extension is enabled on the receiver"
       
   889 
       
   890     ^ self hasExtension:'evolve'
       
   891 
       
   892     "Created: / 16-03-2016 / 23:57:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   893 !
       
   894 
   865 isShared
   895 isShared
   866     "Return true, if this repository is shared, i.e., created by means
   896     "Return true, if this repository is shared, i.e., created by means
   867      of `hg share`"
   897      of `hg share`"
   868 
   898 
   869     ^ (path / '.hg' / 'sharedpath') exists
   899     ^ (path / '.hg' / 'sharedpath') exists
   992 
  1022 
   993      Return changeset with filled data, i.e,, changeset is
  1023      Return changeset with filled data, i.e,, changeset is
   994      non-lazy"
  1024      non-lazy"
   995 
  1025 
   996      | csets cs |
  1026      | csets cs |
   997      csets := self repository execute:
  1027      csets := repository execute:
   998                     (HGCommand log
  1028                     (HGCommand log
   999                         workingDirectory: repository path asString;
  1029                         workingDirectory: repository path asString;
  1000                         revsets: (self loadRevsetsForLoad: id);
  1030                         revsets: (self loadRevsetsForLoad: id);
       
  1031                         hidden: true; "/ Hidden changeset are supported since 2.5, but
       
  1032                                       "/ the HGCommand::log cares of this itself, so it's
       
  1033                                       "/ safe to pass true here.
  1001                         yourself).
  1034                         yourself).
  1002      "/just to be defensive...
  1035      "/just to be defensive...
  1003      csets do:[:each| 
  1036      csets do:[:each| 
  1004         | existing |
  1037         | existing |
  1005 
  1038 
  1018     ].
  1051     ].
  1019     self assert: cs notNil.
  1052     self assert: cs notNil.
  1020     ^cs
  1053     ^cs
  1021 
  1054 
  1022     "Created: / 16-12-2012 / 00:57:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1055     "Created: / 16-12-2012 / 00:57:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1023     "Modified: / 03-03-2013 / 22:58:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1056     "Modified: / 25-03-2016 / 17:26:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1024 !
  1057 !
  1025 
  1058 
  1026 loadRevsetsForLoad: id
  1059 loadRevsetsForLoad: id
  1027     | revsets ids start stop addId |
  1060     | revsets ids start stop addId |
  1028 
  1061