Skip to content
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

scm: fix new command only use hg to clone code #810

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinong0108
Copy link

add check is hg file exist or not to avoid never try to use git.
But this patch maybe only for python 3.x

add check is hg file exist or not.
@theotherjimmy
Copy link
Contributor

@kevinong0108 How is this any different from attempting to run hg and failing with almost the same error?

@kevinong0108
Copy link
Author

@theotherjimmy it will break when hg clone mbed-os failed, so it never try to use git. (Windows environment)

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but only changes the clone method. Any other command on any other SCM can fail in the same way. Further, this makes the clone method aware that hg may not be installed. Instead, could we make all subprocess invocations fail with ProcessException when the command is not found or skip hg entirely (with a warning) when it's executable is not found?

@kevinong0108
Copy link
Author

@theotherjimmy
If the repository is cloned, the mbed-cli will use correct tool. The problem happened on clone only for me.
And there is no rule for hg clone fail, so here use ProcessException to notify upper try and catch.

@theotherjimmy
Copy link
Contributor

@kevinong0108 Mbed CLI is not the only way to clone a repo. Please update the PR with the proposed changes.

@bridadan
Copy link
Contributor

This PR will need a rebase to bring in the fixes for the Circle CI configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants