From: Catalin Marinas Date: Fri, 17 Jul 2009 13:05:23 +0000 (+0100) Subject: Merge commit 'kha/safe' X-Git-Tag: v0.15-rc2~19 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/06e17aa6f11f598a7cb802d5516e56708996c870?hp=533d85c2f663a7e89816b23c627a118866ab00fb Merge commit 'kha/safe' --- diff --git a/stgit/commands/float.py b/stgit/commands/float.py index e561c39..9316398 100644 --- a/stgit/commands/float.py +++ b/stgit/commands/float.py @@ -16,6 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ +import re import sys from stgit.argparse import opt from stgit.commands import common @@ -55,7 +56,7 @@ def func(parser, options, args): if options.series == '-': f = sys.stdin else: - f = file(args[0]) + f = file(options.series) patches = [] for line in f: diff --git a/stgit/commands/imprt.py b/stgit/commands/imprt.py index 7a806cc..8067beb 100644 --- a/stgit/commands/imprt.py +++ b/stgit/commands/imprt.py @@ -267,7 +267,7 @@ def __import_url(url, options): import tempfile if not url: - parser.error('URL argument required') + raise CmdException('URL argument required') patch = os.path.basename(urllib.unquote(url)) filename = os.path.join(tempfile.gettempdir(), patch) @@ -327,7 +327,7 @@ def func(parser, options, args): else: filename = None - if filename: + if not options.url and filename: filename = os.path.abspath(filename) directory.cd_to_topdir() diff --git a/stgit/config.py b/stgit/config.py index f205e5b..4a6cb3b 100644 --- a/stgit/config.py +++ b/stgit/config.py @@ -37,7 +37,7 @@ class GitConfig: 'stgit.keepoptimized': 'no', 'stgit.extensions': '.ancestor .current .patched', 'stgit.shortnr': '5', - 'stgit.pager': 'less -FRSX' + 'stgit.pager': 'less' } __cache = None @@ -121,6 +121,7 @@ def config_setup(): global config os.environ.setdefault('PAGER', config.get('stgit.pager')) + os.environ.setdefault('LESS', '-FRSX') # FIXME: handle EDITOR the same way ? class ConfigOption: