mercurial/HGCommand.st
changeset 372 5acd6d915c77
parent 366 9da938d1e76a
child 395 fc0607653d8a
equal deleted inserted replaced
367:af5fea76e6ed 372:5acd6d915c77
    81 	poolDictionaries:''
    81 	poolDictionaries:''
    82 	privateIn:HGCommand
    82 	privateIn:HGCommand
    83 !
    83 !
    84 
    84 
    85 HGCommand subclass:#log
    85 HGCommand subclass:#log
    86 	instanceVariableNames:'start stop path childrenOnly revsets'
    86 	instanceVariableNames:'start stop path childrenOnly idsOnly revsets limit'
    87 	classVariableNames:''
    87 	classVariableNames:''
    88 	poolDictionaries:''
    88 	poolDictionaries:''
    89 	privateIn:HGCommand
    89 	privateIn:HGCommand
    90 !
    90 !
    91 
    91 
   529         Logger log: 'cmd: propagating: ' , anException class name , ' - ', anException description severity: #trace facility: 'HG'.
   529         Logger log: 'cmd: propagating: ' , anException class name , ' - ', anException description severity: #trace facility: 'HG'.
   530     ].
   530     ].
   531     errors nextPut: anException.
   531     errors nextPut: anException.
   532 
   532 
   533     "Created: / 04-02-2013 / 21:29:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   533     "Created: / 04-02-2013 / 21:29:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   534     "Modified: / 05-03-2013 / 19:32:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   534     "Modified: / 09-02-2014 / 19:28:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   535 !
   535 !
   536 
   536 
   537 signal
   537 signal
   538     "Signal all propagated exceptions to the caller"
   538     "Signal all propagated exceptions to the caller"
   539 
   539 
   710     "Modified (format): / 27-12-2011 / 15:47:10 / dundee"
   710     "Modified (format): / 27-12-2011 / 15:47:10 / dundee"
   711     "Modified: / 30-09-2012 / 23:43:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   711     "Modified: / 30-09-2012 / 23:43:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   712 !
   712 !
   713 
   713 
   714 command
   714 command
   715     "Returns the git 'command' option, i.e. commit,
   715     "Returns the hg 'command' option, i.e. commit,
   716      push, pull, ..."
   716      push, pull, ..."
   717 
   717 
   718     ^self class nameWithoutPrefix
   718     ^self class nameWithoutPrefix
   719 
   719 
   720     "
   720     "
   722     "
   722     "
   723 
   723 
   724     "Created: / 11-05-2011 / 07:58:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   724     "Created: / 11-05-2011 / 07:58:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   725     "Modified (format): / 27-12-2011 / 15:47:17 / dundee"
   725     "Modified (format): / 27-12-2011 / 15:47:17 / dundee"
   726     "Modified: / 30-09-2012 / 23:37:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   726     "Modified: / 30-09-2012 / 23:37:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   727     "Modified (comment): / 17-10-2012 / 13:25:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   727     "Modified (comment): / 08-02-2014 / 11:41:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   728 !
   728 !
   729 
   729 
   730 executable
   730 executable
   731     ^ self class hgCommand
   731     ^ self class hgCommand
   732 
   732 
  1182 
  1182 
  1183     "Created: / 15-11-2012 / 17:04:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1183     "Created: / 15-11-2012 / 17:04:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1184     "Modified: / 08-03-2013 / 19:35:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1184     "Modified: / 08-03-2013 / 19:35:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1185 ! !
  1185 ! !
  1186 
  1186 
  1187 
       
  1188 
       
  1189 !HGCommand::locate methodsFor:'accessing'!
  1187 !HGCommand::locate methodsFor:'accessing'!
  1190 
  1188 
  1191 revision
  1189 revision
  1192     ^ revision
  1190     ^ revision
  1193 !
  1191 !
  1224     ^ childrenOnly
  1222     ^ childrenOnly
  1225 !
  1223 !
  1226 
  1224 
  1227 childrenOnly:aBoolean
  1225 childrenOnly:aBoolean
  1228     childrenOnly := aBoolean.
  1226     childrenOnly := aBoolean.
       
  1227 !
       
  1228 
       
  1229 idsOnly
       
  1230     ^ idsOnly
       
  1231 !
       
  1232 
       
  1233 idsOnly:aBoolean
       
  1234     idsOnly := aBoolean.
       
  1235 !
       
  1236 
       
  1237 limit
       
  1238     ^ limit
       
  1239 !
       
  1240 
       
  1241 limit:anInteger
       
  1242     limit := anInteger.
  1229 !
  1243 !
  1230 
  1244 
  1231 path
  1245 path
  1232     ^ path
  1246     ^ path
  1233 !
  1247 !
  1258 argumentsCommandOn:stream
  1272 argumentsCommandOn:stream
  1259     "Called to get command specific options"
  1273     "Called to get command specific options"
  1260 
  1274 
  1261     | template |
  1275     | template |
  1262 
  1276 
       
  1277     template := HGCommandParser templateLog.       
  1263     path isNil ifTrue:[
  1278     path isNil ifTrue:[
  1264         revsets isEmptyOrNil ifTrue:[
  1279         revsets isEmptyOrNil ifTrue:[
  1265             self error:'No revisions given'.
  1280             self error:'No revisions given'.
  1266         ].
  1281         ].
  1267         revsets do:[:revset|
  1282         revsets do:[:revset|
  1268             stream nextPut:'--rev'.
  1283             stream nextPut:'--rev'.
  1269             stream nextPut:revset asString
  1284             stream nextPut:revset asString
  1270         ].
  1285         ].
  1271         template := HGCommandParser templateLog.
       
  1272     ] ifFalse:[
  1286     ] ifFalse:[
  1273         stream nextPut: '--follow'.
  1287         stream nextPut: '--follow'.
  1274         template := HGCommandParser templateLogFile.
  1288     ].
       
  1289     idsOnly == true ifTrue:[ 
       
  1290         template := HGCommandParser templateLogIdsOnly. 
  1275     ].
  1291     ].
  1276 
  1292 
  1277     childrenOnly == true ifTrue:[
  1293     childrenOnly == true ifTrue:[
  1278         template := HGCommandParser templateLogChildren.
  1294         template := HGCommandParser templateLogChildren.
  1279     ].
  1295     ].
  1280 
  1296 
  1281     stream
  1297     stream
  1282         nextPut:'--debug';
  1298         nextPut:'--debug';
  1283         nextPut:'--template';
  1299         nextPut:'--template';
  1284         nextPut:template.
  1300         nextPut:template.
       
  1301     limit notNil ifTrue:[ 
       
  1302         stream 
       
  1303             nextPut: '-l';
       
  1304             nextPut: limit printString
       
  1305     ].
  1285 
  1306 
  1286     path notNil ifTrue:[
  1307     path notNil ifTrue:[
  1287         stream nextPut: path.
  1308         stream nextPut: path.
  1288     ].
  1309     ].
  1289 
  1310 
  1290     "Created: / 13-11-2012 / 09:05:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1311     "Created: / 13-11-2012 / 09:05:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1291     "Modified: / 22-01-2013 / 16:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1312     "Modified: / 08-02-2014 / 22:22:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1292 !
  1313 !
  1293 
  1314 
  1294 parseOutput:stream
  1315 parseError:stream
  1295     "Parses output of 'hg' command, i.e. commit, log, update, checkout,
  1316     "Parses output of 'hg' command, i.e. commit, log, update, checkout,
  1296      etc."
  1317      etc."
  1297 
  1318 
       
  1319     ^ (self parserOn: stream) parseErrorLog.
       
  1320 
       
  1321     "Created: / 09-02-2014 / 10:22:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1322 !
       
  1323 
       
  1324 parseOutput:stream
       
  1325     "Parses output of 'hg' command, i.e. commit, log, update, checkout,
       
  1326      etc."
       
  1327 
  1298     childrenOnly == true ifTrue:[
  1328     childrenOnly == true ifTrue:[
  1299         ^ (self parserOn:stream) parseCommandLogChildren.
  1329         ^ (self parserOn:stream) parseCommandLogChildren.
  1300     ].
  1330     ].
  1301     ^ path isNil
  1331     ^ idsOnly ~~ true
  1302         ifTrue:[ (self parserOn:stream) parseCommandLog ]
  1332         ifTrue:[ (self parserOn:stream) parseCommandLog ]
  1303         ifFalse:[ (self parserOn:stream) parseCommandLogFile ]
  1333         ifFalse:[ (self parserOn:stream) parseCommandLogIdsOnly ]
  1304 
  1334 
  1305     "Created: / 13-11-2012 / 09:05:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1335     "Created: / 13-11-2012 / 09:05:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1306     "Modified: / 05-12-2012 / 23:51:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1336     "Modified: / 08-02-2014 / 22:12:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1307 ! !
  1337 ! !
  1308 
  1338 
  1309 !HGCommand::merge methodsFor:'accessing'!
  1339 !HGCommand::merge methodsFor:'accessing'!
  1310 
  1340 
  1311 revision
  1341 revision