/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_alias.py

  • Committer: Robert Collins
  • Date: 2010-05-06 23:41:35 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506234135-yivbzczw1sejxnxc
Lock methods on ``Tree``, ``Branch`` and ``Repository`` are now
expected to return an object which can be used to unlock them. This reduces
duplicate code when using cleanups. The previous 'tokens's returned by
``Branch.lock_write`` and ``Repository.lock_write`` are now attributes
on the result of the lock_write. ``repository.RepositoryWriteLockResult``
and ``branch.BranchWriteLockResult`` document this. (Robert Collins)

``log._get_info_for_log_files`` now takes an add_cleanup callable.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#
17
17
 
18
18
"""Tests of the 'bzr alias' command."""
19
 
import os
20
 
import codecs
21
19
 
22
20
from bzrlib.tests.blackbox import ExternalBase
23
 
from bzrlib.config import (ensure_config_dir_exists, config_filename)
24
21
 
25
22
 
26
23
class TestAlias(ExternalBase):
44
41
        out, err = self.run_bzr('alias commit')
45
42
        self.assertEquals('bzr alias commit="commit --strict"\n', out)
46
43
 
47
 
    def test_unicode_alias(self):
48
 
        """Unicode aliases should work (Bug #529930)"""
49
 
        config_enc = 'utf-8'
50
 
        file_name = u'foo\xb6'
51
 
 
52
 
        tree = self.make_branch_and_tree('.')
53
 
        self.build_tree([file_name])
54
 
        tree.add(file_name)
55
 
        tree.commit('added')
56
 
 
57
 
        ensure_config_dir_exists()
58
 
        CONFIG=(u'[ALIASES]\n'
59
 
                u'ust=st foo\xb6\n')
60
 
 
61
 
        codecs.open(config_filename(),'w', config_enc).write(CONFIG)
62
 
 
63
 
        out, err = self.run_bzr('ust')
64
 
        self.assertEquals(err, '')
65
 
        self.assertEquals(out, '')
66
 
 
67
44
    def test_alias_listing_alphabetical(self):
68
45
        self.run_bzr('alias commit="commit --strict"')
69
46
        self.run_bzr('alias ll="log --short"')