~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shell.py

  • Committer: Aaron Bentley
  • Date: 2006-03-15 04:01:23 UTC
  • mfrom: (325.1.1 bzrtools)
  • Revision ID: aaron.bentley@utoronto.ca-20060315040123-0a433b3a5cfbe403
Merged shell fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import string
23
23
from itertools import chain
24
24
from bzrlib.errors import BzrError
25
 
from bzrlib.commands import get_cmd_object, get_all_cmds
 
25
from bzrlib.commands import get_cmd_object, get_all_cmds, get_alias
26
26
from bzrlib.branch import Branch
27
27
 
28
28
SHELL_BLACKLIST = set(['rm', 'ls'])
154
154
 
155
155
    def default(self, line):
156
156
        args = line.split()
 
157
        alias_args = get_alias(args[0])
 
158
        if alias_args is not None:
 
159
            args[0] = alias_args.pop(0)
 
160
            
157
161
        commandname = args.pop(0)
158
162
        for char in ('|', '<', '>'):
159
163
            commandname = commandname.split(char)[0]
170
174
            if too_complicated(line):
171
175
                return os.system("bzr "+line)
172
176
            else:
173
 
                return (cmd_obj.run_argv(args) or 0)
 
177
                return (cmd_obj.run_argv_aliases(args, alias_args) or 0)
174
178
        except BzrError, e:
175
179
            print e
176
180
        except KeyboardInterrupt, e: