~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to bzr_shelf.py

  • Committer: Michael Ellerman
  • Date: 2006-02-11 05:32:54 UTC
  • mto: (0.1.73 shelf-tmp)
  • mto: This revision was merged to the branch mainline in revision 334.
  • Revision ID: michael@ellerman.id.au-20060211053254-7555b8387c38465f
Add help for shelf command, rename action to subcommand.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        return 0
41
41
 
42
42
class cmd_shelf(bzrlib.commands.Command):
43
 
    takes_args = ['action']
44
 
 
45
 
    def run(self, action):
 
43
    """Perform various operations on your shelved patches.
 
44
 
 
45
    Subcommands:
 
46
        list (ls)   List the patches currently shelved.
 
47
    """
 
48
    takes_args = ['subcommand']
 
49
 
 
50
    def run(self, subcommand):
46
51
        import sys
47
52
 
48
53
        source = BzrPatchSource()
49
54
        s = Shelf(source.branch.base)
50
55
 
51
 
        if action == 'ls' or action == 'list':
 
56
        if subcommand == 'ls' or subcommand == 'list':
52
57
            s.list()
53
58
        else:
54
 
            print >>sys.stderr, "Unknown shelf action '%s'" % action
 
59
            print >>sys.stderr, "Unknown shelf subcommand '%s'" % subcommand
55
60
 
56
61
class cmd_unshelve(bzrlib.commands.Command):
57
62
    """Reinstate the most recently shelved changes.