Merge commit 'kha/safe'
authorCatalin Marinas <catalin.marinas@gmail.com>
Fri, 17 Jul 2009 13:05:23 +0000 (14:05 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 17 Jul 2009 13:05:23 +0000 (14:05 +0100)
stgit/commands/float.py
stgit/commands/imprt.py
stgit/config.py

index e561c39..9316398 100644 (file)
@@ -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:
index 7a806cc..8067beb 100644 (file)
@@ -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()
 
index f205e5b..4a6cb3b 100644 (file)
@@ -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: