7
class cmd_shelve(bzrlib.commands.Command):
8
"""Temporarily remove some changes from the current tree.
9
Use 'unshelve' to restore these changes.
11
If filenames are specified, only changes to those files will be unshelved.
12
If a revision is specified, all changes since that revision will may be
15
takes_args = ['file*']
16
takes_options = ['message', 'revision']
17
def run(self, file_list=None, message=None, revision=None):
19
if revision is not None and revision:
20
if file_list is not None and len(file_list) > 0:
21
branchdir = file_list[0]
24
b = bzrlib.branch.Branch.open_containing(branchdir)
25
revision_list = ["revid:" + revision[0].in_history(b).rev_id]
27
return shelf.shelve(message=message, file_list=file_list,
28
revision=revision_list)
30
class cmd_unshelve(bzrlib.commands.Command):
31
"""Restore previously-shelved changes to the current tree.
35
return shelf.unshelve()
37
bzrlib.commands.register_command(cmd_shelve)
38
bzrlib.commands.register_command(cmd_unshelve)