/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_push.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2006-2012 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
"""Black-box tests for brz push."""
 
18
"""Black-box tests for bzr push."""
19
19
 
20
20
import re
21
21
 
22
 
from breezy import (
 
22
from bzrlib import (
23
23
    branch,
 
24
    bzrdir,
24
25
    controldir,
25
26
    errors,
26
27
    osutils,
30
31
    urlutils,
31
32
    workingtree
32
33
    )
33
 
from breezy.bzr import (
34
 
    bzrdir,
35
 
    )
36
 
from breezy.bzr import knitrepo
37
 
from breezy.tests import (
 
34
from bzrlib.repofmt import knitrepo
 
35
from bzrlib.tests import (
38
36
    http_server,
39
37
    scenarios,
40
38
    script,
41
39
    test_foreign,
42
40
    )
43
 
from breezy.tests.matchers import ContainsNoVfsCalls
44
 
from breezy.transport import memory
 
41
from bzrlib.tests.matchers import ContainsNoVfsCalls
 
42
from bzrlib.transport import memory
45
43
 
46
44
 
47
45
load_tests = scenarios.load_tests_apply_scenarios
67
65
 
68
66
        # If there is no parent location set, :parent isn't mentioned.
69
67
        out = self.run_bzr('push', working_dir='a', retcode=3)
70
 
        self.assertEqual(out,
71
 
                ('', 'brz: ERROR: No push location known or specified.\n'))
 
68
        self.assertEquals(out,
 
69
                ('','bzr: ERROR: No push location known or specified.\n'))
72
70
 
73
71
        # If there is a parent location set, the error suggests :parent.
74
72
        tree_a.branch.set_parent(tree_b.branch.base)
75
73
        out = self.run_bzr('push', working_dir='a', retcode=3)
76
 
        self.assertEqual(out,
77
 
            ('', 'brz: ERROR: No push location known or specified. '
 
74
        self.assertEquals(out,
 
75
            ('','bzr: ERROR: No push location known or specified. '
78
76
                'To push to the parent branch '
79
 
                '(at %s), use \'brz push :parent\'.\n' %
 
77
                '(at %s), use \'bzr push :parent\'.\n' %
80
78
                urlutils.unescape_for_display(tree_b.branch.base, 'utf-8')))
81
79
 
82
80
    def test_push_remember(self):
87
85
        self.build_tree(['branch_a/a'])
88
86
        tree_a.add('a')
89
87
        tree_a.commit('commit a')
90
 
        tree_b = branch_a.controldir.sprout('branch_b').open_workingtree()
 
88
        tree_b = branch_a.bzrdir.sprout('branch_b').open_workingtree()
91
89
        branch_b = tree_b.branch
92
 
        tree_c = branch_a.controldir.sprout('branch_c').open_workingtree()
 
90
        tree_c = branch_a.bzrdir.sprout('branch_c').open_workingtree()
93
91
        branch_c = tree_c.branch
94
92
        self.build_tree(['branch_a/b'])
95
93
        tree_a.add('b')
102
100
 
103
101
        # test push for failure without push location set
104
102
        out = self.run_bzr('push', working_dir='branch_a', retcode=3)
105
 
        self.assertEqual(out,
106
 
                ('', 'brz: ERROR: No push location known or specified.\n'))
 
103
        self.assertEquals(out,
 
104
                ('','bzr: ERROR: No push location known or specified.\n'))
107
105
 
108
106
        # test not remembered if cannot actually push
109
107
        self.run_bzr('push path/which/doesnt/exist',
110
108
                     working_dir='branch_a', retcode=3)
111
109
        out = self.run_bzr('push', working_dir='branch_a', retcode=3)
112
 
        self.assertEqual(
113
 
                ('', 'brz: ERROR: No push location known or specified.\n'),
 
110
        self.assertEquals(
 
111
                ('', 'bzr: ERROR: No push location known or specified.\n'),
114
112
                out)
115
113
 
116
114
        # test implicit --remember when no push location set, push fails
117
115
        out = self.run_bzr('push ../branch_b',
118
116
                           working_dir='branch_a', retcode=3)
119
 
        self.assertEqual(out,
120
 
                ('', 'brz: ERROR: These branches have diverged.  '
121
 
                 'See "brz help diverged-branches" for more information.\n'))
 
117
        self.assertEquals(out,
 
118
                ('','bzr: ERROR: These branches have diverged.  '
 
119
                 'See "bzr help diverged-branches" for more information.\n'))
122
120
        # Refresh the branch as 'push' modified it
123
 
        branch_a = branch_a.controldir.open_branch()
124
 
        self.assertEqual(osutils.abspath(branch_a.get_push_location()),
125
 
                          osutils.abspath(branch_b.controldir.root_transport.base))
 
121
        branch_a = branch_a.bzrdir.open_branch()
 
122
        self.assertEquals(osutils.abspath(branch_a.get_push_location()),
 
123
                          osutils.abspath(branch_b.bzrdir.root_transport.base))
126
124
 
127
125
        # test implicit --remember after resolving previous failure
128
126
        uncommit.uncommit(branch=branch_b, tree=tree_b)
129
127
        transport.delete('branch_b/c')
130
128
        out, err = self.run_bzr('push', working_dir='branch_a')
131
129
        # Refresh the branch as 'push' modified it
132
 
        branch_a = branch_a.controldir.open_branch()
 
130
        branch_a = branch_a.bzrdir.open_branch()
133
131
        path = branch_a.get_push_location()
134
132
        self.assertEqual(err,
135
133
                         'Using saved push location: %s\n'
137
135
                         'Pushed up to revision 2.\n'
138
136
                         % urlutils.local_path_from_url(path))
139
137
        self.assertEqual(path,
140
 
                         branch_b.controldir.root_transport.base)
 
138
                         branch_b.bzrdir.root_transport.base)
141
139
        # test explicit --remember
142
140
        self.run_bzr('push ../branch_c --remember', working_dir='branch_a')
143
141
        # Refresh the branch as 'push' modified it
144
 
        branch_a = branch_a.controldir.open_branch()
145
 
        self.assertEqual(branch_a.get_push_location(),
146
 
                          branch_c.controldir.root_transport.base)
 
142
        branch_a = branch_a.bzrdir.open_branch()
 
143
        self.assertEquals(branch_a.get_push_location(),
 
144
                          branch_c.bzrdir.root_transport.base)
147
145
 
148
146
    def test_push_without_tree(self):
149
 
        # brz push from a branch that does not have a checkout should work.
 
147
        # bzr push from a branch that does not have a checkout should work.
150
148
        b = self.make_branch('.')
151
149
        out, err = self.run_bzr('push pushed-location')
152
150
        self.assertEqual('', out)
155
153
        self.assertEndsWith(b2.base, 'pushed-location/')
156
154
 
157
155
    def test_push_no_tree(self):
158
 
        # brz push --no-tree of a branch with working trees
 
156
        # bzr push --no-tree of a branch with working trees
159
157
        b = self.make_branch_and_tree('push-from')
160
158
        self.build_tree(['push-from/file'])
161
159
        b.add('file')
166
164
        self.assertPathDoesNotExist('push-to/file')
167
165
 
168
166
    def test_push_new_branch_revision_count(self):
169
 
        # brz push of a branch with revisions to a new location
 
167
        # bzr push of a branch with revisions to a new location
170
168
        # should print the number of revisions equal to the length of the
171
169
        # local branch.
172
170
        t = self.make_branch_and_tree('tree')
185
183
        t.commit('commit 1')
186
184
        self.run_bzr('push -d tree pushed-to')
187
185
        # Refresh the branch as 'push' modified it and get the push location
188
 
        push_loc = t.branch.controldir.open_branch().get_push_location()
 
186
        push_loc = t.branch.bzrdir.open_branch().get_push_location()
189
187
        out, err = self.run_bzr('push', working_dir="tree")
190
188
        self.assertEqual('Using saved push location: %s\n'
191
189
                         'No new revisions or tags to push.\n' %
202
200
        shared_repo.set_make_working_trees(True)
203
201
 
204
202
        def make_shared_tree(path):
205
 
            shared_repo.controldir.root_transport.mkdir(path)
 
203
            shared_repo.bzrdir.root_transport.mkdir(path)
206
204
            controldir.ControlDir.create_branch_convenience('repo/' + path)
207
205
            return workingtree.WorkingTree.open('repo/' + path)
208
206
        tree_a = make_shared_tree('a')
209
207
        self.build_tree(['repo/a/file'])
210
208
        tree_a.add('file')
211
 
        tree_a.commit('commit a-1', rev_id=b'a-1')
 
209
        tree_a.commit('commit a-1', rev_id='a-1')
212
210
        f = open('repo/a/file', 'ab')
213
211
        f.write('more stuff\n')
214
212
        f.close()
215
 
        tree_a.commit('commit a-2', rev_id=b'a-2')
 
213
        tree_a.commit('commit a-2', rev_id='a-2')
216
214
 
217
215
        tree_b = make_shared_tree('b')
218
216
        self.build_tree(['repo/b/file'])
219
217
        tree_b.add('file')
220
 
        tree_b.commit('commit b-1', rev_id=b'b-1')
 
218
        tree_b.commit('commit b-1', rev_id='b-1')
221
219
 
222
220
        self.assertTrue(shared_repo.has_revision('a-1'))
223
221
        self.assertTrue(shared_repo.has_revision('a-2'))
254
252
        target_repo = self.make_repository('target')
255
253
        source = self.make_branch_builder('source')
256
254
        source.start_series()
257
 
        source.build_snapshot(None, [
258
 
            ('add', ('', 'root-id', 'directory', None))],
259
 
            revision_id=b'A')
260
 
        source.build_snapshot(['A'], [], revision_id=b'B')
261
 
        source.build_snapshot(['A'], [], revision_id=b'C')
 
255
        source.build_snapshot('A', None, [
 
256
            ('add', ('', 'root-id', 'directory', None))])
 
257
        source.build_snapshot('B', ['A'], [])
 
258
        source.build_snapshot('C', ['A'], [])
262
259
        source.finish_series()
263
260
        self.run_bzr('push target -d source')
264
261
        self.addCleanup(target_repo.lock_read().unlock)
285
282
        self.setup_smart_server_with_call_log()
286
283
        parent = self.make_branch_and_tree('parent', format='1.9')
287
284
        parent.commit(message='first commit')
288
 
        local = parent.controldir.sprout('local').open_workingtree()
 
285
        local = parent.bzrdir.sprout('local').open_workingtree()
289
286
        local.commit(message='local commit')
290
287
        self.reset_smart_call_log()
291
288
        self.run_bzr(['push', '--stacked', '--stacked-on', '../parent',
341
338
        # stacked_on_url is that exact path segment. Added to nail bug 385132.
342
339
        self.setup_smart_server_with_call_log()
343
340
        self.make_branch('stack-on', format='1.9')
344
 
        self.make_controldir('.').get_config().set_default_stack_on(
 
341
        self.make_bzrdir('.').get_config().set_default_stack_on(
345
342
            '/stack-on')
346
343
        self.make_branch('from', format='1.9')
347
344
        out, err = self.run_bzr(['push', '-d', 'from', self.get_url('to')])
354
351
        # stacked_on_url is a relative path. Added to nail bug 385132.
355
352
        self.setup_smart_server_with_call_log()
356
353
        self.make_branch('stack-on', format='1.9')
357
 
        self.make_controldir('.').get_config().set_default_stack_on('stack-on')
 
354
        self.make_bzrdir('.').get_config().set_default_stack_on('stack-on')
358
355
        self.make_branch('from', format='1.9')
359
356
        out, err = self.run_bzr(['push', '-d', 'from', self.get_url('to')])
360
357
        b = branch.Branch.open(self.get_url('to'))
363
360
    def create_simple_tree(self):
364
361
        tree = self.make_branch_and_tree('tree')
365
362
        self.build_tree(['tree/a'])
366
 
        tree.add(['a'], [b'a-id'])
367
 
        tree.commit('one', rev_id=b'r1')
 
363
        tree.add(['a'], ['a-id'])
 
364
        tree.commit('one', rev_id='r1')
368
365
        return tree
369
366
 
370
367
    def test_push_create_prefix(self):
371
 
        """'brz push --create-prefix' will create leading directories."""
 
368
        """'bzr push --create-prefix' will create leading directories."""
372
369
        tree = self.create_simple_tree()
373
370
 
374
371
        self.run_bzr_error(['Parent directory of ../new/tree does not exist'],
381
378
        self.assertPathExists('new/tree/a')
382
379
 
383
380
    def test_push_use_existing(self):
384
 
        """'brz push --use-existing-dir' can push into an existing dir.
 
381
        """'bzr push --use-existing-dir' can push into an existing dir.
385
382
 
386
 
        By default, 'brz push' will not use an existing, non-versioned dir.
 
383
        By default, 'bzr push' will not use an existing, non-versioned dir.
387
384
        """
388
385
        tree = self.create_simple_tree()
389
386
        self.build_tree(['target/'])
402
399
        self.assertPathExists('target/a')
403
400
 
404
401
    def test_push_use_existing_into_empty_bzrdir(self):
405
 
        """'brz push --use-existing-dir' into a dir with an empty .bzr dir
 
402
        """'bzr push --use-existing-dir' into a dir with an empty .bzr dir
406
403
        fails.
407
404
        """
408
405
        tree = self.create_simple_tree()
413
410
            'push ../target --use-existing-dir', working_dir='tree')
414
411
 
415
412
    def test_push_onto_repo(self):
416
 
        """We should be able to 'brz push' into an existing bzrdir."""
 
413
        """We should be able to 'bzr push' into an existing bzrdir."""
417
414
        tree = self.create_simple_tree()
418
415
        repo = self.make_repository('repo', shared=True)
419
416
 
436
433
        # TODO: jam 20070109 Maybe it would be better to create the repository
437
434
        #       if at this point
438
435
        tree = self.create_simple_tree()
439
 
        a_controldir = self.make_controldir('dir')
 
436
        a_bzrdir = self.make_bzrdir('dir')
440
437
 
441
438
        self.run_bzr_error(['At ../dir you have a valid .bzr control'],
442
439
                'push ../dir',
459
456
            tree_to.changes_from(tree_to.basis_tree()).has_changed())
460
457
 
461
458
        self.run_bzr_error(
462
 
            ['brz: ERROR: brz push --revision '
 
459
            ['bzr: ERROR: bzr push --revision '
463
460
             'takes exactly one revision identifier\n'],
464
461
            'push -r0..2 ../to', working_dir='from')
465
462
 
542
539
 
543
540
    def test_push_notifies_default_stacking(self):
544
541
        self.make_branch('stack_on', format='1.6')
545
 
        self.make_controldir('.').get_config().set_default_stack_on('stack_on')
 
542
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
546
543
        self.make_branch('from', format='1.6')
547
544
        out, err = self.run_bzr('push -d from to')
548
545
        self.assertContainsRe(err,
550
547
 
551
548
    def test_push_stacks_with_default_stacking_if_target_is_stackable(self):
552
549
        self.make_branch('stack_on', format='1.6')
553
 
        self.make_controldir('.').get_config().set_default_stack_on('stack_on')
 
550
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
554
551
        self.make_branch('from', format='pack-0.92')
555
552
        out, err = self.run_bzr('push -d from to')
556
553
        b = branch.Branch.open('to')
558
555
 
559
556
    def test_push_does_not_change_format_with_default_if_target_cannot(self):
560
557
        self.make_branch('stack_on', format='pack-0.92')
561
 
        self.make_controldir('.').get_config().set_default_stack_on('stack_on')
 
558
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
562
559
        self.make_branch('from', format='pack-0.92')
563
560
        out, err = self.run_bzr('push -d from to')
564
561
        b = branch.Branch.open('to')
565
 
        self.assertRaises(branch.UnstackableBranchFormat, b.get_stacked_on_url)
 
562
        self.assertRaises(errors.UnstackableBranchFormat, b.get_stacked_on_url)
566
563
 
567
564
    def test_push_doesnt_create_broken_branch(self):
568
565
        """Pushing a new standalone branch works even when there's a default
575
572
        self.make_repository('repo', shared=True, format='1.6')
576
573
        builder = self.make_branch_builder('repo/local', format='pack-0.92')
577
574
        builder.start_series()
578
 
        builder.build_snapshot(None, [
 
575
        builder.build_snapshot('rev-1', None, [
579
576
            ('add', ('', 'root-id', 'directory', '')),
580
 
            ('add', ('filename', 'f-id', 'file', 'content\n'))],
581
 
            revision_id=b'rev-1')
582
 
        builder.build_snapshot([b'rev-1'], [], revision_id=b'rev-2')
583
 
        builder.build_snapshot([b'rev-2'],
584
 
            [('modify', ('filename', b'new-content\n'))],
585
 
            revision_id=b'rev-3')
 
577
            ('add', ('filename', 'f-id', 'file', 'content\n'))])
 
578
        builder.build_snapshot('rev-2', ['rev-1'], [])
 
579
        builder.build_snapshot('rev-3', ['rev-2'],
 
580
            [('modify', ('f-id', 'new-content\n'))])
586
581
        builder.finish_series()
587
582
        branch = builder.get_branch()
588
583
        # Push rev-1 to "trunk", so that we can stack on it.
589
584
        self.run_bzr('push -d repo/local trunk -r 1')
590
585
        # Set a default stacking policy so that new branches will automatically
591
586
        # stack on trunk.
592
 
        self.make_controldir('.').get_config().set_default_stack_on('trunk')
 
587
        self.make_bzrdir('.').get_config().set_default_stack_on('trunk')
593
588
        # Push rev-2 to a new branch "remote".  It will be stacked on "trunk".
594
589
        out, err = self.run_bzr('push -d repo/local remote -r 2')
595
590
        self.assertContainsRe(
628
623
        to_tree.branch.tags.set_tag("mytag", "anotherrevid")
629
624
        revid1 = to_tree.commit('my commit')
630
625
        out = self.run_bzr(['push', '-d', 'from', 'to'])
631
 
        self.assertEqual(out,
 
626
        self.assertEquals(out,
632
627
            ('Conflicting tags:\n    mytag\n', 'No new revisions to push.\n'))
633
628
        out = self.run_bzr(['push', '-d', 'from', '--overwrite-tags', 'to'])
634
 
        self.assertEqual(out, ('', '1 tag updated.\n'))
635
 
        self.assertEqual(to_tree.branch.tags.lookup_tag('mytag'),
 
629
        self.assertEquals(out, ('', '1 tag updated.\n'))
 
630
        self.assertEquals(to_tree.branch.tags.lookup_tag('mytag'),
636
631
                          'somerevid')
637
 
        self.assertEqual(to_tree.branch.last_revision(), revid1)
 
632
        self.assertEquals(to_tree.branch.last_revision(), revid1)
638
633
 
639
634
 
640
635
class RedirectingMemoryTransport(memory.MemoryTransport):
727
722
 
728
723
    def make_local_branch_and_tree(self):
729
724
        self.tree = self.make_branch_and_tree('local')
730
 
        self.build_tree_contents([('local/file', b'initial')])
 
725
        self.build_tree_contents([('local/file', 'initial')])
731
726
        self.tree.add('file')
732
 
        self.tree.commit('adding file', rev_id=b'added')
733
 
        self.build_tree_contents([('local/file', b'modified')])
734
 
        self.tree.commit('modify file', rev_id=b'modified')
 
727
        self.tree.commit('adding file', rev_id='added')
 
728
        self.build_tree_contents([('local/file', 'modified')])
 
729
        self.tree.commit('modify file', rev_id='modified')
735
730
 
736
731
    def set_config_push_strict(self, value):
737
732
        br = branch.Branch.open('local')
740
735
    _default_command = ['push', '../to']
741
736
    _default_wd = 'local'
742
737
    _default_errors = ['Working tree ".*/local/" has uncommitted '
743
 
                       'changes \\(See brz status\\)\\.',]
 
738
                       'changes \(See bzr status\)\.',]
744
739
    _default_additional_error = 'Use --no-strict to force the push.\n'
745
740
    _default_additional_warning = 'Uncommitted changes will not be pushed.'
746
741
 
823
818
    def _uncommitted_changes(self):
824
819
        self.make_local_branch_and_tree()
825
820
        # Make a change without committing it
826
 
        self.build_tree_contents([('local/file', b'in progress')])
 
821
        self.build_tree_contents([('local/file', 'in progress')])
827
822
 
828
823
    def _pending_merges(self):
829
824
        self.make_local_branch_and_tree()
830
825
        # Create 'other' branch containing a new file
831
 
        other_bzrdir = self.tree.controldir.sprout('other')
 
826
        other_bzrdir = self.tree.bzrdir.sprout('other')
832
827
        other_tree = other_bzrdir.open_workingtree()
833
 
        self.build_tree_contents([('other/other-file', b'other')])
 
828
        self.build_tree_contents([('other/other-file', 'other')])
834
829
        other_tree.add('other-file')
835
 
        other_tree.commit('other commit', rev_id=b'other')
 
830
        other_tree.commit('other commit', rev_id='other')
836
831
        # Merge and revert, leaving a pending merge
837
832
        self.tree.merge_from_branch(other_tree.branch)
838
833
        self.tree.revert(filenames=['other-file'], backups=False)
841
836
        self.make_local_branch_and_tree()
842
837
        self.run_bzr(['checkout', '--lightweight', 'local', 'checkout'])
843
838
        # Make a change and commit it
844
 
        self.build_tree_contents([('local/file', b'modified in local')])
845
 
        self.tree.commit('modify file', rev_id=b'modified-in-local')
 
839
        self.build_tree_contents([('local/file', 'modified in local')])
 
840
        self.tree.commit('modify file', rev_id='modified-in-local')
846
841
        # Exercise commands from the checkout directory
847
842
        self._default_wd = 'checkout'
848
843
        self._default_errors = ["Working tree is out of date, please run"
849
 
                                " 'brz update'\\.",]
 
844
                                " 'bzr update'\.",]
850
845
 
851
846
    def test_push_default(self):
852
847
        self.assertPushSucceeds([], with_warning=True)
888
883
    def make_dummy_builder(self, relpath):
889
884
        builder = self.make_branch_builder(
890
885
            relpath, format=test_foreign.DummyForeignVcsDirFormat())
891
 
        builder.build_snapshot(None,
892
 
            [('add', ('', b'TREE_ROOT', 'directory', None)),
893
 
             ('add', ('foo', b'fooid', 'file', 'bar'))],
894
 
            revision_id=b'revid')
 
886
        builder.build_snapshot('revid', None,
 
887
            [('add', ('', 'TREE_ROOT', 'directory', None)),
 
888
             ('add', ('foo', 'fooid', 'file', 'bar'))])
895
889
        return builder
896
890
 
897
891
    def test_no_roundtripping(self):
898
892
        target_branch = self.make_dummy_builder('dp').get_branch()
899
893
        source_tree = self.make_branch_and_tree("dc")
900
894
        output, error = self.run_bzr("push -d dc dp", retcode=3)
901
 
        self.assertEqual("", output)
902
 
        self.assertEqual(error, "brz: ERROR: It is not possible to losslessly"
 
895
        self.assertEquals("", output)
 
896
        self.assertEquals(error, "bzr: ERROR: It is not possible to losslessly"
903
897
            " push to dummy. You may want to use dpush instead.\n")
904
898
 
905
899
 
907
901
 
908
902
    def test_push_log_format(self):
909
903
        self.run_script("""
910
 
            $ brz init trunk
 
904
            $ bzr init trunk
911
905
            Created a standalone tree (format: 2a)
912
906
            $ cd trunk
913
907
            $ echo foo > file
914
 
            $ brz add
 
908
            $ bzr add
915
909
            adding file
916
 
            $ brz commit -m 'we need some foo'
 
910
            $ bzr commit -m 'we need some foo'
917
911
            2>Committing to:...trunk/
918
912
            2>added file
919
913
            2>Committed revision 1.
920
 
            $ brz init ../feature
 
914
            $ bzr init ../feature
921
915
            Created a standalone tree (format: 2a)
922
 
            $ brz push -v ../feature -Olog_format=line
 
916
            $ bzr push -v ../feature -Olog_format=line
923
917
            Added Revisions:
924
918
            1: jrandom@example.com ...we need some foo
925
919
            2>All changes applied successfully.
928
922
 
929
923
    def test_push_with_revspec(self):
930
924
        self.run_script("""
931
 
            $ brz init-repo .
 
925
            $ bzr init-repo .
932
926
            Shared repository with trees (format: 2a)
933
927
            Location:
934
928
              shared repository: .
935
 
            $ brz init trunk
 
929
            $ bzr init trunk
936
930
            Created a repository tree (format: 2a)
937
931
            Using shared repository...
938
932
            $ cd trunk
939
 
            $ brz commit -m 'first rev' --unchanged
 
933
            $ bzr commit -m 'first rev' --unchanged
940
934
            2>Committing to:...trunk/
941
935
            2>Committed revision 1.
942
936
            $ echo foo > file
943
 
            $ brz add
 
937
            $ bzr add
944
938
            adding file
945
 
            $ brz commit -m 'we need some foo'
 
939
            $ bzr commit -m 'we need some foo'
946
940
            2>Committing to:...trunk/
947
941
            2>added file
948
942
            2>Committed revision 2.
949
 
            $ brz push -r 1 ../other
 
943
            $ bzr push -r 1 ../other
950
944
            2>Created new branch.
951
 
            $ brz st ../other # checking that file is not created (#484516)
 
945
            $ bzr st ../other # checking that file is not created (#484516)
952
946
            """)