-
Notifications
You must be signed in to change notification settings - Fork 989
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
Avoid warning message from SVN check function #4264
Conversation
…n the output (suggested by @ahauan4)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure but, Is it possible to add a test to this?
@danimtb, I've added a test specific to this function (not actually related to the output warning message). I don't know if, after returning from the command I can read the previous output to check that there is no such message. If you have some idea, please tell me: def test_check_svn_repo(self):
project_url, _ = self.create_project(files={'myfile': "contents"})
tmp_folder = self.gimme_tmp()
svn = SVN(folder=tmp_folder)
with self.assertRaisesRegexp(ConanException, "Not a valid SVN repository"):
svn._check_svn_repo()
# --->> Get the output and check that there isn't a warning message there ¿?
svn.checkout(url=project_url)
try:
svn._check_svn_repo()
except Exception:
self.fail("After checking out, it should be a valid SVN repository") |
yes, is the only way to do it properly I think 👍 |
Please, review again, maybe it is time to get some ✅ s. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, take a look to the detect_repo_type
also in the scm module (model). I introduced it to decouple the revisions with the scm feature. We should integrate both solutions.
def detect_repo_type(folder):
if not folder:
return None
def _run_command_ignore_output(cmd):
with chdir(folder):
try:
ret = subprocess.call(cmd, shell=True,
stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT)
if ret != 0:
return False
except Exception:
return False
return True
if _run_command_ignore_output("git status"):
return "git"
elif _run_command_ignore_output("svn info"):
return "svn"
return None
…detect_repo_type (moved to SCM.detect_repo)
@lasote , take a look at the reengineering of the |
Changelog: Fix: Avoid warning message (shown in console output) when running the SVN check outside a SVN repository
Docs: Omit
Implementation proposed by @ahauan4 in #3831 (comment)
@tags: svn