MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, see http://www.gnu.org/licenses/.
"""

help = 'Push or pop patches to the given one'
kind = 'stack'
usage = ['[options] [--] <patch-name>']
description = """
Push/pop patches to/from the stack until the one given on the command
line becomes current."""

args = ['other_applied_patches', 'unapplied_patches']
options = argparse.keep_option() + argparse.merged_option()

directory = DirectoryHasRepository()


def func(parser, options, args):
    if len(args) != 1:
        parser.error('incorrect number of arguments')
    name = args[0]

    stack = directory.repository.current_stack
    iw = stack.repository.default_iw

    check_head_top_equal(stack)
    if not options.keep:
        check_index_and_worktree_clean(stack)
Beispiel #2
0
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, see http://www.gnu.org/licenses/.
"""

help = 'Push or pop patches to the given one'
kind = 'stack'
usage = ['[options] [--] <patch-name>']
description = """
Push/pop patches to/from the stack until the one given on the command
line becomes current."""

args = [argparse.other_applied_patches, argparse.unapplied_patches]
options = argparse.keep_option() + argparse.merged_option()

directory = common.DirectoryHasRepositoryLib()

def func(parser, options, args):
    if len(args) != 1:
        parser.error('incorrect number of arguments')
    patch = args[0]

    stack = directory.repository.current_stack
    iw = stack.repository.default_iw
    clean_iw = (not options.keep and iw) or None
    trans = transaction.StackTransaction(stack, 'goto',
                                         check_clean_iw = clean_iw)

    if patch not in trans.all_patches:
Beispiel #3
0
            action='store_true',
            short='Push the patch with the original tree',
            long="""
        Push the patches, but don't perform a merge. Instead, the
        resulting tree will be identical to the tree that the patch
        previously created.

        This can be useful when splitting a patch by first popping the
        patch and creating a new patch with some of the
        changes. Pushing the original patch with '--set-tree' will
        avoid conflicts and only the remaining changes will be in the
        patch.""",
        ),
    ]
    + keep_option()
    + merged_option()
)

directory = DirectoryHasRepository()


def func(parser, options, args):
    """Pushes the given patches or the first unapplied onto the stack."""
    stack = directory.repository.current_stack
    iw = stack.repository.default_iw
    clean_iw = (not options.keep and iw) or None
    trans = transaction.StackTransaction(stack, 'push', check_clean_iw=clean_iw)

    if options.number == 0:
        # explicitly allow this without any warning/error message
        return
Beispiel #4
0
    opt(
        '--set-tree',
        action='store_true',
        short='Push the patch with the original tree',
        long="""
        Push the patches, but don't perform a merge. Instead, the
        resulting tree will be identical to the tree that the patch
        previously created.

        This can be useful when splitting a patch by first popping the
        patch and creating a new patch with some of the
        changes. Pushing the original patch with '--set-tree' will
        avoid conflicts and only the remaining changes will be in the
        patch.""",
    ),
] + keep_option() + merged_option())

directory = DirectoryHasRepository()


def func(parser, options, args):
    """Pushes the given patches or the first unapplied onto the stack."""
    stack = directory.repository.current_stack
    iw = stack.repository.default_iw
    clean_iw = (not options.keep and iw) or None
    trans = transaction.StackTransaction(stack,
                                         'push',
                                         check_clean_iw=clean_iw)

    if options.number == 0:
        # explicitly allow this without any warning/error message
        action='store_true',
        short='Push the patch with the original tree',
        long="""
        Push the patches, but don't perform a merge. Instead, the
        resulting tree will be identical to the tree that the patch
        previously created.

        This can be useful when splitting a patch by first popping the
        patch and creating a new patch with some of the
        changes. Pushing the original patch with '--set-tree' will
        avoid conflicts and only the remaining changes will be in the
        patch.""",
    ),
]
options.extend(keep_option())
options.extend(merged_option())

directory = DirectoryHasRepository()


def func(parser, options, args):
    """Pushes the given patches or the first unapplied onto the stack."""
    stack = directory.repository.current_stack
    iw = stack.repository.default_iw

    if options.number == 0:
        # explicitly allow this without any warning/error message
        return

    if not stack.patchorder.unapplied:
        raise CmdException('No patches to push')