4727
4727
self.outf.write(" <no hooks installed>\n")
4730
class cmd_shelve(Command):
4731
"""Temporarily set aside some changes from the current tree.
4733
Shelve allows you to temporarily put changes you've made "on the shelf",
4734
ie. out of the way, until a later time when you can bring them back from
4735
the shelf with the 'unshelve' command.
4737
Shelve is intended to help separate several sets of changes that have
4738
been inappropriately mingled. If you just want to get rid of all changes
4739
and you don't need to restore them later, use revert. If you want to
4740
shelve all text changes at once, use shelve --all.
4742
If filenames are specified, only the changes to those files will be
4743
shelved. Other files will be left untouched.
4745
If a revision is specified, changes since that revision will be shelved.
4747
You can put multiple items on the shelf, and by default, 'unshelve' will
4748
restore the most recently shelved changes.
4750
While you have patches on the shelf you can view and manipulate them with
4751
the 'shelf' command. Run 'bzr shelf -h' for more info.
4754
takes_args = ['file*']
4758
Option('all', help='Shelve all changes.'),
4761
_see_also = ['unshelve']
4763
def run(self, revision=None, all=False, file_list=None, message=None):
4764
from bzrlib.shelf_ui import Shelver
4766
Shelver.from_args(revision, all, file_list, message).run()
4767
except errors.UserAbort:
4771
class cmd_unshelve(Command):
4772
"""Restore shelved changes.
4774
By default, the most recently shelved changes are restored. However if you
4775
specify a patch by name those changes will be restored instead. This
4776
works best when the changes don't depend on each other.
4779
takes_args = ['shelf_id?']
4781
RegistryOption.from_kwargs(
4782
'action', help="The action to perform.",
4783
enum_switch=False, value_switches=True,
4784
apply="Apply changes and remove from the shelf.",
4785
dry_run="Show changes, but do not apply or remove them.",
4786
delete_only="Delete changes without applying them."
4789
_see_also = ['shelve']
4791
def run(self, shelf_id=None, action='apply'):
4792
from bzrlib.shelf_ui import Unshelver
4793
Unshelver.from_args(shelf_id, action).run()
4730
4796
def _create_prefix(cur_transport):
4731
4797
needed = [cur_transport]
4732
4798
# Recurse upwards until we can create a directory successfully