~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-10-09 13:52:06 UTC
  • mfrom: (6202.1.3 revno-revision)
  • Revision ID: pqm@pqm.ubuntu.com-20111009135206-t3utsln6mtzv9eut
(jelmer) Add a --revision argument to 'bzr revno'. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    blackbox,
36
36
    http_server,
37
37
    scenarios,
 
38
    script,
38
39
    test_foreign,
39
40
    test_server,
40
41
    )
104
105
        transport.delete('branch_b/c')
105
106
        out, err = self.run_bzr('push', working_dir='branch_a')
106
107
        path = branch_a.get_push_location()
107
 
        self.assertEquals(out,
108
 
                          'Using saved push location: %s\n'
109
 
                          % urlutils.local_path_from_url(path))
110
108
        self.assertEqual(err,
 
109
                         'Using saved push location: %s\n'
111
110
                         'All changes applied successfully.\n'
112
 
                         'Pushed up to revision 2.\n')
 
111
                         'Pushed up to revision 2.\n'
 
112
                         % urlutils.local_path_from_url(path))
113
113
        self.assertEqual(path,
114
114
                         branch_b.bzrdir.root_transport.base)
115
115
        # test explicit --remember
149
149
        self.assertEqual('', out)
150
150
        self.assertEqual('Created new branch.\n', err)
151
151
 
 
152
    def test_push_quiet(self):
 
153
        # test that using -q makes output quiet
 
154
        t = self.make_branch_and_tree('tree')
 
155
        self.build_tree(['tree/file'])
 
156
        t.add('file')
 
157
        t.commit('commit 1')
 
158
        self.run_bzr('push -d tree pushed-to')
 
159
        path = t.branch.get_push_location()
 
160
        out, err = self.run_bzr('push', working_dir="tree")
 
161
        self.assertEqual('Using saved push location: %s\n'
 
162
                         'No new revisions or tags to push.\n' %
 
163
                         urlutils.local_path_from_url(path), err)
 
164
        out, err = self.run_bzr('push -q', working_dir="tree")
 
165
        self.assertEqual('', out)
 
166
        self.assertEqual('', err)
 
167
 
152
168
    def test_push_only_pushes_history(self):
153
169
        # Knit branches should only push the history for the current revision.
154
170
        format = bzrdir.BzrDirMetaFormat1()
661
677
    def set_config_push_strict(self, value):
662
678
        # set config var (any of bazaar.conf, locations.conf, branch.conf
663
679
        # should do)
664
 
        conf = self.tree.branch.get_config()
665
 
        conf.set_user_option('push_strict', value)
 
680
        conf = self.tree.branch.get_config_stack()
 
681
        conf.set('push_strict', value)
666
682
 
667
683
    _default_command = ['push', '../to']
668
684
    _default_wd = 'local'
827
843
        self.assertEquals("", output)
828
844
        self.assertEquals(error, "bzr: ERROR: It is not possible to losslessly"
829
845
            " push to dummy. You may want to use dpush instead.\n")
 
846
 
 
847
 
 
848
class TestPushOutput(script.TestCaseWithTransportAndScript):
 
849
 
 
850
    def test_push_log_format(self):
 
851
        self.run_script("""
 
852
            $ bzr init trunk
 
853
            Created a standalone tree (format: 2a)
 
854
            $ cd trunk
 
855
            $ echo foo > file
 
856
            $ bzr add
 
857
            adding file
 
858
            $ bzr commit -m 'we need some foo'
 
859
            2>Committing to:...trunk/
 
860
            2>added file
 
861
            2>Committed revision 1.
 
862
            $ bzr init ../feature
 
863
            Created a standalone tree (format: 2a)
 
864
            $ bzr push -v ../feature -Olog_format=line
 
865
            Added Revisions:
 
866
            1: jrandom@example.com ...we need some foo
 
867
            2>All changes applied successfully.
 
868
            2>Pushed up to revision 1.
 
869
            """)