opt('-a', '--annotate', metavar='NOTE', short='Annotate the patch log entry',), opt( '-s', '--submodules', action='store_true', short='Include submodules when refreshing patch contents', ), opt( '--no-submodules', action='store_false', dest='submodules', short='Exclude submodules when refreshing patch contents', ), ] + ( argparse.message_options(save_template=False) + argparse.hook_options() + argparse.sign_options() + argparse.author_options() ) ) directory = DirectoryHasRepository() def get_patch(stack, given_patch): """Get the name of the patch we are to refresh.""" if given_patch: patch_name = given_patch if not stack.patches.exists(patch_name): raise CmdException('%s: no such patch' % patch_name)
short='Annotate the patch log entry', ), opt( '-s', '--submodules', action='store_true', short='Include submodules when refreshing patch contents', ), opt( '', '--no-submodules', action='store_false', dest='submodules', short='Exclude submodules when refreshing patch contents', ) ] + (argparse.message_options(save_template=False) + argparse.hook_options() + argparse.sign_options() + argparse.author_options()) directory = common.DirectoryHasRepositoryLib() def get_patch(stack, given_patch): """Get the name of the patch we are to refresh.""" if given_patch: patch_name = given_patch if not stack.patches.exists(patch_name): raise common.CmdException('%s: no such patch' % patch_name) return patch_name else: if not stack.patchorder.applied: raise common.CmdException(
editor.""" args = [] options = [ opt( '-v', '--verbose', action='store_true', short='show diff in patch commit message template', long=''' In addition to the names of files that have been changed, also show a diff of staged and unstaged changes.''', ), ] options.extend(argparse.author_options()) options.extend(argparse.message_options(save_template=True)) options.extend(argparse.trailer_options()) options.extend(argparse.hook_options()) directory = DirectoryHasRepository() def func(parser, options, args): """Create a new patch.""" stack = directory.repository.current_stack if stack.repository.default_index.conflicts(): raise CmdException( 'Cannot create a new patch -- resolve conflicts first') # Choose a name for the new patch -- or None, which means make one # up later when we've gotten hold of the commit message.
action="store_true", short="Refresh from index instead of worktree", long=""" Instead of setting the patch top to the current contents of the worktree, set it to the current contents of the index.""", ), opt( "-p", "--patch", args=[argparse.other_applied_patches, argparse.unapplied_patches], short="Refresh (applied) PATCH instead of the top patch", ), opt("-e", "--edit", action="store_true", short="Invoke an editor for the patch description"), opt("-a", "--annotate", metavar="NOTE", short="Annotate the patch log entry"), ] + (argparse.message_options(save_template=False) + argparse.sign_options() + argparse.author_options()) ) directory = common.DirectoryHasRepositoryLib() def get_patch(stack, given_patch): """Get the name of the patch we are to refresh.""" if given_patch: patch_name = given_patch if not stack.patches.exists(patch_name): raise common.CmdException("%s: no such patch" % patch_name) return patch_name else: if not stack.patchorder.applied: raise common.CmdException("Cannot refresh top patch, because no patches are applied")
created on top of the currently applied patches, and is made the new top of the stack. Uncommitted changes in the work tree are not included in the patch -- that is handled by linkstg:refresh[]. The given name must be unique in the stack, and may only contain alphanumeric characters, dashes and underscores. If no name is given, one is generated from the first line of the patch's commit message. An editor will be launched to edit the commit message to be used for the patch, unless the '--message' flag already specified one. The 'patchdescr.tmpl' template file (if available) is used to pre-fill the editor.""" args = [] options = (argparse.author_options() + argparse.message_options(save_template=True) + argparse.sign_options() + argparse.hook_options()) directory = DirectoryHasRepository() def func(parser, options, args): """Create a new patch.""" stack = directory.repository.current_stack if stack.repository.default_index.conflicts(): raise CmdException( 'Cannot create a new patch -- resolve conflicts first') # Choose a name for the new patch -- or None, which means make one # up later when we've gotten hold of the commit message. if len(args) == 0:
created on top of the currently applied patches, and is made the new top of the stack. Uncommitted changes in the work tree are not included in the patch -- that is handled by linkstg:refresh[]. The given name must be unique in the stack, and may only contain alphanumeric characters, dashes and underscores. If no name is given, one is generated from the first line of the patch's commit message. An editor will be launched to edit the commit message to be used for the patch, unless the '--message' flag already specified one. The 'patchdescr.tmpl' template file (if available) is used to pre-fill the editor.""" args = [] options = (argparse.author_options() + argparse.message_options(save_template = True) + argparse.sign_options()) directory = common.DirectoryHasRepositoryLib() def func(parser, options, args): """Create a new patch.""" stack = directory.repository.current_stack if stack.repository.default_index.conflicts(): raise common.CmdException( 'Cannot create a new patch -- resolve conflicts first') # Choose a name for the new patch -- or None, which means make one # up later when we've gotten hold of the commit message. if len(args) == 0: name = None
TREE-ISH without changing the tree of any other patches. When used on the top patch, the index and work tree will be updated to match the tree. This low-level option is primarily meant to be used by tools built on top of StGit, such as the Emacs mode. See also the --set-tree flag of stg push.""" args = ['applied_patches', 'unapplied_patches', 'hidden_patches'] options = ([ opt('-d', '--diff', action='store_true', short='Edit the patch diff'), opt( '-e', '--edit', action='store_true', short='Invoke interactive editor', ), ] + argparse.sign_options() + argparse.message_options(save_template=True) + argparse.hook_options() + argparse.author_options() + argparse.diff_opts_option() + [ opt( '-t', '--set-tree', action='store', metavar='TREE-ISH', short='Set the git tree of the patch to TREE-ISH', ) ]) directory = DirectoryHasRepository() def func(parser, options, args):
the stack was rebased since the last publish command. The public branch name can be set via the branch.<branch>.public configuration variable (defaulting to "<branch>.public"). """ args = [argparse.all_branches] options = [ opt('-b', '--branch', args = [argparse.stg_branches], short = 'Use BRANCH instead of the default branch'), opt('-l', '--last', action = 'store_true', short = 'Show the last published patch'), opt('-u', '--unpublished', action = 'store_true', short = 'Show applied patches that have not been published') ] + (argparse.author_options() + argparse.message_options(save_template = False) + argparse.sign_options()) directory = common.DirectoryHasRepositoryLib() def __create_commit(repository, tree, parents, options, message = ''): """Return a new Commit object.""" cd = git.CommitData( tree = tree, parents = parents, message = message, author = git.Person.author(), committer = git.Person.committer()) cd = common.update_commit_data(cd, options) return repository.commit(cd) def __get_published(stack, tree): """Check the patches that were already published."""
Create a new, empty patch on the current stack. The new patch is created on top of the currently applied patches, and is made the new top of the stack. Uncommitted changes in the work tree are not included in the patch -- that is handled by linkstg:refresh[]. The given name must be unique in the stack, and may only contain alphanumeric characters, dashes and underscores. If no name is given, one is generated from the first line of the patch's commit message. An editor will be launched to edit the commit message to be used for the patch, unless the '--message' flag already specified one. The 'patchdescr.tmpl' template file (if available) is used to pre-fill the editor.""" args = [] options = (argparse.author_options() + argparse.message_options( save_template=True) + argparse.sign_options()) directory = common.DirectoryHasRepositoryLib() def func(parser, options, args): """Create a new patch.""" stack = directory.repository.current_stack if stack.repository.default_index.conflicts(): raise common.CmdException( 'Cannot create a new patch -- resolve conflicts first') # Choose a name for the new patch -- or None, which means make one # up later when we've gotten hold of the commit message. if len(args) == 0: name = None
'patchdescr.tmpl' template file (if available) is used to pre-fill the editor.""" args = [] options = ([ opt( '-v', '--verbose', action='store_true', short='show diff in patch commit message template', long=''' In addition to the names of files that have been changed, also show the textual changes that are staged to be committed and the changes in the working tree that have not yet been staged (i.e., like the output of git diff).''', ), ] + argparse.author_options() + argparse.message_options(save_template=True) + argparse.sign_options() + argparse.hook_options()) directory = DirectoryHasRepository() def func(parser, options, args): """Create a new patch.""" stack = directory.repository.current_stack if stack.repository.default_index.conflicts(): raise CmdException( 'Cannot create a new patch -- resolve conflicts first') # Choose a name for the new patch -- or None, which means make one # up later when we've gotten hold of the commit message. if len(args) == 0:
args = [argparse.all_branches] options = [ opt('-b', '--branch', args=[argparse.stg_branches], short='Use BRANCH instead of the default branch'), opt('-l', '--last', action='store_true', short='Show the last published patch'), opt('-u', '--unpublished', action='store_true', short='Show applied patches that have not been published') ] + (argparse.author_options() + argparse.message_options(save_template=False) + argparse.sign_options()) directory = common.DirectoryHasRepositoryLib() def __create_commit(repository, tree, parents, options, message=''): """Return a new Commit object.""" cd = git.CommitData(tree=tree, parents=parents, message=message, author=git.Person.author(), committer=git.Person.committer()) cd = common.update_commit_data(cd, options) return repository.commit(cd)