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

Add get_repo_root to SCM, use it for path stored in scm_folder.txt (close #3465) #3479

Merged
merged 5 commits into from Sep 6, 2018

Conversation

@jgsogo
Copy link
Member

@jgsogo jgsogo commented Sep 4, 2018

  • Refer to the issue that supports this Pull Request. (close #3465)
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • Add tests

Changelog: Bugfix: The scm feature now looks for the repo root even when the conanfile.py is in a subfolder.

danimtb
danimtb approved these changes Sep 6, 2018
"""
curdir = self.client.current_folder
conanfile = base.format(url="auto", revision="auto")
self.client.save({"conanfile.py": conanfile},
Copy link
Contributor

@lasote lasote Sep 6, 2018

You can run self.client.save({"conan/conanfile.py": conanfile})

Copy link
Contributor

@lasote lasote Sep 6, 2018

And mix with "myfile.txt" save for clarity.

Copy link
Member Author

@jgsogo jgsogo Sep 6, 2018

much better, didn't thought about that 🙃

# Create the package
self.client.run("create conan/ user/channel")
sources_dir = self.client.client_cache.scm_folder(self.reference)
self.assertEquals(load(sources_dir), curdir.replace('\\', '/')) # Root of git is 'curdir'
Copy link
Contributor

@lasote lasote Sep 6, 2018

load of a directory??

Copy link
Member Author

@jgsogo jgsogo Sep 6, 2018

scm_folder is the name given by Conan to the scm_folder.txt file, I agree with you that it may not be the best one.

@lasote lasote added this to the 1.8 milestone Sep 6, 2018
lasote
lasote approved these changes Sep 6, 2018
@memsharded memsharded merged commit db62db2 into conan-io:develop Sep 6, 2018
2 checks passed
@ghost ghost removed the stage: review label Sep 6, 2018
@jgsogo jgsogo deleted the issue/3465 branch Sep 19, 2018
grisumbras pushed a commit to grisumbras/conan that referenced this issue Dec 27, 2018
Add get_repo_root to SCM, use it for path stored in scm_folder.txt (close conan-io#3465)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants