35
35
36
36
37
37
# Application version
38
- ver = '0.7.14 '
38
+ ver = '0.7.17 '
39
39
40
40
# Default paths to Mercurial and Git
41
41
hg_cmd = 'hg'
@@ -387,8 +387,8 @@ def remove(dest):
387
387
def commit ():
388
388
popen ([hg_cmd , 'commit' ] + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
389
389
390
- def publish (all = None ):
391
- popen ([hg_cmd , 'push' ] + (['--new-branch' ] if all else []) + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
390
+ def publish (all_refs = None ):
391
+ popen ([hg_cmd , 'push' ] + (['--new-branch' ] if all_refs else []) + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
392
392
393
393
def fetch ():
394
394
log ("Fetching revisions from remote repository to \" %s\" " % os .path .basename (os .getcwd ()))
@@ -556,8 +556,8 @@ def remove(dest):
556
556
def commit ():
557
557
popen ([git_cmd , 'commit' , '-a' ] + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
558
558
559
- def publish (all = None ):
560
- if all :
559
+ def publish (all_refs = None ):
560
+ if all_refs :
561
561
popen ([git_cmd , 'push' , '--all' ] + (['-v' ] if very_verbose else ([] if verbose else ['-q' ])))
562
562
else :
563
563
remote = Git .getremote ()
@@ -637,7 +637,7 @@ def outgoing():
637
637
# Get current branch
638
638
branch = Git .getbranch ()
639
639
if not branch :
640
- # Default to "master" in detached mode
640
+ # Default to "master" in detached mode
641
641
branch = "master"
642
642
try :
643
643
# Check if remote branch exists
@@ -1630,15 +1630,15 @@ def deploy(ignore=False, depth=None, protocol=None, top=True):
1630
1630
1631
1631
# Publish command
1632
1632
@subcommand ('publish' ,
1633
- dict (name = ['-A' , '--all' ], action = 'store_true' , help = 'Publish all branches, including new ones. Default: push only the current branch.' ),
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
1634
help = 'Publish program or library' ,
1635
1635
description = (
1636
1636
"Publishes this %s and all dependencies to their associated remote\n repository URLs.\n "
1637
1637
"This command performs various consistency checks for local uncommitted changes\n "
1638
1638
"and unpublished revisions and encourages to commit/push them.\n "
1639
1639
"Online guide about collaboration is available at:\n "
1640
1640
"www.mbed.com/collab_guide" % cwd_type ))
1641
- def publish (all = None , top = True ):
1641
+ def publish (all_refs = None , top = True ):
1642
1642
if top :
1643
1643
action ("Checking for local modifications..." )
1644
1644
@@ -1652,7 +1652,7 @@ def publish(all=None, top=True):
1652
1652
if lib .check_repo ():
1653
1653
with cd (lib .path ):
1654
1654
progress ()
1655
- publish (False , all )
1655
+ publish (False , all_refs )
1656
1656
1657
1657
sync (recursive = False )
1658
1658
@@ -1665,7 +1665,7 @@ def publish(all=None, top=True):
1665
1665
outgoing = repo .outgoing ()
1666
1666
if outgoing > 0 :
1667
1667
action ("Pushing local repository \" %s\" to remote \" %s\" " % (repo .name , repo .url ))
1668
- repo .publish (all )
1668
+ repo .publish (all_refs )
1669
1669
except ProcessException as e :
1670
1670
if e [0 ] != 1 :
1671
1671
raise e
@@ -1840,14 +1840,14 @@ def sync(recursive=True, keep_refs=False, top=True):
1840
1840
1841
1841
# List command
1842
1842
@subcommand ('ls' ,
1843
- dict (name = ['-a' , '--all' ], action = 'store_true' , help = 'List repository URL and revision pairs' ),
1843
+ dict (name = ['-a' , '--all' ], dest = 'detailed' , action = 'store_true' , help = 'List repository URL and revision pairs' ),
1844
1844
dict (name = ['-I' , '--ignore' ], action = 'store_true' , help = 'Ignore errors related to missing libraries.' ),
1845
1845
help = 'View dependency tree' ,
1846
1846
description = (
1847
1847
"View the dependency tree in this %s." % cwd_type ))
1848
- def list_ (all = False , prefix = '' , p_path = None , ignore = False ):
1848
+ def list_ (detailed = False , prefix = '' , p_path = None , ignore = False ):
1849
1849
repo = Repo .fromrepo ()
1850
- print prefix + (relpath (p_path , repo .path ) if p_path else repo .name ), '(%s)' % ((repo .url + ('#' + str (repo .rev )[:12 ] if repo .rev else '' ) if all else str (repo .rev )[:12 ]) or 'no revision' )
1850
+ print prefix + (relpath (p_path , repo .path ) if p_path else repo .name ), '(%s)' % ((repo .url + ('#' + str (repo .rev )[:12 ] if repo .rev else '' ) if detailed else str (repo .rev )[:12 ]) or 'no revision' )
1851
1851
1852
1852
for i , lib in enumerate (sorted (repo .libs , key = lambda l : l .path )):
1853
1853
if prefix :
@@ -1858,7 +1858,7 @@ def list_(all=False, prefix='', p_path=None, ignore=False):
1858
1858
1859
1859
if lib .check_repo (ignore ):
1860
1860
with cd (lib .path ):
1861
- list_ (all , nprefix , repo .path , ignore = ignore )
1861
+ list_ (detailed , nprefix , repo .path , ignore = ignore )
1862
1862
1863
1863
1864
1864
# Command status for cross-SCM status of repositories
@@ -1893,7 +1893,7 @@ def status_(ignore=False):
1893
1893
dict (name = ['-S' , '--supported' ], dest = 'supported' , action = 'store_true' , help = 'Shows supported matrix of targets and toolchains' ),
1894
1894
help = 'Compile code using the mbed build tools' ,
1895
1895
description = ("Compile this program using the mbed build tools." ))
1896
- def compile (toolchain = None , mcu = None , source = False , build = False , compile_library = False , compile_config = False , config_prefix = None , compile_tests = False , clean = False , supported = False ):
1896
+ def compile_ (toolchain = None , mcu = None , source = False , build = False , compile_library = False , compile_config = False , config_prefix = None , compile_tests = False , clean = False , supported = False ):
1897
1897
# Pipe --tests to mbed tests command
1898
1898
if compile_tests :
1899
1899
return test_ (toolchain = toolchain , mcu = mcu , source = source , build = build , clean = clean , compile_only = True )
@@ -1985,15 +1985,12 @@ def test_(toolchain=None, mcu=None, compile_list=False, run_list=False, compile_
1985
1985
args = remainder
1986
1986
# Find the root of the program
1987
1987
program = Program (os .getcwd (), True )
1988
- # Remember the original path. this is needed for compiling only the libraries and tests for the current folder.
1989
- orig_path = os .getcwd ()
1990
1988
1991
1989
target = program .get_mcu (mcu )
1992
1990
tchain = program .get_toolchain (toolchain )
1993
1991
macros = program .get_macros ()
1994
1992
tools_dir = program .get_tools ()
1995
1993
build_and_run_tests = not compile_list and not run_list and not compile_only and not run_only
1996
- relative_orig_path = os .path .relpath (orig_path , program .path )
1997
1994
1998
1995
# Prepare environment variables
1999
1996
env = program .get_env ()
@@ -2006,17 +2003,17 @@ def test_(toolchain=None, mcu=None, compile_list=False, run_list=False, compile_
2006
2003
# Setup the build path if not specified
2007
2004
if not build :
2008
2005
build = os .path .join (program .path , '.build/tests' , target , tchain )
2009
-
2006
+
2010
2007
# Create the path to the test spec file
2011
2008
test_spec = os .path .join (build , 'test_spec.json' )
2012
-
2009
+
2013
2010
if compile_list :
2014
2011
popen (['python' , '-u' , os .path .join (tools_dir , 'test.py' ), '--list' ]
2015
2012
+ (['-n' , tests_by_name ] if tests_by_name else [])
2016
2013
+ (['-v' ] if verbose else [])
2017
2014
+ args ,
2018
2015
env = env )
2019
-
2016
+
2020
2017
if compile_only or build_and_run_tests :
2021
2018
popen (['python' , '-u' , os .path .join (tools_dir , 'test.py' )]
2022
2019
+ list (chain .from_iterable (izip (repeat ('-D' ), macros )))
@@ -2029,14 +2026,14 @@ def test_(toolchain=None, mcu=None, compile_list=False, run_list=False, compile_
2029
2026
+ (['-v' ] if verbose else [])
2030
2027
+ args ,
2031
2028
env = env )
2032
-
2029
+
2033
2030
if run_list :
2034
2031
popen (['mbedgt' , '--test-spec' , test_spec , '--list' ]
2035
2032
+ (['-n' , tests_by_name ] if tests_by_name else [])
2036
2033
+ (['-V' ] if verbose else [])
2037
2034
+ args ,
2038
2035
env = env )
2039
-
2036
+
2040
2037
if run_only or build_and_run_tests :
2041
2038
popen (['mbedgt' , '--test-spec' , test_spec ]
2042
2039
+ (['-n' , tests_by_name ] if tests_by_name else [])
0 commit comments