#! /usr/bin/env python
"""
Generates a patch and interdiff from an existing patch that needs changes."""
from gitCmds import GitRepo
import os
import sys
import glob

git = GitRepo(os.getcwd())

# Check if we're in new_patch branch and if old_patch exists
if not git.check_old_new_correct():
    print "Something is wrong with the branches, are you on new_patch? Exiting."
    sys.exit(1)

# Make sure before commit that old_patch and new_patch diff is zero.
if not git.diff('old_patch') == '':
    print "Something is wrong : the new_patch HEAD and old_patch are different"

print "Committing changes to new_patch"
git.commit('New Patch')

for patch_filename in glob.glob('*.patch'):
    print patch_filename

# Input block
issue_no = raw_input("Enter The Issue #: ")
issue_slug = raw_input("Enter The Issue Slug: ")
arch_extra_info = raw_input("Enter The Arch/Extra Info: ")
old_patch_no = raw_input("Enter The Old Patch Comment #: ")
new_patch_no = raw_input("Enter The New Patch Comment #: ")
#! /usr/bin/env python
"""
Automates updating a patch."""
from gitCmds import GitRepo
import utilityFunctions as utilityFunctions
import os
import sys

if not len(sys.argv) > 1:
    print "Please specify a Drupal.org patch URL"
    sys.exit(1)

git = GitRepo(os.getcwd())
git.cleanup()
patch_filename = utilityFunctions.download_patch(sys.argv[1])

git.checkout(branch='old_patch', is_new_branch=True)
git.apply_patch(patch_filename)
git.commit('Old Patch')

git.checkout(branch='new_patch', is_new_branch=True)
utilityFunctions.open_diff_files_phpstorm(git.git_dir, patch_filename)
print "Ready for development in new_patch. git add new changes and run generateNewPatch.py when done."
#! /usr/bin/env python
"""
Automates the repetitive parts of rerolling a patch."""
from gitCmds import GitRepo
import os
import sys
import utilityFunctions as utilityFunctions

if not len(sys.argv) > 1:
    print "Please specify a Drupal.org patch URL"
    sys.exit(1)

yes_values_list = {'yes', 'y', 'ye', ''}

git = GitRepo(os.getcwd())
git.cleanup()
print "Downloading patch..."
patch_filename = utilityFunctions.download_patch(sys.argv[1])
print "Attempting to apply patch..."
patch_result_output = git.patch(patch_filename, dry_run=True)
print patch_result_output

if 'patch failed:' in patch_result_output or 'error: ' in patch_result_output:
    print "Patch does not apply cleanly!"
    print "Checking if patch applies cleanly at post date..."
    patch_date = raw_input("Enter the patch date: ")
    hash_to_checkout = git.get_dated_commit_hash(patch_date)
    print "Looks like " + hash_to_checkout + ' is the commit we need to roll back to...'
    project_string = raw_input("Enter a project string for branch: ")
    git.checkout(
        branch=project_string,
#! /usr/bin/env python
"""
Automates updating a patch."""
from gitCmds import GitRepo
import utilityFunctions as utilityFunctions
import os
import sys

if not len(sys.argv) > 1:
    print "Please specify a Drupal.org patch URL"
    sys.exit(1)

git = GitRepo(os.getcwd())
git.cleanup()
patch_filename = utilityFunctions.download_patch(sys.argv[1])

git.checkout(branch = 'old_patch', is_new_branch=True)
git.apply_patch(patch_filename)
git.commit('Old Patch')

git.checkout(branch='new_patch', is_new_branch=True)
utilityFunctions.open_diff_files_phpstorm(git.git_dir, patch_filename)
print "Ready for development in new_patch. git add new changes and run generateNewPatch.py when done."
Beispiel #5
0
#! /usr/bin/env python
"""
Generates a patch and interdiff from a repository after updating a patch."""
from gitCmds import GitRepo
import os


git = GitRepo(os.getcwd())
new_patch_filename = raw_input("Enter Patch Filename #: ")
git.diff('8.0.x', output_to_file=new_patch_filename)
#! /usr/bin/env python
"""
Generates a patch and interdiff from an existing patch that needs changes."""
from gitCmds import GitRepo
import os
import sys
import glob

git = GitRepo(os.getcwd())

# Check if we're in new_patch branch and if old_patch exists
if not git.check_old_new_correct():
    print "Something is wrong with the branches, are you on new_patch? Exiting."
    sys.exit(1)

# Make sure before commit that old_patch and new_patch diff is zero.
if not git.diff('old_patch') == '':
    print "Something is wrong : the new_patch HEAD and old_patch are different"

print "Committing changes to new_patch"
git.commit('New Patch')

for patch_filename in glob.glob('*.patch'):
    print patch_filename

# Input block
issue_no = raw_input("Enter The Issue #: ")
issue_slug = raw_input("Enter The Issue Slug: ")
arch_extra_info = raw_input("Enter The Arch/Extra Info: ")
old_patch_no = raw_input("Enter The Old Patch Comment #: ")
new_patch_no = raw_input("Enter The New Patch Comment #: ")
Beispiel #7
0
#! /usr/bin/env python
"""
Automates the repetitive parts of rerolling a patch."""
from gitCmds import GitRepo
import os
import sys
import utilityFunctions as utilityFunctions

if not len(sys.argv) > 1:
    print "Please specify a Drupal.org patch URL"
    sys.exit(1)

yes_values_list = {'yes', 'y', 'ye', ''}

git = GitRepo(os.getcwd())
git.cleanup()
print "Downloading patch..."
patch_filename = utilityFunctions.download_patch(sys.argv[1])
print "Attempting to apply patch..."
patch_result_output = git.patch(patch_filename, dry_run=True)
print patch_result_output

if 'patch failed:' in patch_result_output or 'error: ' in patch_result_output:
    print "Patch does not apply cleanly!"
    print "Checking if patch applies cleanly at post date..."
    patch_date = raw_input("Enter the patch date: ")
    hash_to_checkout = git.get_dated_commit_hash(patch_date)
    print "Looks like " + hash_to_checkout + ' is the commit we need to roll back to...'
    project_string = raw_input("Enter a project string for branch: ")
    git.checkout(branch=project_string,
                 is_new_branch=True,