@@ -384,8 +384,8 @@ def remove(dest):
384
384
except ProcessException :
385
385
pass
386
386
387
- def commit ():
388
- popen ([hg_cmd , 'commit' ] + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
387
+ def commit (msg = None ):
388
+ popen ([hg_cmd , 'commit' ] + (['-m' , msg ] if msg else []) + ([ '- v' ] if very_verbose else ([] if verbose else ['-q' ])))
389
389
390
390
def publish (all_refs = None ):
391
391
popen ([hg_cmd , 'push' ] + (['--new-branch' ] if all_refs else []) + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
@@ -553,8 +553,8 @@ def remove(dest):
553
553
except ProcessException :
554
554
pass
555
555
556
- def commit ():
557
- popen ([git_cmd , 'commit' , '-a' ] + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
556
+ def commit (msg = None ):
557
+ popen ([git_cmd , 'commit' , '-a' ] + (['-m' , msg ] if msg else []) + ([ '- v' ] if very_verbose else ([] if verbose else ['-q' ])))
558
558
559
559
def publish (all_refs = None ):
560
560
if all_refs :
@@ -1631,14 +1631,15 @@ def deploy(ignore=False, depth=None, protocol=None, top=True):
1631
1631
# Publish command
1632
1632
@subcommand ('publish' ,
1633
1633
dict (name = ['-A' , '--all' ], dest = 'all_refs' , action = 'store_true' , help = 'Publish all branches, including new ones. Default: push only the current branch.' ),
1634
+ dict (name = ['-M' , '--message' ], dest = 'msg' , type = str , nargs = '?' , help = 'Commit message. Default: prompts for commit message.' ),
1634
1635
help = 'Publish program or library' ,
1635
1636
description = (
1636
1637
"Publishes this %s and all dependencies to their associated remote\n repository URLs.\n "
1637
1638
"This command performs various consistency checks for local uncommitted changes\n "
1638
1639
"and unpublished revisions and encourages to commit/push them.\n "
1639
1640
"Online guide about collaboration is available at:\n "
1640
1641
"www.mbed.com/collab_guide" % cwd_type ))
1641
- def publish (all_refs = None , top = True ):
1642
+ def publish (all_refs = None , msg = None , top = True ):
1642
1643
if top :
1643
1644
action ("Checking for local modifications..." )
1644
1645
@@ -1652,14 +1653,17 @@ def publish(all_refs=None, top=True):
1652
1653
if lib .check_repo ():
1653
1654
with cd (lib .path ):
1654
1655
progress ()
1655
- publish (False , all_refs )
1656
+ publish (all_refs , msg = msg , top = False )
1656
1657
1657
1658
sync (recursive = False )
1658
1659
1659
1660
if repo .dirty ():
1660
1661
action ("Uncommitted changes in %s \" %s\" in \" %s\" " % (repo .pathtype (repo .path ), repo .name , repo .path ))
1661
- raw_input ('Press enter to commit and publish: ' )
1662
- repo .commit ()
1662
+ if msg :
1663
+ repo .commit (msg )
1664
+ else :
1665
+ raw_input ('Press enter to commit and publish: ' )
1666
+ repo .commit ()
1663
1667
1664
1668
try :
1665
1669
outgoing = repo .outgoing ()
0 commit comments