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

Show error when the user tries neo.py update in a detached HEAD state... #60

Merged
merged 8 commits into from
Apr 13, 2016
Merged

Conversation

screamerbg
Copy link
Contributor

...and encourage to manually switch to a branch (gits behavior in detached state)

Fixed issue #58 and also allow keeping of orphaned references (.lib without clone repo) during update to allow import behavior

@geky
Copy link
Contributor

geky commented Apr 12, 2016

+1 from me

@screamerbg
Copy link
Contributor Author

@bogdanm ?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 13, 2016

I tested this for #56 and #58 issues, both fixed with this patch.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 13, 2016

One regression I found, use-case update running on not yet deployed mbed-os:

Without this patch:

python C:\Code\git_repo\github\neo\neo.py update
[neo.py] Working path "C:\2" (program)
[neo.py] Synchronizing dependency references...
[neo.py] Remove reference "mbed-os" -> "https://github.com/ARMmbed/mbed-os.git/#7996649d966f"
[neo.py] Removing C:\2\mbed-os.lib
[neo.py] "git rm -f C:\2\mbed-os.lib"
fatal: pathspec 'C:\2\mbed-os.lib' did not match any files
[neo.py] Fetching remote repository "2" to local "2" and updating to latest revision in the current branch
[neo.py] "git pull -v --all"
You asked to pull from the remote '--all', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
[neo.py ERROR] Subrocess exit with error code 1
---

with this patch, traceback:

python neo.py update
[neo.py] Working path "C:\2" (program)
[neo.py] Synchronizing dependency references...
Traceback (most recent call last):
  File "C:\Code\git_repo\github\neo\neo.py", line 1114, in <module>
    status = args.command(args)
  File "C:\Code\git_repo\github\neo\neo.py", line 688, in thunk
    return command(**argv)
  File "C:\Code\git_repo\github\neo\neo.py", line 862, in update
    sync(keep_refs=True)
  File "C:\Code\git_repo\github\neo\neo.py", line 964, in sync
    with cd(lib.path):
  File "C:\Python27\lib\contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "C:\Code\git_repo\github\neo\neo.py", line 164, in cd
    os.chdir(newdir)
WindowsError: [Error 2] The system cannot find the file specified: 'C:\\2\\mbed-os'

Should update run deploy if we know that the lib was not yet deployed, or just print an error to run deploy first prior update (not all libraries are deployed).

@screamerbg
Copy link
Contributor Author

This should be now fixed. Thanks for the bug report

@screamerbg screamerbg merged commit f1082d7 into ARMmbed:master Apr 13, 2016
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