Skip to content

0.8.1 EPR fixes #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@


# Application version
ver = '0.8.0'
ver = '0.8.1'

# Default paths to Mercurial and Git
hg_cmd = 'hg'
Expand Down Expand Up @@ -688,7 +688,10 @@ def getrev():

# Gets current branch or returns empty string if detached
def getbranch():
branch = pquery([git_cmd, 'rev-parse', '--symbolic-full-name', '--abbrev-ref', 'HEAD']).strip()
try:
branch = pquery([git_cmd, 'rev-parse', '--symbolic-full-name', '--abbrev-ref', 'HEAD']).strip()
except ProcessException:
branch = "master"
return branch if branch != "HEAD" else ""

# Finds refs (local or remote branches). Will match rev if specified
Expand Down Expand Up @@ -1023,10 +1026,12 @@ def write(self):
#print self.name, 'unmodified'
return

action("Updating reference \"%s\" -> \"%s\"" % (relpath(cwd_root, self.path) if cwd_root != self.path else self.name, self.fullurl))

ref = (formaturl(self.url, 'https').rstrip('/') + '/' +
(('' if self.is_build else '#') +
self.rev if self.rev else ''))
action("Updating reference \"%s\" -> \"%s\"" % (relpath(cwd_root, self.path) if cwd_root != self.path else self.name, ref))
with open(self.lib, 'wb') as f:
f.write(self.fullurl + '\n')
f.write(ref + '\n')

def rm_untracked(self):
untracked = self.scm.untracked()
Expand Down Expand Up @@ -1365,17 +1370,17 @@ def formaturl(url, format="default"):
url = 'ssh://%s/%s.git' % (m.group(2), m.group(3))
elif format == "http":
url = 'http://%s/%s' % (m.group(2), m.group(3))
else:
url = 'https://%s/%s' % (m.group(2), m.group(3)) # https is default
elif format == "https":
url = 'https://%s/%s' % (m.group(2), m.group(3))
else:
m = re.match(regex_hg_url, url)
if m:
if format == "ssh":
url = 'ssh://%s/%s' % (m.group(2), m.group(3))
elif format == "http":
url = 'http://%s/%s' % (m.group(2), m.group(3))
else:
url = 'https://%s/%s' % (m.group(2), m.group(3)) # https is default
elif format == "https":
url = 'https://%s/%s' % (m.group(2), m.group(3))
return url


Expand Down Expand Up @@ -2177,18 +2182,27 @@ def config_(var, value=None, global_cfg=False, unset=False):
@subcommand('target',
dict(name='name', nargs='?', help='Default target name. Example: K64F, NUCLEO_F401RE, NRF51822...'),
dict(name=['-G', '--global'], dest='global_cfg', action='store_true', help='Use global settings, not local'),
dict(name=['-S', '--supported'], dest='supported', action='store_true', help='Shows supported matrix of targets and toolchains'),
help='Set or get default target',
description=(
"This is an alias to 'mbed config target [--global] [name]'\n"))
def target_(name=None, global_cfg=False):
"Set or get default toolchain\n"
"This is an alias to 'mbed config [--global] target [name]'\n"))
def target_(name=None, global_cfg=False, supported=False):
if supported:
return compile_(supported=supported)
return config_('target', name, global_cfg=global_cfg)

@subcommand('toolchain',
dict(name='name', nargs='?', help='Default toolchain name. Example: ARM, uARM, GCC_ARM, IAR'),
dict(name=['-G', '--global'], dest='global_cfg', action='store_true', help='Use global settings, not local'),
dict(name=['-S', '--supported'], dest='supported', action='store_true', help='Shows supported matrix of targets and toolchains'),
help='Set or get default toolchain\n\n',
description=(
"This is an alias to 'mbed config toolchain [--global] [name]'\n"))
def toolchain_(name=None, global_cfg=False):
"Set or get default toolchain\n"
"This is an alias to 'mbed config [--global] toolchain [name]'\n"))
def toolchain_(name=None, global_cfg=False, supported=False):
if supported:
return compile_(supported=supported)
return config_('toolchain', name, global_cfg=global_cfg)

@subcommand('help',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def read(fname):
setup(
name="mbed-cli",
packages=["mbed"],
version="0.8.0",
version="0.8.1",
url='http://github.com/ARMmbed/mbed-cli',
author='ARM mbed',
author_email='[email protected]',
Expand Down