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
Contributor

@jgsogo jgsogo commented Sep 4, 2018

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

"""
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

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

load of a directory??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
@memsharded memsharded merged commit db62db2 into conan-io:develop Sep 6, 2018
@ghost ghost removed the stage: review label Sep 6, 2018
@jgsogo jgsogo deleted the issue/3465 branch September 19, 2018 12:20
grisumbras pushed a commit to grisumbras/conan that referenced this pull request 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
Development

Successfully merging this pull request may close these issues.

[SCM] SCM feature + recipe in a repo subfolder leads to "same computer clone" bug
4 participants