~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Michael Ellerman
  • Date: 2005-11-28 06:58:01 UTC
  • mto: (0.3.1 shelf-dev) (325.1.2 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 334.
  • Revision ID: michael@ellerman.id.au-20051128065801-85aa3456f2b8e496
Shelve everything by default, use --pick to select hunks individually.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import bzrlib.commands
5
5
import bzrlib.branch
6
6
from bzrlib.errors import BzrCommandError
 
7
from bzrlib.option import Option
7
8
from shelf import Shelf
8
9
 
9
10
class cmd_shelve(bzrlib.commands.Command):
20
21
    shelved, other files will be left untouched.
21
22
 
22
23
    If a revision is specified, changes since that revision will be shelved.
 
24
 
 
25
    If you specifiy "--pick" you'll be prompted for each hunk of the diff as
 
26
    to whether you want to shelve it or not. Press "?" at the prompt for help.
23
27
    """
24
28
    takes_args = ['file*']
25
 
    takes_options = ['all', 'message', 'revision']
26
 
    def run(self, all=False, file_list=None, message=None, revision=None):
 
29
    takes_options = [Option('pick'), 'message', 'revision']
 
30
    def run(self, pick=False, file_list=None, message=None, revision=None):
27
31
        if file_list is not None and len(file_list) > 0:
28
32
            branchdir = file_list[0]
29
33
        else:
37
41
                                  "parameter.")
38
42
 
39
43
        s = Shelf(branchdir)
40
 
        return s.shelve(all, message, revision, file_list)
 
44
        return s.shelve(pick, message, revision, file_list)
41
45
 
42
46
class cmd_unshelve(bzrlib.commands.Command):
43
47
    """Reinstate the most recently shelved changes.