~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-10-11 00:23:23 UTC
  • mfrom: (2070 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061011002323-82ba88c293d7caff
[merge] bzr.dev 2070

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2005 by Canonical Ltd
2
2
# -*- coding: utf-8 -*-
3
 
 
 
3
#
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
6
6
# the Free Software Foundation; either version 2 of the License, or
7
7
# (at your option) any later version.
8
 
 
 
8
#
9
9
# This program is distributed in the hope that it will be useful,
10
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
12
# GNU General Public License for more details.
13
 
 
 
13
#
14
14
# You should have received a copy of the GNU General Public License
15
15
# along with this program; if not, write to the Free Software
16
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31
31
        def bzr(*args, **kwargs):
32
32
            return self.run_bzr(*args, **kwargs)[0]
33
33
 
 
34
        os.mkdir('branch')
 
35
        os.chdir('branch')
34
36
        bzr('init')
35
37
        open('a', 'wb').write('foo\n')
36
38
        bzr('add', 'a')
51
53
        rev_id = bzr('revision-history').strip().split('\n')[-1]
52
54
 
53
55
        self.assertEquals(bzr('cat', 'a', '-r', 'revid:%s' % rev_id), 'baz\n')
54
 
 
 
56
        
 
57
        os.chdir('..')
 
58
        
 
59
        self.assertEquals(bzr('cat', 'branch/a', '-r', 'revno:1:branch'),
 
60
                          'foo\n')
 
61
        bzr('cat', 'a', retcode=3)
 
62
        bzr('cat', 'a', '-r', 'revno:1:branch-that-does-not-exist', retcode=3)
 
63