Merge lp:~oddbloke/bzr/183559-switch-r into lp:bzr

Proposed by Martin Pool
Status: Rejected
Rejected by: Andrew Bennetts
Proposed branch: lp:~oddbloke/bzr/183559-switch-r
Merge into: lp:bzr
Diff against target: 434 lines (+309/-1)
5 files modified
NEWS (+200/-0)
bzrlib/builtins.py (+35/-1)
bzrlib/switch.py (+25/-0)
bzrlib/tests/blackbox/test_switch.py (+32/-0)
bzrlib/tests/test_switch.py (+17/-0)
To merge this branch: bzr merge lp:~oddbloke/bzr/183559-switch-r
Reviewer Review Type Date Requested Status
Andrew Bennetts Disapprove
John A Meinel Needs Fixing
Review via email: mp+16827@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

Fix for https://bugs.edge.launchpad.net/bzr/+bug/183559 adding "switch -r".

I haven't read it yet but it would be good for someone to review it and if necessary pick it up.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:
> Martin Pool has proposed merging lp:~daniel-thewatkins/bzr/183559-switch-r into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> #183559 bzr switch should have a -r option
> https://bugs.launchpad.net/bugs/183559
>
>
> Fix for https://bugs.edge.launchpad.net/bzr/+bug/183559 adding "switch -r".
>
> I haven't read it yet but it would be good for someone to review it and if necessary pick it up.
>

1) Lots of conflicts. Looks like it was done back in 1.12 or so. A lot
of stuff doesn't line up. Probably mostly shallow

2)

