Beispiel #1
0
def func(parser, options, args):
    """Clone the repository into the local dir and initialise the stack."""
    if len(args) != 2:
        parser.error('incorrect number of arguments')

    repository = args[0]
    local_dir = args[1]

    if os.path.exists(local_dir):
        raise CmdException('"%s" exists. Remove it first' % local_dir)

    clone(repository, local_dir)
    os.chdir(local_dir)
    directory = DirectoryHasRepository()
    directory.setup()
    Stack.initialise(directory.repository)
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)

    trans = transaction.StackTransaction(stack)
Beispiel #3
0
        short='Use BRANCH instead of the default branch',
    ),
    opt(
        '-m',
        '--mbox',
        action='store_true',
        short='Generate an mbox file instead of sending',
    ),
    opt(
        '--git',
        action='store_true',
        short='Use git send-email (EXPERIMENTAL)',
    ),
] + diff_opts_option()

directory = DirectoryHasRepository(log=False)
crt_series = None


def __get_sender():
    """Return the 'authname <authemail>' string as read from the
    configuration file
    """
    sender = config.get('stgit.sender')
    if not sender:
        try:
            sender = text(git.user())
        except git.GitException:
            try:
                sender = text(git.author())
            except git.GitException:
Beispiel #4
0
    ),
    opt(
        '-e',
        '--edit',
        action='store_true',
        short='Invoke an editor for the patch description',
    ),
    opt(
        '-d',
        '--showdiff',
        action='store_true',
        short='Show the patch content in the editor buffer',
    ),
] + argparse.author_options() + argparse.sign_options()

directory = DirectoryHasRepository(log=True)
crt_series = None


def __strip_patch_name(name):
    stripped = re.sub('^[0-9]+-(.*)$', r'\g<1>', name)
    stripped = re.sub(r'^(.*)\.(diff|patch)$', r'\g<1>', stripped)
    return stripped


def __replace_slashes_with_dashes(name):
    stripped = name.replace('/', '-')
    return stripped


def __create_patch(filename, message, author_name, author_email, author_date,