import os.path
from optparse import make_option
-from stgit import run
+from stgit import argparse, run
from stgit.argparse import opt
from stgit.commands import common
from stgit.lib import log
"stg undo" and "stg redo" let you step back and forth in the patch
stack. "stg reset" lets you go directly to any state."""
+args = [argparse.patch_range(argparse.applied_patches,
+ argparse.unapplied_patches,
+ argparse.hidden_patches)]
options = [
- opt('-b', '--branch',
+ opt('-b', '--branch', args = [argparse.stg_branches],
short = 'Use BRANCH instead of the default one'),
- opt('-p', '--patch', action = 'store_true',
+ opt('-d', '--diff', action = 'store_true',
short = 'Show the refresh diffs'),
opt('-n', '--number', type = 'int',
short = 'Limit the output to NUMBER commits'),
opt('-f', '--full', action = 'store_true',
short = 'Show the full commit ids'),
opt('-g', '--graphical', action = 'store_true',
- short = 'Run gitk instead of printing')]
+ short = 'Run gitk instead of printing'),
+ opt('--clear', action = 'store_true',
+ short = 'Clear the log history')]
directory = common.DirectoryHasRepositoryLib()
except KeyError:
out.info('Log is empty')
return
+
+ if options.clear:
+ log.delete_log(stack.repository, stack.name)
+ return
+
stacklog = log.get_log_entry(stack.repository, logref, logcommit)
pathlim = [os.path.join('patches', pn) for pn in patches]