#1 Open

Fix for issue #164.

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab. You can then either decline the request or merge it manually on your local system using the following commands:

hg update default
hg merge 33bdef55a31c
hg commit -m 'Merged in issue_164 (pull request #1)'
  1. croach avatarcroach

This pull request fixes a bug in cdproject where it would error out if the project directory path had a space in it.

Comments (2)

  1. croach author

    Hi Doug,

    Two things. First, this problem is only a problem for the Z-shell (which I use as my main shell). It actually doesn't show up in the bash and korn shells at all.

    Second, I looked into adding a test and noticed that there was already one in test_project_cd.sh called test_space_in_path that does exactly what I need. The reason it didn't catch the problem was that when the typeset command in the cdproject call failed, it would actually exit back out of the test function completely bypassing the call to assert and making it appear as if the test executed properly. To remedy this I had to call the test code in a subshell to capture the success/failure of the call to cdproject. So now if we're testing in the z-shell, if the subshell exits with an error, we capture it and report appropriately, if, however, we're in one of the other shells, we manually capture the success/failure and return it from the subshell.

    It sounds a bit convoluted, but it works. Running the tests for all shells seems to work just fine now.

    Let me know if you have any questions or need more clarification of my explanation above. I've updated the pull request with the new test, so everything should be good to go.


Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.