Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mdk/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class Bunch:

# Wording version
versionNice = version
if version in ['master', 'main']:
if version in ['main']:
versionNice = self.C.get('wording.master')

# Generating names
Expand Down
2 changes: 1 addition & 1 deletion mdk/commands/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def run(self, args):

stablebranch = M.get('stablebranch')
masterbranch = ''
if stablebranch in ['master', 'main']:
if stablebranch in ['main']:
# Generate a branch name for master to check later whether there's already an existing working branch.
masterbranch = M.generateBranchName(args.issue, args.suffix, 'master')

Expand Down
2 changes: 1 addition & 1 deletion mdk/commands/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def download(self, M, args):
return False

branch = M.get('branch')
if branch in ['master', 'main']:
if branch in ['main']:
branch = C.get('masterBranch')
branch = int(branch)

Expand Down
2 changes: 1 addition & 1 deletion mdk/commands/rebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def run(self, args):
# Looping over each issue to rebase
for issue in issues:
branch = M.generateBranchName(issue, suffix=args.suffix)
if M.get('stablebranch') in ['master', 'main']:
if M.get('stablebranch') in ['main']:
masterbranch = M.generateBranchName(issue, args.suffix, 'master')
if M.git().hasBranch(masterbranch):
prompt = (
Expand Down
2 changes: 1 addition & 1 deletion mdk/moodle.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def _load(self):
self.version['branch'] = 'main'

# Stable branch
self.version['stablebranch'] = stableBranch(self.version['branch'], self.git())
self.version['stablebranch'] = stableBranch(self.version['branch'])

# Integration or stable?
self.version['integration'] = self.isIntegration()
Expand Down
6 changes: 3 additions & 3 deletions mdk/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
return [int(text) if text.isdigit() else text.lower() for text in _nsre.split(s)]


def stableBranch(version, git=None):
if version in ['master', 'main']:
def stableBranch(version):
if version in ['main']:
return 'main'
return 'MOODLE_%d_STABLE' % int(version)

Expand All @@ -240,7 +240,7 @@ def version_options():
return ([str(x) for x in range(13, 40)]
+ [str(x) for x in range(310, 312)]
+ [str(x) for x in range(400, C.get('masterBranch'))]
+ ['master', 'main'])
+ ['main'])

class ProcessInThread(threading.Thread):
"""Executes a process in a separate thread"""
Expand Down
2 changes: 1 addition & 1 deletion mdk/workplace.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def create(self, name=None, version='main', integration=False, useCacheAsRemote=
# Update the cached clones.
self.updateCachedClones(stable=not integration, integration=integration, verbose=False)

branch = stableBranch(version, git.Git(self.getCachedRemote(integration), C.get('git')))
branch = stableBranch(version)

useCacheAsUpstream = C.get('useCacheAsUpstreamRemote')
cloneAsShared = useCacheAsUpstream and C.get('useCacheAsSharedClone')
Expand Down