~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Michael Ellerman
  • Date: 2006-02-28 09:07:59 UTC
  • mto: (325.1.2 bzrtools) (0.3.1 shelf-dev)
  • mto: This revision was merged to the branch mainline in revision 334.
  • Revision ID: michael@ellerman.id.au-20060228090759-3fb20f080ffab71b
Adapt to BzrDir changes and deprecation of show_diff().

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
"""Shelf - temporarily set aside changes, then bring them back."""
3
3
 
4
4
import bzrlib.commands
5
 
import bzrlib.branch
6
5
from errors import CommandError
7
6
from bzrlib.option import Option
8
7
from patchsource import BzrPatchSource
40
39
                                  "parameter.")
41
40
 
42
41
        source = BzrPatchSource(revision, file_list)
43
 
        s = Shelf(source.branch.base)
 
42
        s = Shelf(source.base)
44
43
        s.shelve(source, pick, message)
45
44
        return 0
46
45
 
59
58
        import sys
60
59
 
61
60
        source = BzrPatchSource()
62
 
        s = Shelf(source.branch.base)
 
61
        s = Shelf(source.base)
63
62
 
64
63
        if subcommand == 'ls' or subcommand == 'list':
65
64
            self.__check_no_args(args_list, "shelf list takes no arguments!")
69
68
            s.delete(args_list[0])
70
69
        elif subcommand == 'switch':
71
70
            self.__check_one_arg(args_list, "shelf switch takes one argument!")
72
 
            s = Shelf(source.branch.base, args_list[0])
 
71
            s = Shelf(source.base, args_list[0])
73
72
            s.make_default()
74
73
        elif subcommand == 'show':
75
74
            self.__check_one_arg(args_list, "shelf show takes one argument!")
93
92
    takes_options = [Option('pick')]
94
93
    def run(self, pick=False):
95
94
        source = BzrPatchSource()
96
 
        s = Shelf(source.branch.base)
 
95
        s = Shelf(source.base)
97
96
        s.unshelve(source, pick)
98
97
        return 0
99
98