~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Michael Ellerman
  • Date: 2005-10-19 11:34:39 UTC
  • mto: (0.3.1 shelf-dev) (325.1.2 bzrtools)
  • mto: This revision was merged to the branch mainline in revision 246.
  • Revision ID: michael@ellerman.id.au-20051019113439-193bca379eec5798
Move all shelf functions into a class. Only logic change is we save the
bzr root dir rather than recomputing it again and again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
import bzrlib.commands
5
5
import bzrlib.branch
6
 
import shelf
 
6
from shelf import Shelf
7
7
 
8
8
class cmd_shelve(bzrlib.commands.Command):
9
9
    """Temporarily remove some changes from the current tree.
25
25
            b = bzrlib.branch.Branch.open_containing(branchdir)
26
26
            revision_list = ["revid:" + revision[0].in_history(b).rev_id]
27
27
 
28
 
        return shelf.shelve(message=message, file_list=file_list,
 
28
        s = Shelf()
 
29
        return s.shelve(message=message, file_list=file_list,
29
30
                      revision=revision_list)
30
31
 
31
32
class cmd_unshelve(bzrlib.commands.Command):
33
34
    See also 'shelve'.
34
35
    """
35
36
    def run(self):
36
 
        return shelf.unshelve()
 
37
        s = Shelf()
 
38
        return s.unshelve()
37
39
 
38
40
bzrlib.commands.register_command(cmd_shelve)
39
41
bzrlib.commands.register_command(cmd_unshelve)