~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Michael Ellerman
  • Date: 2006-03-12 00:35:10 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-20060312003510-4244ca233f07b93a
After extensive user testing, ie. me using it, I've decided --pick should be
the default, not --all. So switch back to prompting by default, and --all gets
the shelve all behaviour.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
    If a revision is specified, changes since that revision will be shelved.
27
27
 
28
 
    If you specifiy "--pick" you'll be prompted for each hunk of the diff as
29
 
    to whether you want to shelve it or not. Press "?" at the prompt for help.
 
28
    By default shelve asks you what you want to shelve, press "?" at the 
 
29
    prompt to get help on the UI. To shelve everything run 'shelve --all'.
30
30
    """
31
31
    takes_args = ['file*']
32
 
    takes_options = [Option('pick'), 'message', 'revision']
33
 
    def run(self, pick=False, file_list=None, message=None, revision=None):
 
32
    takes_options = [Option('all'), 'message', 'revision']
 
33
    def run(self, all=False, file_list=None, message=None, revision=None):
34
34
        if revision is not None and revision:
35
35
            if len(revision) == 1:
36
36
                revision = revision[0]
40
40
 
41
41
        source = BzrPatchSource(revision, file_list)
42
42
        s = Shelf(source.base)
43
 
        s.shelve(source, pick, message)
 
43
        s.shelve(source, all, message)
44
44
        return 0
45
45
 
46
46
class cmd_shelf(bzrlib.commands.Command):
89
89
    """Reinstate the most recently shelved changes.
90
90
    See 'shelve' for more information.
91
91
    """
92
 
    takes_options = [Option('pick')]
93
 
    def run(self, pick=False):
 
92
    takes_options = [Option('all')]
 
93
    def run(self, all=False):
94
94
        source = BzrPatchSource()
95
95
        s = Shelf(source.base)
96
 
        s.unshelve(source, pick)
 
96
        s.unshelve(source, all)
97
97
        return 0
98
98
 
99
99
bzrlib.commands.register_command(cmd_shelf)