=== modified file 'bzrlib/builtins.py'
- --- bzrlib/builtins.py 2009-12-23 05:42:33 +0000
+++ bzrlib/builtins.py 2010-01-05 03:39:25 +0000
@@ -5493,22 +5493,42 @@
     that of the master.
     """

- - takes_args = ['to_location']
+ takes_args = ['to_location?']
     takes_options = [Option('force',
+<<<<<<< TREE
                         help='Switch even if local commits will be lost.'),
                      Option('create-branch', short_name='b',
                         help='Create the target branch from this one
before'
                              ' switching to it.'),
+=======
+ help='Switch even if local commits will be lost.'),
+ 'revision'
+>>>>>>> MERGE-SOURCE
                      ]

^- This looks like he made it so "bzr switch -r XXX" changes the local
tree to a different rev. Which sounds like overlap with the new "bzr
update -r" functionality.

I would probably pick one and stick with it, rather than having 2 ways
to do it.

TBH switch comes to mind faster than update, though I think update fits
SVN usage better.

The rest of the code just passing down a revision_id to switch, and
having it use that RevisionTree rather than just the
to_branch.basis_tree() seems fine.

 review: needs_fixing

I'm not setting this to WIP yet, as maybe the patch-pilot wants to pick
it up?

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAktCuiQACgkQJdeBCYSNAAP2+QCgkRtmKt2F+DDP1+SmLAQNDUTD
9lQAn0Rxvuw4TIsYiF9KHtmlJDQ2tWuQ
=po4T
-----END PGP SIGNATURE-----

review: Needs Fixing
Revision history for this message
Andrew Bennetts (spiv) wrote :

Sure, I'll pick it up.

Revision history for this message
Andrew Bennetts (spiv) wrote :

Daniel, I just noticed you haven't signed the Canonical's contributor's agreement... would you mind doing so? <http://www.canonical.com/contributors>. Thanks!

I've put an updated version of this up for review at <https://code.edge.launchpad.net/~spiv/bzr/switch-r-183559/+merge/17195>.

(Marking "Disapprove/Rejected" because I don't know a better way to tell LP that my proposal supersedes this one.)

review: Disapprove

Updating diff...

An updated diff will be available in a few minutes. Reload to see the changes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-01-04 05:40:01 +0000
+++ NEWS 2010-01-05 03:39:25 +0000
@@ -1,5 +1,6 @@
1####################1####################
2Bazaar Release Notes2Bazaar Release Notes
3<<<<<<< TREE
3####################4####################
45
5.. contents:: List of Releases6.. contents:: List of Releases
@@ -3360,6 +3361,205 @@
33603361
3361:Codename: "Eyes up!"3362:Codename: "Eyes up!"
3362:Released: 2009-01-193363:Released: 2009-01-19
3364=======
3365--------------------
3366
3367.. contents::
3368
3369IN DEVELOPMENT
3370--------------
3371
3372 COMPATIBILITY BREAKS:
3373
3374 * By default, ``bzr status`` after a merge now shows just the pending
3375 merge tip revisions. This improves the signal-to-noise ratio after
3376 merging from trunk and completes much faster. To see all merged
3377 revisions, use the new ``-v`` flag. (Ian Clatworthy)
3378
3379 * ``bzr log --line`` now shows any tags after the date and before
3380 the commit message. If you have scripts which parse the output
3381 from this command, you may need to adjust them accordingly.
3382 (Ian Clatworthy)
3383
3384 * ``bzr log --short`` now shows any additional revision properties
3385 after the date and before the commit message. Scripts that parse
3386 output of the log command in this situation may need to adjust.
3387 (Neil Martinsen-Burrell)
3388
3389 * The experimental formats ``1.12-preview`` and ``1.12-preview-rich-root``
3390 have been renamed ``development-wt5`` and ``development-wt5-rich-root``
3391 respectively, given they are not ready for release in 1.12.
3392 (Ian Clatworthy)
3393
3394 NEW FEATURES:
3395
3396 * Add support for filtering `bzr missing` on revisions. Remote revisions
3397 can be filtered using `bzr missing -r -20..-10` and local revisions can
3398 be filtered using `bzr missing --my-revision -20..-10`.
3399 (Marius Kruger)
3400
3401 * ``bzr log -p`` displays the patch diff for each revision.
3402 When logging a file, the diff only includes changes to that file.
3403 (Ian Clatworthy, #202331, #227335)
3404
3405 * ``bzr log`` supports a new option called ``-n N`` or ``--level N``.
3406 A value of 0 (zero) means "show all nested merge revisions" while
3407 a value of 1 (one) means "show just the top level". Values above
3408 1 can be used to see a limited amount of nesting. That can be
3409 useful for seeing the level or two below PQM submits for example.
3410 To force the ``--short`` and ``--line`` formats to display all nested
3411 merge revisions just like ``--long`` does by default, use a command
3412 like ``bzr log --short -n0``. To display just the mainline using
3413 ``--long`` format, ``bzr log --long -n1``.
3414 (Ian Clatworthy)
3415
3416 IMPROVEMENTS:
3417
3418 * ``bzr add`` more clearly communicates success vs failure.
3419 (Daniel Watkins)
3420
3421 * ``bzr init`` will now print a little less verbose output.
3422 (Marius Kruger)
3423
3424 * ``bzr log`` is now much faster in many use cases, particularly
3425 at incrementally displaying results and filtering by a
3426 revision range. (Ian Clatworthy)
3427
3428 * ``bzr log --short`` and ``bzr log --line`` now show tags, if any,
3429 for each revision. The tags are shown comma-separated inside
3430 ``{}``. For short format, the tags appear at the end of line
3431 before the optional ``[merge]`` indicator. For line format,
3432 the tags appear after the date. (Ian Clatworthy)
3433
3434 * ``bzr switch`` now takes a ``--revision`` option, to allow switching to a
3435 specific revision of a branch. (Daniel Watkins, #183559)
3436
3437 * Progress bars now show the rate of activity for some sftp
3438 operations, and they are drawn different. (Martin Pool, #172741)
3439
3440 * Progress bars now show the rate of activity for urllib and pycurl based
3441 http client implementations. The operations are tracked at the socket
3442 level for better precision.
3443 (Vincent Ladeuil)
3444
3445 * Rule-based preferences can now accept multiple patterns for a set of
3446 rules. (Marius Kruger)
3447
3448 * The ``ancestor:`` revision spec will now default to referring to the
3449 parent of the branch if no other location is given.
3450 (Daniel Watkins, #198417)
3451
3452 * The debugger started as a result of setting ``$BZR_PDB`` works
3453 around a bug in ``pdb``, http://bugs.python.org/issue4150. The bug
3454 can cause truncated tracebacks in Python versions before 2.6.
3455 (Andrew Bennetts)
3456
3457 * VirtualVersionedFiles now implements
3458 ``iter_lines_added_or_present_in_keys``. This allows the creation of
3459 new branches based on stacked bzr-svn branches. (#311997)
3460
3461 BUG FIXES:
3462
3463 * ``bzr annotate --show-ids`` doesn't give a backtrace on empty files
3464 anymore.
3465 (Anne Mohsen, Vincent Ladeuil, #314525)
3466
3467 * ``bzr log FILE`` now correctly shows mainline revisions merging
3468 a change to FILE when the ``--short`` and ``--line`` log formats
3469 are used. (Ian Clatworthy, #317417)
3470
3471 * ``bzr log -rX..Y FILE`` now shows the history of FILE provided
3472 it existed in Y or X, even if the file has since been deleted or
3473 renamed. If no range is given, the current/basis tree and
3474 initial tree are searched in that order. More generally, log
3475 now interprets filenames in their historical context.
3476 (Ian Clatworthy, #175520)
3477
3478 * ``bzr status`` now reports nonexistent files and continues, then
3479 errors (with code 3) at the end. (Karl Fogel, #306394)
3480
3481 * Don't require the present compression base in knits to be the same
3482 when adding records in knits. (Jelmer Vernooij, #307394)
3483
3484 * Fix a problem with CIFS client/server lag on Windows colliding with
3485 an invariant-per-process algorithm for generating AtomicFile names
3486 (Adrian Wilkins, #304023)
3487
3488 * Many socket operations now handle EINTR by retrying the operation.
3489 Previously EINTR was treated as an unrecoverable failure. There is
3490 a new ``until_no_eintr`` helper function in ``bzrlib.osutils``.
3491 (Andrew Bennetts)
3492
3493 * Support symlinks with non-ascii characters in the symlink filename.
3494 (Jelmer Vernooij, #319323)
3495
3496 * There was a bug in how we handled resolving when a file is deleted
3497 in one branch, and modified in the other. If there was a criss-cross
3498 merge, we would cause the deletion to conflict a second time.
3499 (Vincent Ladeuil, John Arbash Meinel)
3500
3501 * There was another bug in how we chose the correct intermediate LCA in
3502 criss-cross merges leading to several kind of changes be incorrectly
3503 handled.
3504 (John Arbash Meinel, Vincent Ladeuil)
3505
3506 * Unshelve now handles deleted paths without crashing. (Robert Collins)
3507
3508 DOCUMENTATION:
3509
3510 * Improved plugin developer documentation. (Martin Pool)
3511
3512 API CHANGES:
3513
3514 * ``ProgressBarStack`` is deprecated; instead use
3515 ``ui_factory.nested_progress_bar`` to create new progress bars.
3516
3517 * ForeignVcsMapping() now requires a ForeignVcs object as first
3518 argument. (Jelmer Vernooij)
3519
3520 * ForeignVcsMapping.show_foreign_revid() has been moved to
3521 ForeignVcs. (Jelmer Vernooij)
3522
3523 * Revision specifiers are now registered in
3524 ``bzrlib.revisionspec.revspec_registry``, and the old list of
3525 revisionspec classes (``bzrlib.revisionspec.SPEC_TYPES``) has been
3526 deprecated. (Jelmer Vernooij, #321183)
3527
3528 * The progress and UI classes have changed; the main APIs remain the
3529 same but code that provides a new UI or progress bar class may
3530 need to be updated. (Martin Pool)
3531
3532 TESTING:
3533
3534 INTERNALS:
3535
3536 * Default User Interface (UI) is CLIUIFactory when bzr runs in a dumb
3537 terminal. It is sometimes desirable do override this default by forcing
3538 bzr to use TextUIFactory. This can be achieved by setting the
3539 BZR_USE_TEXT_UI environment variable (emacs shells, as opposed to
3540 compile buffers, are such an example).
3541 (Vincent Ladeuil)
3542
3543 * New API ``Branch.iter_merge_sorted_revisions()`` that iterates over
3544 ``(revision_id, depth, revno, end_of_merge)`` tuples.
3545 (Ian Clatworthy)
3546
3547 * New ``Branch.dotted_revno_to_revision_id()`` and
3548 ``Branch.revision_id_to_dotted_revno()`` APIs that pick the most
3549 efficient way of doing the mapping.
3550 (Ian Clatworthy)
3551
3552 * Refactor cmd_serve so that it's a little easier to build commands that
3553 extend it, and perhaps even a bit easier to read. (Jonathan Lange)
3554
3555 * ``TreeDelta.show()`` now accepts a ``filter`` parameter allowing log
3556 formatters to retrict the output.
3557 (Vincent Ladeuil)
3558
3559
3560bzr 1.11 "Eyes up!" 2009-01-19
3561------------------------------
3562>>>>>>> MERGE-SOURCE
33633563
3364This first monthly release of Bazaar for 2009 improves Bazaar's operation3564This first monthly release of Bazaar for 2009 improves Bazaar's operation
3365in Windows, Mac OS X, and other situations where file names are matched3565in Windows, Mac OS X, and other situations where file names are matched
33663566
=== modified file 'bzrlib/builtins.py'
--- bzrlib/builtins.py 2009-12-23 05:42:33 +0000
+++ bzrlib/builtins.py 2010-01-05 03:39:25 +0000
@@ -5493,22 +5493,42 @@
5493 that of the master.5493 that of the master.
5494 """5494 """
54955495
5496 takes_args = ['to_location']5496 takes_args = ['to_location?']
5497 takes_options = [Option('force',5497 takes_options = [Option('force',
5498<<<<<<< TREE
5498 help='Switch even if local commits will be lost.'),5499 help='Switch even if local commits will be lost.'),
5499 Option('create-branch', short_name='b',5500 Option('create-branch', short_name='b',
5500 help='Create the target branch from this one before'5501 help='Create the target branch from this one before'
5501 ' switching to it.'),5502 ' switching to it.'),
5503=======
5504 help='Switch even if local commits will be lost.'),
5505 'revision'
5506>>>>>>> MERGE-SOURCE
5502 ]5507 ]
55035508
5509<<<<<<< TREE
5504 def run(self, to_location, force=False, create_branch=False):5510 def run(self, to_location, force=False, create_branch=False):
5511=======
5512 def run(self, to_location=None, force=False, revision=None):
5513>>>>>>> MERGE-SOURCE
5505 from bzrlib import switch5514 from bzrlib import switch
5506 tree_location = '.'5515 tree_location = '.'
5516 revision = _get_one_revision('switch', revision)
5507 control_dir = bzrdir.BzrDir.open_containing(tree_location)[0]5517 control_dir = bzrdir.BzrDir.open_containing(tree_location)[0]
5518<<<<<<< TREE
5519=======
5520 branch = control_dir.open_branch()
5521 if to_location is None:
5522 if revision is None:
5523 raise errors.BzrCommandError('You must supply either a'
5524 ' revision or a location')
5525 to_location = '.'
5526>>>>>>> MERGE-SOURCE
5508 try:5527 try:
5509 branch = control_dir.open_branch()5528 branch = control_dir.open_branch()
5510 had_explicit_nick = branch.get_config().has_explicit_nickname()5529 had_explicit_nick = branch.get_config().has_explicit_nickname()
5511 except errors.NotBranchError:5530 except errors.NotBranchError:
5531<<<<<<< TREE
5512 branch = None5532 branch = None
5513 had_explicit_nick = False5533 had_explicit_nick = False
5514 if create_branch:5534 if create_branch:
@@ -5540,6 +5560,20 @@
5540 urlutils.join(this_url, '..', to_location))5560 urlutils.join(this_url, '..', to_location))
5541 switch.switch(control_dir, to_branch, force)5561 switch.switch(control_dir, to_branch, force)
5542 if had_explicit_nick:5562 if had_explicit_nick:
5563=======
5564 this_branch = control_dir.open_branch()
5565 # This may be a heavy checkout, where we want the master branch
5566 this_url = this_branch.get_bound_location()
5567 # If not, use a local sibling
5568 if this_url is None:
5569 this_url = this_branch.base
5570 to_branch = Branch.open(
5571 urlutils.join(this_url, '..', to_location))
5572 if revision is not None:
5573 revision = revision.as_revision_id(to_branch)
5574 switch.switch(control_dir, to_branch, force, revision)
5575 if branch.get_config().has_explicit_nickname():
5576>>>>>>> MERGE-SOURCE
5543 branch = control_dir.open_branch() #get the new branch!5577 branch = control_dir.open_branch() #get the new branch!
5544 branch.nick = to_branch.nick5578 branch.nick = to_branch.nick
5545 note('Switched to branch: %s',5579 note('Switched to branch: %s',
55465580
=== modified file 'bzrlib/switch.py'
--- bzrlib/switch.py 2009-06-19 21:16:31 +0000
+++ bzrlib/switch.py 2010-01-05 03:39:25 +0000
@@ -22,7 +22,11 @@
22from bzrlib.trace import note22from bzrlib.trace import note
2323
2424
25<<<<<<< TREE
25def switch(control_dir, to_branch, force=False, quiet=False):26def switch(control_dir, to_branch, force=False, quiet=False):
27=======
28def switch(control_dir, to_branch, force=False, revision_id=None):
29>>>>>>> MERGE-SOURCE
26 """Switch the branch associated with a checkout.30 """Switch the branch associated with a checkout.
2731
28 :param control_dir: BzrDir of the checkout to change32 :param control_dir: BzrDir of the checkout to change
@@ -36,7 +40,11 @@
36 source_repository = to_branch.repository40 source_repository = to_branch.repository
37 _set_branch_location(control_dir, to_branch, force)41 _set_branch_location(control_dir, to_branch, force)
38 tree = control_dir.open_workingtree()42 tree = control_dir.open_workingtree()
43<<<<<<< TREE
39 _update(tree, source_repository, quiet)44 _update(tree, source_repository, quiet)
45=======
46 _update(tree, source_repository, revision_id)
47>>>>>>> MERGE-SOURCE
4048
4149
42def _check_pending_merges(control, force=False):50def _check_pending_merges(control, force=False):
@@ -118,7 +126,11 @@
118 return False126 return False
119127
120128
129<<<<<<< TREE
121def _update(tree, source_repository, quiet=False):130def _update(tree, source_repository, quiet=False):
131=======
132def _update(tree, source_repository, revision_id=None):
133>>>>>>> MERGE-SOURCE
122 """Update a working tree to the latest revision of its branch.134 """Update a working tree to the latest revision of its branch.
123135
124 :param tree: the working tree136 :param tree: the working tree
@@ -127,14 +139,27 @@
127 tree.lock_tree_write()139 tree.lock_tree_write()
128 try:140 try:
129 to_branch = tree.branch141 to_branch = tree.branch
142<<<<<<< TREE
130 if tree.last_revision() == to_branch.last_revision():143 if tree.last_revision() == to_branch.last_revision():
131 if not quiet:144 if not quiet:
132 note("Tree is up to date at revision %d.", to_branch.revno())145 note("Tree is up to date at revision %d.", to_branch.revno())
146=======
147 if revision_id is None:
148 revision_id = to_branch.last_revision()
149 if tree.last_revision() == revision_id:
150 note("Tree is up to date at revision %d.", to_branch.revno())
151>>>>>>> MERGE-SOURCE
133 return152 return
134 base_tree = source_repository.revision_tree(tree.last_revision())153 base_tree = source_repository.revision_tree(tree.last_revision())
154<<<<<<< TREE
135 merge.Merge3Merger(tree, tree, base_tree, to_branch.basis_tree())155 merge.Merge3Merger(tree, tree, base_tree, to_branch.basis_tree())
136 tree.set_last_revision(to_branch.last_revision())156 tree.set_last_revision(to_branch.last_revision())
137 if not quiet:157 if not quiet:
138 note('Updated to revision %d.' % to_branch.revno())158 note('Updated to revision %d.' % to_branch.revno())
159=======
160 merge.Merge3Merger(tree, tree, base_tree, to_branch.repository.revision_tree(revision_id))
161 tree.set_last_revision(revision_id)
162 note('Updated to revision %d.' % to_branch.revno())
163>>>>>>> MERGE-SOURCE
139 finally:164 finally:
140 tree.unlock()165 tree.unlock()
141166
=== modified file 'bzrlib/tests/blackbox/test_switch.py'
--- bzrlib/tests/blackbox/test_switch.py 2009-12-11 17:04:09 +0000
+++ bzrlib/tests/blackbox/test_switch.py 2010-01-05 03:39:25 +0000
@@ -27,6 +27,15 @@
2727
28class TestSwitch(ExternalBase):28class TestSwitch(ExternalBase):
2929
30 def _create_sample_tree(self):
31 tree = self.make_branch_and_tree('branch-1')
32 self.build_tree(['branch-1/file-1', 'branch-1/file-2'])
33 tree.add('file-1')
34 tree.commit('rev1')
35 tree.add('file-2')
36 tree.commit('rev2')
37 return tree
38
30 def test_switch_up_to_date_light_checkout(self):39 def test_switch_up_to_date_light_checkout(self):
31 self.make_branch_and_tree('branch')40 self.make_branch_and_tree('branch')
32 self.run_bzr('branch branch branch2')41 self.run_bzr('branch branch branch2')
@@ -134,6 +143,7 @@
134 self.run_bzr(['switch', 'branchb'], working_dir='heavyco/a')143 self.run_bzr(['switch', 'branchb'], working_dir='heavyco/a')
135 self.assertEqual(branchb_id, checkout.last_revision())144 self.assertEqual(branchb_id, checkout.last_revision())
136 self.assertEqual(tree2.branch.base, checkout.branch.get_bound_location())145 self.assertEqual(tree2.branch.base, checkout.branch.get_bound_location())
146<<<<<<< TREE
137147
138 def prepare_lightweight_switch(self):148 def prepare_lightweight_switch(self):
139 branch = self.make_branch('branch')149 branch = self.make_branch('branch')
@@ -197,3 +207,25 @@
197 tree = WorkingTree.open('tree')207 tree = WorkingTree.open('tree')
198 self.assertEndsWith(tree.branch.base, 'foo-branch2/')208 self.assertEndsWith(tree.branch.base, 'foo-branch2/')
199209
210=======
211
212 def test_switch_revision(self):
213 tree = self._create_sample_tree()
214 checkout = tree.branch.create_checkout('checkout', lightweight=True)
215 self.run_bzr(['switch', 'branch-1', '-r1'], working_dir='checkout')
216 self.failUnlessExists('checkout/file-1')
217 self.failIfExists('checkout/file-2')
218
219 def test_switch_only_revision(self):
220 tree = self._create_sample_tree()
221 checkout = tree.branch.create_checkout('checkout', lightweight=True)
222 self.failUnlessExists('checkout/file-1')
223 self.failUnlessExists('checkout/file-2')
224 self.run_bzr(['switch', '-r1'], working_dir='checkout')
225 self.failUnlessExists('checkout/file-1')
226 self.failIfExists('checkout/file-2')
227 # Check that we don't accept a range
228 self.run_bzr_error(
229 ['bzr switch --revision takes exactly one revision identifier'],
230 ['switch', '-r0..2'], working_dir='checkout')
231>>>>>>> MERGE-SOURCE
200232
=== modified file 'bzrlib/tests/test_switch.py'
--- bzrlib/tests/test_switch.py 2009-05-07 05:08:46 +0000
+++ bzrlib/tests/test_switch.py 2010-01-05 03:39:25 +0000
@@ -100,6 +100,23 @@
100 self.assertContainsRe(str(err),100 self.assertContainsRe(str(err),
101 "Pending merges must be committed or reverted before using switch")101 "Pending merges must be committed or reverted before using switch")
102102
103 def test_switch_with_revision(self):
104 """Test switch when a revision is given."""
105 # Create a tree with 2 revisions
106 tree = self.make_branch_and_tree('branch-1')
107 self.build_tree(['branch-1/file-1'])
108 tree.add('file-1')
109 tree.commit(rev_id='rev1', message='rev1')
110 self.build_tree(['branch-1/file-2'])
111 tree.add('file-2')
112 tree.commit(rev_id='rev2', message='rev2')
113 # Check it out and switch to revision 1
114 checkout = tree.branch.create_checkout('checkout',
115 lightweight=self.lightweight)
116 switch.switch(checkout.bzrdir, tree.branch, revision_id="rev1")
117 self.failUnlessExists('checkout/file-1')
118 self.failIfExists('checkout/file-2')
119
103120
104class TestSwitchHeavyweight(TestSwitch):121class TestSwitchHeavyweight(TestSwitch):
105122