Rev 4127: (abentley) shelve now supports --destroy option. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Thu Mar 12 07:52:26 GMT 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4127
revision-id: pqm at pqm.ubuntu.com-20090312075222-g575i2pcrliafetw
parent: pqm at pqm.ubuntu.com-20090312071229-wgby8yvwn51qcrbz
parent: aaron at aaronbentley.com-20090312070127-77t7o4w3mjlhr7ox
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-03-12 07:52:22 +0000
message:
(abentley) shelve now supports --destroy option.
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/shelf_ui.py shelver.py-20081005210102-33worgzwrtdw0yrm-1
bzrlib/tests/blackbox/test_shelve.py test_ls_shelf.py-20081202053526-thlo8yt0pi1cgor1-1
bzrlib/tests/test_shelf_ui.py test_shelf_ui.py-20081027155203-wtcuazg85wp9u4fv-1
------------------------------------------------------------
revno: 4100.3.6
revision-id: aaron at aaronbentley.com-20090312070127-77t7o4w3mjlhr7ox
parent: aaron at aaronbentley.com-20090312070036-am7ni53tebog0090
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: destructive-shelve
timestamp: Thu 2009-03-12 17:01:27 +1000
message:
Fix NEWS
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
------------------------------------------------------------
revno: 4100.3.5
revision-id: aaron at aaronbentley.com-20090312070036-am7ni53tebog0090
parent: aaron at aaronbentley.com-20090312055811-qc7cigoofn79d32q
parent: pqm at pqm.ubuntu.com-20090312063229-ucuyuhmuc7ya8e54
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: destructive-shelve
timestamp: Thu 2009-03-12 17:00:36 +1000
message:
Merge bzr.dev into destructive-shelve
added:
bzrlib/tests/per_repository_reference/test_default_stacking.py test_default_stackin-20090311055345-9ajahgm58oq3wh6h-1
tools/check-newsbugs.py checknewsbugs.py-20090128204947-lsdwd8nlswm1yrwv-1
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzr bzr.py-20050313053754-5485f144c7006fa6
bzrlib/__init__.py __init__.py-20050309040759-33e65acf91bbcd5d
bzrlib/_dirstate_helpers_c.pyx dirstate_helpers.pyx-20070503201057-u425eni465q4idwn-3
bzrlib/bugtracker.py bugtracker.py-20070410073305-vu1vu1qosjurg8kb-1
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/commands.py bzr.py-20050309040720-d10f4714595cf8c3
bzrlib/dirstate.py dirstate.py-20060728012006-d6mvoihjb3je9peu-1
bzrlib/errors.py errors.py-20050309040759-20512168c4e14fbd
bzrlib/graph.py graph_walker.py-20070525030359-y852guab65d4wtn0-1
bzrlib/hooks.py hooks.py-20070325015548-ix4np2q0kd8452au-1
bzrlib/knit.py knit.py-20051212171256-f056ac8f0fbe1bd9
bzrlib/lock.py lock.py-20050527050856-ec090bb51bc03349
bzrlib/lockable_files.py control_files.py-20051111201905-bb88546e799d669f
bzrlib/lsprof.py lsprof.py-20051208071030-833790916798ceed
bzrlib/osutils.py osutils.py-20050309040759-eeaff12fbf77ac86
bzrlib/reconcile.py reweave_inventory.py-20051108164726-1e5e0934febac06e
bzrlib/remote.py remote.py-20060720103555-yeeg2x51vn0rbtdp-1
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/repository.py rev_storage.py-20051111201905-119e9401e46257e3
bzrlib/shelf.py prepare_shelf.py-20081005181341-n74qe6gu1e65ad4v-1
bzrlib/smart/medium.py medium.py-20061103051856-rgu2huy59fkz902q-1
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/blackbox/test_commit.py test_commit.py-20060212094538-ae88fc861d969db0
bzrlib/tests/branch_implementations/__init__.py __init__.py-20060123013057-b12a52c3f361daf4
bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
bzrlib/tests/branch_implementations/test_stacking.py test_stacking.py-20080214020755-msjlkb7urobwly0f-1
bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
bzrlib/tests/per_repository/test_fileid_involved.py test_file_involved.py-20051215205901-728a172d1014daaa
bzrlib/tests/per_repository_reference/__init__.py __init__.py-20080220025549-nnm2s80it1lvcwnc-2
bzrlib/tests/test__dirstate_helpers.py test_dirstate_helper-20070504035751-jsbn00xodv0y1eve-2
bzrlib/tests/test_bzrdir.py test_bzrdir.py-20060131065654-deba40eef51cf220
bzrlib/tests/test_errors.py test_errors.py-20060210110251-41aba2deddf936a8
bzrlib/tests/test_fetch.py testfetch.py-20050825090644-f73e07e7dfb1765a
bzrlib/tests/test_graph.py test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
bzrlib/tests/test_hooks.py test_hooks.py-20070628030849-89rtsbe5dmer5npz-1
bzrlib/tests/test_remote.py test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
bzrlib/tests/test_shelf.py test_prepare_shelf.p-20081005181341-n74qe6gu1e65ad4v-2
bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
bzrlib/tests/test_source.py test_source.py-20051207061333-a58dea6abecc030d
bzrlib/tests/test_urlutils.py test_urlutils.py-20060502192900-46b1f9579987cf9c
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
bzrlib/tests/test_workingtree_4.py test_workingtree_4.p-20070223025758-531n3tznl3zacv2o-1
bzrlib/tests/tree_implementations/test_path_content_summary.py test_path_content_su-20070904100855-3vrwedz6akn34kl5-1
bzrlib/tests/workingtree_implementations/test_mkdir.py test_mkdir.py-20060907214856-4omn6hf1u7fvrart-3
bzrlib/tests/workingtree_implementations/test_nested_specifics.py test_nested_specific-20070306004443-qut978c488jr11sg-1
bzrlib/tests/workingtree_implementations/test_parents.py test_set_parents.py-20060807231740-yicmnlci1mj8smu1-1
bzrlib/tests/workingtree_implementations/test_workingtree.py test_workingtree.py-20060203003124-817757d3e31444fb
bzrlib/transform.py transform.py-20060105172343-dd99e54394d91687
bzrlib/transport/http/__init__.py http_transport.py-20050711212304-506c5fd1059ace96
bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
bzrlib/transport/remote.py ssh.py-20060608202016-c25gvf1ob7ypbus6-1
bzrlib/transport/sftp.py sftp.py-20051019050329-ab48ce71b7e32dfe
bzrlib/ui/text.py text.py-20051130153916-2e438cffc8afc478
bzrlib/urlutils.py urlutils.py-20060502195429-e8a161ecf8fac004
bzrlib/versionedfile.py versionedfile.py-20060222045106-5039c71ee3b65490
bzrlib/weave.py knit.py-20050627021749-759c29984154256b
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
doc/developers/releasing.txt releasing.txt-20080502015919-fnrcav8fwy8ccibu-1
tools/doc_generate/autodoc_man.py bzrman.py-20050601153041-0ff7f74de456d15e
------------------------------------------------------------
revno: 4100.3.4
revision-id: aaron at aaronbentley.com-20090312055811-qc7cigoofn79d32q
parent: aaron at aaronbentley.com-20090312050338-befvkvyw56b94rav
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: destructive-shelve
timestamp: Thu 2009-03-12 15:58:11 +1000
message:
Clean up signatures
modified:
bzrlib/tests/test_shelf_ui.py test_shelf_ui.py-20081027155203-wtcuazg85wp9u4fv-1
------------------------------------------------------------
revno: 4100.3.3
revision-id: aaron at aaronbentley.com-20090312050338-befvkvyw56b94rav
parent: aaron at aaronbentley.com-20090312011711-wsmp5b6zsutlgz2w
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: destructive-shelve
timestamp: Thu 2009-03-12 15:03:38 +1000
message:
Add note when shelve --detroy completes.
modified:
bzrlib/shelf_ui.py shelver.py-20081005210102-33worgzwrtdw0yrm-1
------------------------------------------------------------
revno: 4100.3.2
revision-id: aaron at aaronbentley.com-20090312011711-wsmp5b6zsutlgz2w
parent: aaron at aaronbentley.com-20090312010858-hq6xx22l59nq4udp
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: destructive-shelve
timestamp: Thu 2009-03-12 11:17:11 +1000
message:
Update docs
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/shelf_ui.py shelver.py-20081005210102-33worgzwrtdw0yrm-1
------------------------------------------------------------
revno: 4100.3.1
revision-id: aaron at aaronbentley.com-20090312010858-hq6xx22l59nq4udp
parent: pqm at pqm.ubuntu.com-20090310012923-c8el0n6v75v4ycd1
committer: Aaron Bentley <aaron at aaronbentley.com>
branch nick: destructive-shelve
timestamp: Thu 2009-03-12 11:08:58 +1000
message:
Implement shelve --destroy
modified:
bzrlib/builtins.py builtins.py-20050830033751-fc01482b9ca23183
bzrlib/shelf_ui.py shelver.py-20081005210102-33worgzwrtdw0yrm-1
bzrlib/tests/blackbox/test_shelve.py test_ls_shelf.py-20081202053526-thlo8yt0pi1cgor1-1
bzrlib/tests/test_shelf_ui.py test_shelf_ui.py-20081027155203-wtcuazg85wp9u4fv-1
=== modified file 'NEWS'
--- a/NEWS 2009-03-12 06:32:29 +0000
+++ b/NEWS 2009-03-12 07:01:27 +0000
@@ -16,6 +16,9 @@
NEW FEATURES:
+ * shelve can now apply changes without storing anything on the shelf, via
+ the new --destroy option. (Aaron Bentley)
+
IMPROVEMENTS:
* Progress bars now show the rate of network activity for
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py 2009-03-10 23:39:48 +0000
+++ b/bzrlib/builtins.py 2009-03-12 07:00:36 +0000
@@ -5397,11 +5397,13 @@
value_switches=True, enum_switch=False),
Option('list', help='List shelved changes.'),
+ Option('destroy',
+ help='Destroy removed changes instead of shelving them.'),
]
_see_also = ['unshelve']
def run(self, revision=None, all=False, file_list=None, message=None,
- writer=None, list=False):
+ writer=None, list=False, destroy=False):
if list:
return self.run_for_list()
from bzrlib.shelf_ui import Shelver
@@ -5409,7 +5411,7 @@
writer = bzrlib.option.diff_writer_registry.get()
try:
Shelver.from_args(writer(sys.stdout), revision, all, file_list,
- message).run()
+ message, destroy=destroy).run()
except errors.UserAbort:
return 0
=== modified file 'bzrlib/shelf_ui.py'
--- a/bzrlib/shelf_ui.py 2009-03-08 01:32:37 +0000
+++ b/bzrlib/shelf_ui.py 2009-03-12 05:03:38 +0000
@@ -39,7 +39,8 @@
"""Interactively shelve the changes in a working tree."""
def __init__(self, work_tree, target_tree, diff_writer=None, auto=False,
- auto_apply=False, file_list=None, message=None):
+ auto_apply=False, file_list=None, message=None,
+ destroy=False):
"""Constructor.
:param work_tree: The working tree to shelve changes from.
@@ -49,6 +50,8 @@
:param auto_apply: If True, shelve changes with no final prompt.
:param file_list: If supplied, only files in this list may be shelved.
:param message: The message to associate with the shelved changes.
+ :param destroy: Change the working tree without storing the shelved
+ changes.
"""
self.work_tree = work_tree
self.target_tree = target_tree
@@ -60,10 +63,11 @@
self.auto_apply = auto_apply
self.file_list = file_list
self.message = message
+ self.destroy = destroy
@classmethod
def from_args(klass, diff_writer, revision=None, all=False, file_list=None,
- message=None, directory='.'):
+ message=None, directory='.', destroy=False):
"""Create a shelver from commandline arguments.
:param revision: RevisionSpec of the revision to compare to.
@@ -71,12 +75,15 @@
:param file_list: If supplied, only files in this list may be shelved.
:param message: The message to associate with the shelved changes.
:param directory: The directory containing the working tree.
+ :param destroy: Change the working tree without storing the shelved
+ changes.
"""
tree, path = workingtree.WorkingTree.open_containing(directory)
target_tree = builtins._get_one_revision_tree('shelf2', revision,
tree.branch, tree)
files = builtins.safe_relpath_files(tree, file_list)
- return klass(tree, target_tree, diff_writer, all, all, files, message)
+ return klass(tree, target_tree, diff_writer, all, all, files, message,
+ destroy)
def run(self):
"""Interactively shelve the changes."""
@@ -121,9 +128,13 @@
delta.report_changes(changes, reporter)
if (self.auto_apply or self.prompt_bool(
'Shelve %d change(s)?' % changes_shelved)):
- shelf_id = self.manager.shelve_changes(creator,
- self.message)
- trace.note('Changes shelved with id "%d".' % shelf_id)
+ if self.destroy:
+ creator.transform()
+ trace.note('Selected changes destroyed.')
+ else:
+ shelf_id = self.manager.shelve_changes(creator,
+ self.message)
+ trace.note('Changes shelved with id "%d".' % shelf_id)
else:
trace.warning('No changes to shelve.')
finally:
=== modified file 'bzrlib/tests/blackbox/test_shelve.py'
--- a/bzrlib/tests/blackbox/test_shelve.py 2009-01-29 02:30:08 +0000
+++ b/bzrlib/tests/blackbox/test_shelve.py 2009-03-12 01:08:58 +0000
@@ -57,6 +57,14 @@
self.assertEqual('', err)
self.assertEqual(' 2: Bar\n 1: Foo\n', out)
+ def test_shelve_destroy(self):
+ tree = self.make_branch_and_tree('.')
+ self.build_tree(['file'])
+ tree.add('file')
+ self.run_bzr('shelve --all --destroy')
+ self.failIfExists('file')
+ self.assertIs(None, tree.get_shelf_manager().last_shelf())
+
class TestShelveRelpath(TestCaseWithTransport):
=== modified file 'bzrlib/tests/test_shelf_ui.py'
--- a/bzrlib/tests/test_shelf_ui.py 2009-02-16 16:37:52 +0000
+++ b/bzrlib/tests/test_shelf_ui.py 2009-03-12 05:58:11 +0000
@@ -25,10 +25,12 @@
class ExpectShelver(shelf_ui.Shelver):
"""A variant of Shelver that intercepts console activity, for testing."""
- def __init__(self, work_tree, target_tree, diff_writer=None, path=None,
- auto=False, auto_apply=False, file_list=None, message=None):
+ def __init__(self, work_tree, target_tree, diff_writer=None,
+ auto=False, auto_apply=False, file_list=None, message=None,
+ destroy=False):
shelf_ui.Shelver.__init__(self, work_tree, target_tree, diff_writer,
- auto, auto_apply, file_list, message)
+ auto, auto_apply, file_list, message,
+ destroy)
self.expected = []
self.diff_writer = StringIO()
@@ -199,6 +201,14 @@
shelver.expect('Shelve 2 change(s)? [yNfq?]', 'y')
shelver.run()
+ def test_shelve_distroy(self):
+ tree = self.create_shelvable_tree()
+ shelver = shelf_ui.Shelver.from_args(sys.stdout, all=True,
+ directory='tree', destroy=True)
+ shelver.run()
+ self.assertIs(None, tree.get_shelf_manager().last_shelf())
+ self.assertFileEqual(LINES_AJ, 'tree/foo')
+
class TestUnshelver(tests.TestCaseWithTransport):
More information about the bazaar-commits
mailing list