~benoit.pierre/bzrtools/shell_improvements

« back to all changes in this revision

Viewing changes to shell.py

  • Committer: Benoît Pierre
  • Date: 2008-11-19 23:40:29 UTC
  • Revision ID: benoit.pierre@gmail.com-20081119234029-ubk05odi3nxhjsyt
Add shell switch builtin which is used to wrap the call to the bzr switch
command so we can update the shell prompt accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
    def do_help(self, line):
168
168
        self.default("help "+line)
169
169
 
 
170
    def do_switch(self, line):
 
171
        result = self.default('switch '+line)
 
172
        if 0 == result:
 
173
            try:
 
174
                self.tree = WorkingTree.open_containing(".")[0]
 
175
            except:
 
176
                self.tree = None
 
177
        return result
 
178
 
170
179
    def default(self, line):
171
180
        args = shlex.split(line)
172
181
        alias_args = get_alias(args[0])