forked from platformio/platformio-core
Don’t check for updates tagged VCS repo
This commit is contained in:
@ -121,7 +121,9 @@ class GitClient(VCSClientBase):
|
|||||||
for line in output.split("\n"):
|
for line in output.split("\n"):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if line.startswith("*"):
|
if line.startswith("*"):
|
||||||
return line[1:].strip()
|
branch = line[1:].strip()
|
||||||
|
if branch != "(no branch)":
|
||||||
|
return branch
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_tags(self):
|
def get_tags(self):
|
||||||
@ -158,8 +160,10 @@ class GitClient(VCSClientBase):
|
|||||||
|
|
||||||
def get_latest_revision(self):
|
def get_latest_revision(self):
|
||||||
if not self.can_be_updated:
|
if not self.can_be_updated:
|
||||||
return self.get_latest_revision()
|
return self.get_current_revision()
|
||||||
branch = self.get_current_branch()
|
branch = self.get_current_branch()
|
||||||
|
if not branch:
|
||||||
|
return self.get_current_revision()
|
||||||
result = self.get_cmd_output(["ls-remote"])
|
result = self.get_cmd_output(["ls-remote"])
|
||||||
for line in result.split("\n"):
|
for line in result.split("\n"):
|
||||||
ref_pos = line.strip().find("refs/heads/" + branch)
|
ref_pos = line.strip().find("refs/heads/" + branch)
|
||||||
|
@ -39,7 +39,7 @@ def test_global_install_registry(clirunner, validate_cliresult,
|
|||||||
result = clirunner.invoke(cmd_lib, [
|
result = clirunner.invoke(cmd_lib, [
|
||||||
"-g", "install", "58", "OneWire",
|
"-g", "install", "58", "OneWire",
|
||||||
"http://dl.platformio.org/libraries/archives/3/5174.tar.gz",
|
"http://dl.platformio.org/libraries/archives/3/5174.tar.gz",
|
||||||
"ArduinoJson@5.6.7", "ArduinoJson@>5.6"
|
"ArduinoJson@5.6.7", "ArduinoJson@~5.7.0"
|
||||||
])
|
])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
items1 = [d.basename for d in isolated_pio_home.join("lib").listdir()]
|
items1 = [d.basename for d in isolated_pio_home.join("lib").listdir()]
|
||||||
@ -106,15 +106,15 @@ def test_global_lib_update_check(clirunner, validate_cliresult,
|
|||||||
cmd_lib, ["-g", "update", "--only-check", "--json-output"])
|
cmd_lib, ["-g", "update", "--only-check", "--json-output"])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
output = json.loads(result.output)
|
output = json.loads(result.output)
|
||||||
assert set(["PJON", "RadioHead"]) == set([l['name'] for l in output])
|
assert set(["ArduinoJson", "RadioHead"]) == set(
|
||||||
|
[l['name'] for l in output])
|
||||||
|
|
||||||
|
|
||||||
def test_global_lib_update(clirunner, validate_cliresult, isolated_pio_home):
|
def test_global_lib_update(clirunner, validate_cliresult, isolated_pio_home):
|
||||||
result = clirunner.invoke(cmd_lib, ["-g", "update"])
|
result = clirunner.invoke(cmd_lib, ["-g", "update"])
|
||||||
validate_cliresult(result)
|
validate_cliresult(result)
|
||||||
assert "[Up-to-date]" in result.output
|
assert "[Up-to-date]" in result.output
|
||||||
assert re.search(r"Updating PJON\s+@ 1fb26fd\s+\[[a-z\d]{7}\]",
|
assert "Uninstalling ArduinoJson @ 5.7.3" in result.output
|
||||||
result.output)
|
|
||||||
|
|
||||||
|
|
||||||
def test_global_lib_uninstall(clirunner, validate_cliresult,
|
def test_global_lib_uninstall(clirunner, validate_cliresult,
|
||||||
|
Reference in New Issue
Block a user