"""
import logging
-from lib import tools, css
+from lib import tools, css, jira
from lib.command import Command
from lib.tools import yesOrNo
}
),
(
+ ['--patch'],
+ {
+ 'action': 'store_true',
+ 'dest': 'patch',
+ 'help': 'instead of pushing to a remote, this will upload a patch file to the tracker. Security issues use this by default if --push is set. This option discards most other flags.',
+ }
+ ),
+ (
['-t', '--update-tracker'],
{
'const': True,
suffix = parsedbranch['suffix']
version = parsedbranch['version']
+ if args.push and not args.patch:
+ mdlIssue = 'MDL-%s' % (issue)
+ J = jira.Jira()
+ args.patch = J.isSecurityIssue(mdlIssue)
+ args.push = False
+ if args.patch:
+ logging.info('%s appears to be a security issue, switching to patch mode...' % (mdlIssue))
+
# Original track
originaltrack = tools.stableBranch(version)
ref = None if args.updatetracker == True else args.updatetracker
M2.updateTrackerGitInfo(branch=newbranch, ref=ref)
+ elif args.patch:
+ if not M2.pushPatch(newbranch):
+ continue
+
stashPop(stash)
logging.info('Instance %s successfully patched!' % name)
mdlIssue = 'MDL-%s' % (parsedbranch['issue'])
args.patch = J.isSecurityIssue(mdlIssue)
if args.patch:
- logging.info('%s appears to be a security issue, attempting to upload a patch...' % (mdlIssue))
+ logging.info('%s appears to be a security issue, switching to patch mode...' % (mdlIssue))
if args.patch:
if not M.pushPatch(branch):
headcommit = self.headcommit(branch)
# Creating a patch file.
- fileName = branch + '-mdk' + '.patch'
+ fileName = branch + '.mdk.patch'
tmpPatchFile = os.path.join(gettempdir(), fileName)
if self.git().createPatch('%s...%s' % (headcommit, branch), saveTo=tmpPatchFile):