mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-28 22:49:00 +00:00
[PR #11119/41923e43 backport][stable-12] fix ruff case SIM103 (#11132)
fix ruff case SIM103 (#11119)
* fix ruff case SIM103
* add changelog frag
(cherry picked from commit 41923e43bd)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
ac6c6df2c7
commit
93d23cfef6
39 changed files with 115 additions and 230 deletions
|
|
@ -134,10 +134,7 @@ class Hg:
|
|||
|
||||
def has_local_mods(self):
|
||||
now = self.get_revision()
|
||||
if "+" in now:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return "+" in now
|
||||
|
||||
def discard(self):
|
||||
before = self.has_local_mods()
|
||||
|
|
@ -177,10 +174,7 @@ class Hg:
|
|||
discarded = self.discard()
|
||||
if purge:
|
||||
purged = self.purge()
|
||||
if discarded or purged:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return discarded or purged
|
||||
|
||||
def pull(self):
|
||||
return self._command(["pull", "-R", self.dest, self.repo])
|
||||
|
|
@ -207,9 +201,7 @@ class Hg:
|
|||
(rc, out, err) = self._command(["--debug", "id", "-i", "-R", self.dest])
|
||||
if rc != 0:
|
||||
self.module.fail_json(msg=err)
|
||||
if out.startswith(self.revision):
|
||||
return True
|
||||
return False
|
||||
return out.startswith(self.revision)
|
||||
|
||||
|
||||
# ===========================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue