X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/blobdiff_plain/d926892f4f058326d8e7efc61f7ae4f54b8a02b2..a1e0467d1262ac793a63a650d547cded11f74fe7:/stgit/commands/goto.py diff --git a/stgit/commands/goto.py b/stgit/commands/goto.py index b347920..33b20ed 100644 --- a/stgit/commands/goto.py +++ b/stgit/commands/goto.py @@ -15,20 +15,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -from optparse import OptionParser, make_option from stgit.commands import common from stgit.lib import transaction -help = 'push or pop patches to the given one' -usage = """%prog [options] - +help = 'Push or pop patches to the given one' +usage = [''] +description = """ Push/pop patches to/from the stack until the one given on the command line becomes current. There is no '--undo' option for 'goto'. Use the 'push --undo' command for this.""" -directory = common.DirectoryHasRepositoryLib() options = [] +directory = common.DirectoryHasRepositoryLib() + def func(parser, options, args): if len(args) != 1: parser.error('incorrect number of arguments') @@ -46,6 +46,8 @@ def func(parser, options, args): trans.push_patch(pn, iw) except transaction.TransactionHalted: pass + elif patch in trans.hidden: + raise common.CmdException('Cannot goto a hidden patch') else: raise common.CmdException('Patch "%s" does not exist' % patch) return trans.run(iw)