[PATCH 2 of 5] reporegistry: in addSubrepo(), replace unneeded use of "elif" with simple "if"

3 views
Skip to first unread message

Antonio Muci

unread,
Jun 9, 2023, 3:17:20 AM6/9/23
to thg...@googlegroups.com, a....@inwind.it
# HG changeset patch
# User Antonio Muci <a....@inwind.it>
# Date 1686294479 -7200
# Fri Jun 09 09:07:59 2023 +0200
# Node ID a5b102cb0a988b3f9e2ea2a6c8855756b462c36e
# Parent 06b166e559767ca682d376b3869fd90dfa0296a1
reporegistry: in addSubrepo(), replace unneeded use of "elif" with simple "if"

Each "elif" statement already terminated with a return: there is no need to have
a big conditional statement.

No functional changes.

diff --git a/tortoisehg/hgqt/reporegistry.py b/tortoisehg/hgqt/reporegistry.py
--- a/tortoisehg/hgqt/reporegistry.py
+++ b/tortoisehg/hgqt/reporegistry.py
@@ -630,17 +630,17 @@ class RepoRegistryView(QDockWidget):
_('%s is not a valid repository') % path,
parent=self)
return
- elif not os.path.isdir(sroot):
+ if not os.path.isdir(sroot):
qtlib.WarningMsgBox(_('Cannot add subrepository'),
_('"%s" is not a folder') % sroot,
parent=self)
return
- elif os.path.normcase(sroot) == root:
+ if os.path.normcase(sroot) == root:
qtlib.WarningMsgBox(_('Cannot add subrepository'),
_('A repository cannot be added as a subrepo of itself'),
parent=self)
return
- elif root != paths.find_root(os.path.dirname(os.path.normcase(path))):
+ if root != paths.find_root(os.path.dirname(os.path.normcase(path))):
qtlib.WarningMsgBox(_('Cannot add subrepository'),
_('The selected folder:<br><br>%s<br><br>'
'is not inside the target repository.<br><br>'

Reply all
Reply to author
Forward
0 new messages